Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
vn_traits = pcia.process_sv_images_core(vis_id, img, nir_id, nir, nir2, traits)
print "...uploading resulting metadata"
# upload the individual file metadata
metadata = {
"@context": {
"@vocab": "https://clowder.ncsa.illinois.edu/clowder/assets/docs/api/index.html#!/files/uploadToDataset"
},
"content": vn_traits[0],
"agent": {
"@type": "cat:extractor",
"extractor_id": parameters['host'] + "/api/extractors/" + extractorName
}
}
parameters["fileid"] = vis_id
extractors.upload_file_metadata_jsonld(mdata=metadata, parameters=parameters)
metadata = {
"@context": {
"@vocab": "https://clowder.ncsa.illinois.edu/clowder/assets/docs/api/index.html#!/files/uploadToDataset"
},
"content": vn_traits[1],
"agent": {
"@type": "cat:extractor",
"extractor_id": parameters['host'] + "/api/extractors/" + extractorName
}
}
parameters["fileid"] = nir_id
extractors.upload_file_metadata_jsonld(mdata=metadata, parameters=parameters)
# compose the summary traits
trait_list = pcia.generate_traits_list(traits)
}
}
parameters["fileid"] = vis_id
extractors.upload_file_metadata_jsonld(mdata=metadata, parameters=parameters)
metadata = {
"@context": {
"@vocab": "https://clowder.ncsa.illinois.edu/clowder/assets/docs/api/index.html#!/files/uploadToDataset"
},
"content": vn_traits[1],
"agent": {
"@type": "cat:extractor",
"extractor_id": parameters['host'] + "/api/extractors/" + extractorName
}
}
parameters["fileid"] = nir_id
extractors.upload_file_metadata_jsonld(mdata=metadata, parameters=parameters)
# compose the summary traits
trait_list = [ traits['plant_barcode'],
traits['genotype'],
traits['treatment'],
traits['imagedate'],
np.mean(traits['sv_area']),
traits['tv_area'],
np.mean(traits['hull_area']),
np.mean(traits['solidity']),
np.mean(traits['height']),
np.mean(traits['perimeter'])]
outfile = 'avg_traits.csv'
with open(outfile, 'w') as csv:
}
}
parameters["fileid"] = vis_id
extractors.upload_file_metadata_jsonld(mdata=metadata, parameters=parameters)
metadata = {
"@context": {
"@vocab": "https://clowder.ncsa.illinois.edu/clowder/assets/docs/api/index.html#!/files/uploadToDataset"
},
"content": vn_traits[1],
"agent": {
"@type": "cat:extractor",
"extractor_id": parameters['host'] + "/api/extractors/" + extractorName
}
}
parameters["fileid"] = nir_id
extractors.upload_file_metadata_jsonld(mdata=metadata, parameters=parameters)
# compose the summary traits
trait_list = pcia.generate_traits_list(traits)
# generate output CSV
outfile = 'avg_traits.csv'
pcia.generate_average_csv(outfile, fields, trait_list)
extractors.upload_file_to_dataset(outfile, parameters)
os.remove(outfile)
metadata = {
"@context": {
"@vocab": "https://clowder.ncsa.illinois.edu/clowder/assets/docs/api/index.html#!/files/uploadToDataset"
},
"dataset_id": parameters["datasetId"],
"content": {"status": "COMPLETED"},
"agent": {