Repository: climate Updated Branches: refs/heads/master 5d980b4df -> fd8ca98c5
CLIMATE-948 cleanup podaac_datasource to accomodate Podaacpy 2.1.0 Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/ad5757db Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/ad5757db Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/ad5757db Branch: refs/heads/master Commit: ad5757dbd6ed7043d9565c34cc7460e0408f862c Parents: 8e1edc8 Author: Lewis John McGibbney <lewis.mcgibb...@gmail.com> Authored: Tue Mar 13 18:03:10 2018 -0700 Committer: Lewis John McGibbney <lewis.mcgibb...@gmail.com> Committed: Tue Mar 13 18:03:10 2018 -0700 ---------------------------------------------------------------------- ocw/data_source/podaac_datasource.py | 23 +++++++++-------------- ocw/tests/test_podaac.py | 4 ++-- 2 files changed, 11 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/ad5757db/ocw/data_source/podaac_datasource.py ---------------------------------------------------------------------- diff --git a/ocw/data_source/podaac_datasource.py b/ocw/data_source/podaac_datasource.py index 708b72a..3002567 100644 --- a/ocw/data_source/podaac_datasource.py +++ b/ocw/data_source/podaac_datasource.py @@ -46,17 +46,17 @@ def convert_times_to_datetime(time): return [parsed_time.num2date(x) for x in time[:]] -def list_available_extract_granule_dataset_ids(): +def list_available_level4_extract_granule_dataset_ids(): '''Convenience function which returns an up-to-date \ - list of available granule dataset id's which can be \ + list of available level4 blended granule dataset id's which can be \ used in the granule extraction service. :returns: a comma-seperated list of granule dataset id's. ''' podaac_utils = PodaacUtils() - return podaac_utils.list_available_extract_granule_dataset_ids() + return podaac_utils.list_level4_dataset_ids() -def subset_granule(variable, dataset_id='', name='', path='/tmp', input_file_path=''): +def subset_granule(variable, name='', path='/tmp', 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. @@ -64,11 +64,6 @@ def subset_granule(variable, dataset_id='', name='', path='/tmp', input_file_pat :param variable: The name of the variable to read from the dataset. :type variable: :mod:`string` - :param dataset_id: dataset persistent ID. datasetId or \ - shortName is required for a granule search. Example: \ - PODAAC-ASOP2-25X01 - :type dataset_id: :mod:`string` - :param name: (Optional) A name for the loaded dataset. :type name: :mod:`string` @@ -95,9 +90,9 @@ def extract_l4_granule(variable, dataset_id='', name='', path='/tmp'): :param variable: The name of the variable to read from the dataset. :type variable: :mod:`string` - :param dataset_id: dataset persistent ID. datasetId or \ - shortName is required for a granule search. Example: \ - PODAAC-ASOP2-25X01 + :param dataset_id: dataset persistent ID. datasetId \ + is required for a granule search. Example: \ + PODAAC-CCF35-01AD5 :type dataset_id: :mod:`string` :param name: (Optional) A name for the loaded dataset. @@ -147,8 +142,8 @@ def read_dataset(name='', granule_name ='', variable=None, path='/tmp'): lons = np.array(d.variables[lon][:]) values = np.array(dataset[:]) origin = { - 'source': 'PO.DAAC', - 'url': 'podaac.jpl.nasa.gov' + 'source': 'NASA JPL PO.DAAC', + 'url': 'https://podaac.jpl.nasa.gov' } # Removing the downloaded temporary granule before creating the OCW http://git-wip-us.apache.org/repos/asf/climate/blob/ad5757db/ocw/tests/test_podaac.py ---------------------------------------------------------------------- diff --git a/ocw/tests/test_podaac.py b/ocw/tests/test_podaac.py index 09b6901..6c600ab 100644 --- a/ocw/tests/test_podaac.py +++ b/ocw/tests/test_podaac.py @@ -74,8 +74,8 @@ class TestPodaacDataSource(unittest.TestCase): def test_dataset_origin(self): print('in test_dataset_origin') - self.assertEquals(self.dataset.origin['source'], 'PO.DAAC') - self.assertEquals(self.dataset.origin['url'], 'podaac.jpl.nasa.gov') + self.assertEquals(self.dataset.origin['source'], 'NASA JPL PO.DAAC') + self.assertEquals(self.dataset.origin['url'], 'https://podaac.jpl.nasa.gov') def test_custom_name(self): print('in test_custom_name')