def _create_simplex_coverage(cls, dataset_id, parameter_dictionary, spatial_domain, temporal_domain): file_root = FileSystem.get_url(FS.CACHE, 'datasets') scov = SimplexCoverage(file_root, dataset_id, 'Simplex Coverage for %s' % dataset_id, parameter_dictionary=parameter_dictionary, temporal_domain=temporal_domain, spatial_domain=spatial_domain) return scov
def _create_coverage(self, dataset_id, description, parameter_dict, spatial_domain, temporal_domain): pdict = ParameterDictionary.load(parameter_dict) sdom = GridDomain.load(spatial_domain) tdom = GridDomain.load(temporal_domain) file_root = FileSystem.get_url(FS.CACHE, 'datasets') scov = SimplexCoverage(file_root, dataset_id, description or dataset_id, parameter_dictionary=pdict, temporal_domain=tdom, spatial_domain=sdom, inline_data_writes=self.inline_data_writes) return scov
def _create_simplex_coverage(cls, dataset_id, parameter_dictionary, spatial_domain, temporal_domain, inline_data_writes=True): file_root = FileSystem.get_url(FS.CACHE, 'datasets') scov = SimplexCoverage(file_root, uuid4().hex, 'Simplex Coverage for %s' % dataset_id, parameter_dictionary=parameter_dictionary, temporal_domain=temporal_domain, spatial_domain=spatial_domain, inline_data_writes=inline_data_writes) return scov
def _create_coverage(self, dataset_id, parameter_dict_id, time_dom, spatial_dom): pd = self.dataset_management_client.read_parameter_dictionary( parameter_dict_id) pdict = ParameterDictionary.load(pd) sdom = GridDomain.load(spatial_dom.dump()) tdom = GridDomain.load(time_dom.dump()) file_root = FileSystem.get_url(FS.CACHE, 'datasets') scov = SimplexCoverage(file_root, dataset_id, dataset_id, parameter_dictionary=pdict, temporal_domain=tdom, spatial_domain=sdom) return scov
def _get_coverage(cls,dataset_id): filename = FileSystem.get_hierarchical_url(FS.CACHE, dataset_id, '.cov') coverage = SimplexCoverage.load(filename) return coverage
def _persist_coverage(cls, dataset_id, coverage): validate_is_instance(coverage,SimplexCoverage,'Coverage is not an instance of SimplexCoverage: %s' % type(coverage)) filename = FileSystem.get_hierarchical_url(FS.CACHE, dataset_id, '.cov') SimplexCoverage.save(coverage, filename, use_ascii=False)
def _get_coverage(cls, dataset_id, mode='w'): file_root = FileSystem.get_url(FS.CACHE, 'datasets') coverage = SimplexCoverage(file_root, dataset_id, mode=mode) return coverage