Research Data Archive (RDA) python client
Project description
rdams
for Python
The rdams
Python utility can be run by registered RDA users to get detailed metadata for RDA data sets, to submit subset requests on select gridded data sets, to check on the processing status of any subset requests, and to download completed request output files to a local system.
The script can be used both on the command line or loaded as a module to interact with the response object directly. The Jupyter Notebook in this directory provides an example of how you could potentially use the module.
rdams
can be run using both python 2 and python 3, however, the requests
library is required load the script.
Installation
python -m pip install pyrdams
Usage
rdams -get_summary <dsnnn.n>
rdams -get_metadata <dsnnn.n> <-f>
rdams -get_param_summary <dsnnn.n> <-f>
rdams -submit [control_file_name]
rdams -get_status <RequestIndex> <-proc_status>
rdams -download [RequestIndex]
rdams -globus_download [RequestIndex]
rdams -get_control_file_template <dsnnn.n>
rdams -help
Description of Options
-get_summary
provides an overview of what data sets and data set groups have subsetting available.-get_summary <dsnnn.n>
provides an overview of what dataset groups have subsetting available indsnnn.n
.-get_metadata <dsnnn.n>
dumps out a list of all available parameters found indsnnn.n
for subsetting.-get_metadata <dsnnn.n> <-f>
dumps out the metadata in fixed sized columns.-get_metadata <dsnnn.n>
parameters are dumped out on each line in the following order, using|
s as separators:dataset|param|param_description|startdate|enddate|native_format|product|gridproj|griddef|level|level_description|levelvalue
-submit [control_file_name]
is used to submit a subset request control file. Subset request control files are built from the parameters dumped out by the-get_metadata <dsnnn.n>
option.-get_status
dumps out the status of all subset requests.-get_status <RequestID>
dumps out the status of subset requestRequestID
.-download [RequestIndex]
download request output files forRequestIndex
to your local system. only for external users-get_control_file_template
dumps out an example control file template to your local directory.-get_control_file_template <dsnnn.n>
dumps out a working example control file for dsnnn.n to your local directory.
Example
To submit an example request, try the following:
- Download an example control file for the data set of your choice,
dsnnn.n
:
rdams -get_control_file_template <dsnnn.n>
- Submit the example control file for "dsnnn.n" into the system as a subset request:
rdams -submit [dsnnn.n_control_file]
- Check on subset request processing status:
rdams -get_status
- Download completed requests (only for external users):
rdams -download [RequestIndex]
- Get a listing of parameters available for subsetting (used to populate dsnnn.n_control_file):
rdams -get_metadata dsnnn.n
- Download a generic control file template that includes field descriptors:
rdams -get_control_file_template
Description of Parameters in Control File Template
dataset=dsnnn.n # Required, use '-get_metadata' field 'dataset'
date=YYYYMMDDHHMN/to/YYYYMMDDHHMM # Required, use '-get_metadata' fields 'startdate' and 'enddate' as bounds
datetype=init # Optional, use if you would like the date range to include data based on model initialization date/time instead of valid date/time
param=SSSS/SSSS/SSSS # Required, use '-get_metadata' field 'param' or 'param_description'. Separate multiple parameters with "/".
level=SSSS:NNN/NNN;SSSS:NNN;SSSS:NNN/NNN # Optional, use '-get_metadata' field 'level' or 'level_description' for 'SSSS'.
# Use '-get_metadata' field 'levelvalue' for 'NNN'. Separate multiple level values with "/".
oformat=SSSS # Optional but required if spatial subsetting is requested on select datasets. Current options are netCDF or csv for single grid point extraction.
nlat=NN # Optional, use for spatial subset requests 90 to -90
slat=NN # Optional, use for spatial subset requests 90 to -90
wlon=NN # Optional, use for spatial subset requests -180 to 180
elon=NN # Optional, use for spatial subset requests -180 to 180
# To extract a single grid point at lat=yy.y,lon=xxx.x, set both nlat and slat=yy.y, and both elon and wlon = xxx.x
product=SSSS/SSSS/SSSS # Optional, use '-get_metadata' field 'product'. Separate multiple products with "/".
gridproj=SSSS # Optional, use '-get_metadata' field 'gridproj'
griddef=SSSS # Optional, use '-get_metadata' field 'griddef'
groupindex=NN # Optional, use '-get_summary' field 'groupindex' if available
compression=NN # Optional, use 'GZ' for gzip, 'Z' for unix compress, 'BZ2' for bzip2, or 'ZIP' for Zip, for external users only
targetdir=SSSS # Optional, request output will be created in current working directory if 'targetdir' is not set to a desired output directory. This option is only available for NCAR HPC users.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyrdams-3.0.1.tar.gz
.
File metadata
- Download URL: pyrdams-3.0.1.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b27eab7c06f1676bff80df896e30cde908474885326725b39b06531a196cab2 |
|
MD5 | 172b69b6ffc8c8e717cc878527e05cd9 |
|
BLAKE2b-256 | a419565be60384c15fdc2359daf3b5c0acd63bbbe58df4fb5d88db343ac12e69 |
File details
Details for the file pyrdams-3.0.1-py3-none-any.whl
.
File metadata
- Download URL: pyrdams-3.0.1-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11cf5560b5e61775a33b1651fdc52add1335789994435a7de14a83690a18737c |
|
MD5 | 2b61ee467f67e911608a831af32c8027 |
|
BLAKE2b-256 | b8c84ae19794a1944f7fe5457a8b7fbc25896b0fd0680a1feccf64b4081f0360 |