Removing the argument-shortName from podaac data source
Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/2441b166 Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/2441b166 Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/2441b166 Branch: refs/heads/master Commit: 2441b16690faa8038e96f1b8e4cff318a77dcf51 Parents: 7d0daf0 Author: Omkar20895 <omkarreddy2...@gmail.com> Authored: Fri Aug 26 20:32:05 2016 +0530 Committer: Omkar20895 <omkarreddy2...@gmail.com> Committed: Fri Aug 26 20:32:05 2016 +0530 ---------------------------------------------------------------------- examples/podaac_integration_example.py | 3 +-- ocw/data_source/podaac_datasource.py | 5 ++--- ocw/tests/test_podaac.py | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/2441b166/examples/podaac_integration_example.py ---------------------------------------------------------------------- diff --git a/examples/podaac_integration_example.py b/examples/podaac_integration_example.py index f81ba31..da90373 100644 --- a/examples/podaac_integration_example.py +++ b/examples/podaac_integration_example.py @@ -21,14 +21,13 @@ import ocw.metrics as metrics import ocw.plotter as plotter datasetId = 'PODAAC-CCF30-01XXX' -datasetShortName = 'CCMP_MEASURES_ATLAS_L4_OW_L3_0_WIND_VECTORS_FLK' variable = 'uwnd' name = 'PO.DAAC_test_dataset' OUTPUT_PLOT = "ccmp_temporal_std" """ Step 1: Load Local NetCDF Files into OCW Dataset Objects """ print("Loading %s dataset into an OCW dataset objects" % datasetShortName) ccmp_dataset = podaac.load_dataset( - variable=variable, datasetId=datasetId, datasetShortName=datasetShortName, name=name) + variable=variable, datasetId=datasetId, name=name) print("CCMP_Dataset.values shape: (times, lats, lons) - %s \n" % (ccmp_dataset.values.shape,)) http://git-wip-us.apache.org/repos/asf/climate/blob/2441b166/ocw/data_source/podaac_datasource.py ---------------------------------------------------------------------- diff --git a/ocw/data_source/podaac_datasource.py b/ocw/data_source/podaac_datasource.py index 7e184d4..4a08046 100644 --- a/ocw/data_source/podaac_datasource.py +++ b/ocw/data_source/podaac_datasource.py @@ -42,7 +42,7 @@ def convert_times_to_datetime(time): return [parsed_time.num2date(x) for x in time[:]] -def load_dataset(variable, datasetId='', datasetShortName='', name=''): +def load_dataset(variable, datasetId='', name=''): '''Loads a Dataset from PODAAC :param variable: The name of the variable to read from the dataset. @@ -70,7 +70,7 @@ def load_dataset(variable, datasetId='', datasetShortName='', name=''): podaac = Podaac() path = os.path.dirname(os.path.abspath(__file__)) granuleName = podaac.extract_l4_granule( - dataset_id=datasetId, short_name=datasetShortName, path=path) + dataset_id=datasetId, path=path) path = path + '/' + granuleName d = netcdf_dataset(path, mode='r') dataset = d.variables[variable] @@ -109,4 +109,3 @@ def load_dataset(variable, datasetId='', datasetShortName='', name=''): os.remove(path) return Dataset(lats, lons, times, values, variable, name=name, origin=origin) - http://git-wip-us.apache.org/repos/asf/climate/blob/2441b166/ocw/tests/test_podaac.py ---------------------------------------------------------------------- diff --git a/ocw/tests/test_podaac.py b/ocw/tests/test_podaac.py index 3e2dafd..66afcb8 100644 --- a/ocw/tests/test_podaac.py +++ b/ocw/tests/test_podaac.py @@ -28,13 +28,12 @@ class TestPodaacDataSource(unittest.TestCase): @classmethod def setUpClass(cls): cls.datasetId = 'PODAAC-GHCMC-4FM02' - cls.datasetShortName = 'CMC0.2deg-CMC-L4-GLOB-v2.0' cls.variable = 'sea_ice_fraction' cls.name = 'PO.DAAC_test_dataset' cls.file_path = os.path.dirname(os.path.abspath(__file__)) cls.format = '.nc' cls.dataset = podaac.load_dataset( - cls.variable, cls.datasetId, cls.datasetShortName, cls.name) + cls.variable, cls.datasetId, cls.name) def test_is_dataset(self): self.assertTrue(isinstance(self.dataset, Dataset))