def addSpeciesInfo(bccvlmd, result): if ISDMExperiment.providedBy(result.__parent__): spds = uuidToObject(result.job_params['species_occurrence_dataset']) if IProjectionExperiment.providedBy(result.__parent__): spds = uuidToObject(result.job_params['species_distribution_models']) speciesmd = IBCCVLMetadata(spds).get('species', None) if speciesmd: bccvlmd['species'] = speciesmd.copy()
def experiment_inputs(self, context=None): # return visualisable input datasets for experiment # - used in overlay and compare pages if context is None: context = self.context pc = getToolByName(self.context, 'portal_catalog') if ISDMExperiment.providedBy(context): # for sdm we return selected occurrence and absence dataset # TODO: once available include pesudo absences from result for dsuuid in (context.species_occurrence_dataset, context.species_absence_dataset): brain = uuidToCatalogBrain(dsuuid) if brain: yield brain elif IMMExperiment.providedBy(context): # for mme we return selected occurrence dataset only # TODO: once available include pesudo absences from result for dsuuid in (context.species_occurrence_dataset,): brain = uuidToCatalogBrain(dsuuid) if brain: yield brain elif IMSDMExperiment.providedBy(context): # muilt species sdm inputs for dsuuid in (context.species_occurrence_collections): brain = uuidToCatalogBrain(dsuuid) if brain: yield brain elif IProjectionExperiment.providedBy(context): # one experiment - multiple models for sdmuuid, models in context.species_distribution_models.items(): sdm = uuidToObject(sdmuuid) if not sdm: continue for model in models: # yield current projections for each model model_brain = uuidToCatalogBrain(model) if not model_brain: continue # Return only constraint SDM projection res_path = model_brain.getPath().rsplit('/', 1) for projection in pc.searchResults(path=res_path, BCCDataGenre='DataGenreCP'): yield projection
def experiment_inputs(self, context=None): # return visualisable input datasets for experiment # - used in overlay and compare pages if context is None: context = self.context pc = getToolByName(self.context, 'portal_catalog') if ISDMExperiment.providedBy(context): # for sdm we return selected occurrence and absence dataset # TODO: once available include pesudo absences from result for dsuuid in (context.species_occurrence_dataset, context.species_absence_dataset): brain = uuidToCatalogBrain(dsuuid) if brain: yield brain elif IMMExperiment.providedBy(context): # for mme we return selected occurrence dataset only # TODO: once available include pesudo absences from result for dsuuid in (context.species_occurrence_dataset, ): brain = uuidToCatalogBrain(dsuuid) if brain: yield brain elif IMSDMExperiment.providedBy(context): # muilt species sdm inputs for dsuuid in (context.species_occurrence_collections): brain = uuidToCatalogBrain(dsuuid) if brain: yield brain elif IProjectionExperiment.providedBy(context): # one experiment - multiple models for sdmuuid, models in context.species_distribution_models.items(): sdm = uuidToObject(sdmuuid) if not sdm: continue for model in models: # yield current projections for each model model_brain = uuidToCatalogBrain(model) if not model_brain: continue # Return only constraint SDM projection res_path = model_brain.getPath().rsplit('/', 1) for projection in pc.searchResults( path=res_path, BCCDataGenre='DataGenreCP'): yield projection