API documentation¶
ai.cdas¶
The module implements an interface to the REST API of NASA CDAweb.
Refer to CDAS RESTful Web Services (https://cdaweb.gsfc.nasa.gov/WebServices/REST/) for detailed description of parameters.
-
exception
ai.cdas.
NoDataError
[source]¶ The exception that is raised when no data is found on the server.
-
ai.cdas.
get_data
(dataview, dataset, startTime, stopTime, variables, cdf=False, progress=True)[source]¶ Queries server (and data cache) for data.
Parameters: - dataview (string) – Dataview.
- dataset (string) – Dataset.
- startTime (datatime) – First datetime for the requested data.
- stopTime (datetime) – Last datetime for the requested data.
- variables (list) – list of strings representing IDs of requested variables.
- cdf (bool, optional) – If True uses CDF data format for download, otherwise downloads in ASCII format. Defaults to False.
- progress (bool, optional) – If True displays the download progress bar. Defaults to True.
Returns: Dictionary of data arrays or sequences.
Return type: (dict)
-
ai.cdas.
get_datasets
(dataview, observatoryGroup=None, instrumentType=None, observatory=None, instrument=None, startDate=None, stopDate=None, idPattern=None, labelPattern=None, notesPattern=None)[source]¶ Queries server for descriptions of the datasets.
Parameters: - dataview (string) – Dataview.
- observatoryGroup (string, optional) – Observatory group.
- instrumentType (string, optional) – Instrument type.
- observatory (string, optional) – Observatory.
- instrument (string, optional) – Instrument.
- startDate (datetime, optional) – Start date.
- stopDate (datetime, optional) – Stop date.
- idPattern (string, optional) – Id pattern.
- labelPattern (string, optional) – Label pattern.
- notesPattern (string, optional) – Notes pattern.
Returns: JSON response from the server.
Return type: (dict)
-
ai.cdas.
get_dataviews
()[source]¶ Queries server for descriptions of dataviews.
Returns: JSON response from the server. Return type: (dict)
-
ai.cdas.
get_instrument_types
(dataview, observatory=None, observatoryGroup=None)[source]¶ Queries server for descriptions of instrument types.
Parameters: Returns: JSON response from the server.
Return type: (dict)
-
ai.cdas.
get_instruments
(dataview, observatory=None)[source]¶ Queries server for descriptions of the instruments.
Parameters: Returns: JSON response from the server.
Return type: (dict)
-
ai.cdas.
get_inventory
(dataview, dataset)[source]¶ Queries server for descriptions of the data inventory within a dataset.
Parameters: Returns: JSON response from the server.
Return type: (dict)
-
ai.cdas.
get_observatories
(dataview, instrument=None, instrumentType=None)[source]¶ Queries server for descriptions of the observatories.
Parameters: Returns: JSON response from the server.
Return type: (dict)
-
ai.cdas.
get_observatory_groups
(dataview, instrumentType=None)[source]¶ Queries server for descriptions of observatory groups.
Parameters: Returns: JSON response from the server.
Return type: (dict)
-
ai.cdas.
get_observatory_groups_and_instruments
(dataview, instrumentType=None)[source]¶ Queries server for descriptions of observatory groups (and associated instruments). This is a convenience/performance alternative to making multiple calls to get_observatory_groups, get_observatories, and get_instruments.
Parameters: Returns: JSON response from the server.
Return type: (dict)