def dataset_temporal_bounds(self, dataset_id): coverage = self._get_coverage(dataset_id) temporal_param = coverage.temporal_parameter_name try: bounds = coverage.get_data_bounds(temporal_param) except ValueError: return (coverage.get_parameter_context(temporal_param).fill_value,) * 2 uom = coverage.get_parameter_context(temporal_param).uom new_bounds = (TimeUtils.units_to_ts(uom,bounds[0]), TimeUtils.units_to_ts(uom,bounds[1])) return new_bounds
def dataset_temporal_bounds(self, dataset_id): coverage = self._get_coverage(dataset_id) temporal_param = coverage.temporal_parameter_name try: bounds = coverage.get_data_bounds(temporal_param) except ValueError: return (coverage.get_parameter_context(temporal_param).fill_value, ) * 2 uom = coverage.get_parameter_context(temporal_param).uom new_bounds = (TimeUtils.units_to_ts(uom, bounds[0]), TimeUtils.units_to_ts(uom, bounds[1])) return new_bounds
def dataset_temporal_bounds(self, dataset_id): dataset = self.read_dataset(dataset_id) if not dataset: return {} pdict = ParameterDictionary.load(dataset.parameter_dictionary) temporal_parameter = pdict.temporal_parameter_name units = pdict.get_temporal_context().uom bounds = self.dataset_bounds(dataset_id) if not bounds: return {} bounds = bounds[temporal_parameter or 'time'] bounds = [TimeUtils.units_to_ts(units, i) for i in bounds] return bounds
def dataset_temporal_bounds(self, dataset_id): dataset = self.read_dataset(dataset_id) parameter_dictionary_id = self.clients.resource_registry.find_objects(dataset_id, PRED.hasParameterDictionary, id_only=True)[0][0] pdict = self._coverage_parameter_dictionary(parameter_dictionary_id) if not dataset: return {} temporal_parameter = pdict.temporal_parameter_name units = pdict.get_temporal_context().uom bounds = self.dataset_bounds(dataset_id) if not bounds: return {} bounds = bounds[temporal_parameter or 'time'] bounds = [TimeUtils.units_to_ts(units, i) for i in bounds] return bounds
def dataset_temporal_bounds(self, dataset_id): dataset = self.read_dataset(dataset_id) parameter_dictionary_id = self.clients.resource_registry.find_objects( dataset_id, PRED.hasParameterDictionary, id_only=True)[0][0] pdict = self._coverage_parameter_dictionary(parameter_dictionary_id) if not dataset: return {} temporal_parameter = pdict.temporal_parameter_name units = pdict.get_temporal_context().uom bounds = self.dataset_bounds(dataset_id) if not bounds: return {} bounds = bounds[temporal_parameter or 'time'] bounds = [TimeUtils.units_to_ts(units, i) for i in bounds] return bounds