def list_dataset_ids(self): """Print out the dataset ids associated with the instruments specified as command line params.""" for instrument in self.args.dataset_ids: with log.error_on_exception("Failed reading dataset ids for", repr(instrument)): for context in self.contexts: ids = api.get_dataset_ids(context, instrument) for dataset_id in ids: print(context, dataset_id)
def determine_source_ids(self): """Return the dataset ids for all instruments.""" server = api.get_crds_server() source_ids = [] for instrument in self.instruments: since_date = self.datasets_since(instrument) if since_date: log.info("Dumping dataset parameters for", repr(instrument), "from CRDS server at", repr(server), "since", repr(since_date)) else: log.info("Dumping dataset parameters for", repr(instrument), "from CRDS server at", repr(server)) instr_ids = api.get_dataset_ids(self.context, instrument, self.datasets_since(instrument)) log.info("Downloaded ", len(instr_ids), "dataset ids for", repr(instrument), "since", repr(since_date)) source_ids.extend(instr_ids) return sorted(source_ids) # sort is needed to match generic __iter__() sort. assumes instruments don't shuffle