Github user Omkar20895 commented on a diff in the pull request: https://github.com/apache/climate/pull/411#discussion_r81418144 --- Diff: ocw/data_source/podaac_datasource.py --- @@ -41,9 +42,39 @@ def convert_times_to_datetime(time): parsed_time = utime(units) return [parsed_time.num2date(x) for x in time[:]] +def list_available_extract_granule_dataset_ids(): + '''Convenience function which returns an up-to-date \ + list of available granule dataset id's which can be \ + used in the granule extraction service. -def load_dataset(variable, datasetId='', name=''): - '''Loads a Dataset from PODAAC + :returns: a comma-seperated list of granule dataset id's. + + ''' + podaac_utils = PodaacUtils() + return podaac_utils.list_available_extract_granule_dataset_ids() + +def subset_granule(input_file_path=''): + '''Subset Granule service allows users to Submit subset jobs. \ + Use of this service should be preceded by a Granule Search in \ + order to identify and generate a list of granules to be subsetted. + + :param input_file_path: path to a json file which contains the \ + the request that you want to send to PO.DAAC + :type input_file_path: :mod:`string` + + :returns: a token on successful request reception. This can be \ + further used to check the status of the request. + + ''' + podaac = Podaac() + status = podaac.subset_status(podaac.granule_subset(input_file_path)) + print("Granule subsetting initiated with request tracking token '%s'." % status) + while status is not "200": --- End diff -- Instead of 200 it should be the string "done" here, because as much as I have noticed subset_token returns the following status - "submitted" : returned on successful submission - "error" : returned when there is error in the JSON POST request. - "unknown" : I am uncertain about this. - "done" : returned when subsetting is done.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---