Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
ISSUE-155 drive.Drive(file) attempts to read from erroneous 'tests' d…
Browse files Browse the repository at this point in the history
…irectory (#156)

* ISSUE-155 drive.Drive(file) attempts to read from erroneous 'tests' directory
  • Loading branch information
lewismc committed Aug 23, 2019
1 parent cd5974e commit 4d7532c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ For more information on this function, see :doc:`webservices`

Additionally, we can search metadata for list of granules archived within the last 24 hours in `Datacasting <http:https://datacasting.jpl.nasa.gov/xml_specification/>`_ format. ::

result = p.load_last24hours_datacasting_granule_md(dataset_id='PODAAC-GHMG2-2PO01')
result = p.last24hours_datacasting_granule_md(dataset_id='PODAAC-GHMG2-2PO01')

The variable **result** now contains an XML response containing a list of data granules which can be processed appropriately.
For more information on this function, see :doc:`webservices`
Expand Down
4 changes: 2 additions & 2 deletions examples/podaacpy_getting_started_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"outputs": [],
"source": [
"# Additionally, we can search metadata for list of granules archived within the last 24 hours in Datacasting format.\n",
"print(p.load_last24hours_datacasting_granule_md(dataset_id='PODAAC-AQR50-3YVAS'))"
"print(p.last24hours_datacasting_granule_md(dataset_id='PODAAC-AQR50-3YVAS'))"
]
},
{
Expand Down Expand Up @@ -261,7 +261,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion podaac/drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, file, username, password, webdav_url='https://podaac-tools.jp
'''
config = configparser.ConfigParser()
if file:
config_file_path = os.path.join(os.path.dirname(__file__), "tests", file)
config_file_path = os.path.join(os.path.dirname(__file__), file)
config.read_file(open(config_file_path, 'r'))
self.USERNAME = config['drive']['urs_username']
self.PASSWORD = config['drive']['urs_password']
Expand Down
10 changes: 6 additions & 4 deletions podaac/l2ss.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class L2SS:
def __init__(self):
self.URL = 'https://podaac-tools.jpl.nasa.gov/l2ss-services/l2ss/'

def dataset_search(self, dataset_id='', variable=None, sensor=None, provider=None, start_time='', end_time='', start_index='', items_per_page=''):
def dataset_search(self, dataset_id='', variable=None, sensor=None, provider=None,
start_time='', end_time='', start_index='', items_per_page='50'):
''' Dataset search service lists available datasets and returns them.
:param dataset_id: Search dataset belong to given PODAAC Dataset persistent ID.
Expand All @@ -51,7 +52,7 @@ def dataset_search(self, dataset_id='', variable=None, sensor=None, provider=Non
the dataset will be used. Example: 2019-12-31T23:59:59-06:00Z
:type end_time: :mod:`string`
:param items_per_page: number of results to return.
:param items_per_page: number of results to return. Defaults to 50.
:type items_per_page: :mod:`string`
:param start_index: start index of result.
Expand Down Expand Up @@ -123,7 +124,8 @@ def dataset_variables(self, dataset_id):

return variables.text

def granule_search(self, dataset_id='', bbox='', start_time='', end_time='', name='', sort='', start_index='', items_per_page=''):
def granule_search(self, dataset_id='', bbox='', start_time='', end_time='',
name='', sort='', start_index='', items_per_page='50'):
''' Granule Search retrieves all base granule information (datasetId, start time, end time) \
matching the specified datasetId, date, and region. This approach may change if \
the data/querying turns out to be too expensive. Response is structured in a minimalistic\
Expand Down Expand Up @@ -152,7 +154,7 @@ def granule_search(self, dataset_id='', bbox='', start_time='', end_time='', nam
Example: sort='Granule-Name asc'
:type sort: :mod:`string`
:param items_per_page: number of results to return.
:param items_per_page: number of results to return. Default to 50.
:type items_per_page: :mod:`string`
:param start_index: start index of result.
Expand Down
13 changes: 7 additions & 6 deletions podaac/podaac.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def dataset_metadata(self, dataset_id='', short_name='', _format='iso'):

def dataset_search(self, keyword='', start_time='', end_time='', start_index='', dataset_id='', short_name='',
instrument='', satellite='', file_format='', status='', process_level='', sort_by='',
bbox='', items_per_page='7', _format='atom', full='False'):
bbox='', items_per_page='50', _format='atom', full='False'):
'''Dataset Search service searches PO.DAAC's dataset catalog, over \
Level 2, Level 3, and Level 4 datasets, using the following parameters: \
dataset_id, short_name, start_time, end_time, bbox, and others.
Expand All @@ -104,7 +104,7 @@ def dataset_search(self, keyword='', start_time='', end_time='', start_index='',
:param items_per_page: number of results per page for \
opensearch result. If format is not specified, format is set \
to 7. The value range is from 0 to 400
to 50. The value range is from 0 to 400
:type items_per_page: :mod:`int`
:param dataset_id: dataset persistent ID. \
Expand Down Expand Up @@ -288,7 +288,8 @@ def granule_metadata(self, dataset_id='', short_name='', granule_name='', _forma

return granule_md.text

def load_last24hours_datacasting_granule_md(self, dataset_id='', short_name='', _format='datacasting', items_per_page=7):
def last24hours_datacasting_granule_md(self, dataset_id='',
short_name='', _format='datacasting', items_per_page=50):
'''Granule metadata service retrieves metadata for a list \
of granules archived within the last 24 hours in Datacasting \
format.
Expand All @@ -304,7 +305,7 @@ def load_last24hours_datacasting_granule_md(self, dataset_id='', short_name='',
:param _format: metadata format. Must set to 'datacasting'.
:type _format: :mod:`string`
:param items_per_page: number of results per page. Default value is 7. \
:param items_per_page: number of results per page. Default value is 50. \
The value range is from 0 to 5000.
:type items_per_page: :mod:`int`
Expand Down Expand Up @@ -336,7 +337,7 @@ def load_last24hours_datacasting_granule_md(self, dataset_id='', short_name='',
return granule_md.text

def granule_search(self, dataset_id='', start_time='', end_time='', bbox='', start_index='', sort_by='timeAsc',
items_per_page='7', _format='atom'):
items_per_page='50', _format='atom'):
'''Search Granule does granule searching on PO.DAAC level 2 swath \
datasets (individual orbits of a satellite), and level 3 & 4 \
gridded datasets (time averaged to span the globe). Coverage \
Expand Down Expand Up @@ -377,7 +378,7 @@ def granule_search(self, dataset_id='', start_time='', end_time='', bbox='', sta
:type start_index: :mod:`int`
:param items_per_page: number of results per page for opensearch \
result. If format is not specified, format is set to 7. The \
result. If format is not specified, format is set to 50. The \
value range is from 0 to 400
:type items_per_page: :mod:`int`
Expand Down
Loading

0 comments on commit 4d7532c

Please sign in to comment.