Utilities for access and manipulation of GNSS radio occultation in the AWS Registry of Open Data
Project description
AWS GNSS-RO Utilities
This package — awsgnssroutils — contains a utility to query the AWS Registry of Open Data repository of GNSS radio occultation (RO) data and download RO data. It does so using the metadata database files posted in the AWS repository.
A jupyter notebook is provided for introduction to this package as awsgnssroutils_demonstration.
Installation
The following non-standard modules must be installed: s3fs, numpy. Installation of these dependencies is automatic when installing awsgnssroutils by pip (PyPI).
Database Functionality
This module defines two classes: RODatabaseClient and OccList. The first creates a portal to a database of RO metadata, and the second is an instance of a list of radio occultations (ROs). Each are described below.
RODatabaseClient:
Create an instance of a portal to a metadata on all RO data in the AWS Registry of Open Data. It provides an option to create a repository of the RO metadata on the local file system as keyword "repository". For example,
> rodb = RODatabaseClient()
creates a database interface directly to the AWS S3 bucket to access the metadata. This interface is slow but requires no local disk space.
> rodb = RODatabaseClient( repository="rometadata" )
also creates a database interface but with a local repository of the metadata in the directory "rometadata". It is far more efficient than the direct access method if a copy of requested metadata is already in the local repository.
> rodb = RODatabaseClient( repository="rometadata", update=False )
By specifying "update" as True, the local repository is updated at the instantiation of rodb. The update compares metadata in the repository of metadata on the local file system to the same metadata files in the AWS Registry of Open Data and updates the local metadata as needed. The update does not add any "new" metadata files to the local repository.
There are two methods to create a list of occultations through the database client. One is to perform an inquiry in which missions and/or a date-time range is specified, and a second is to restore a previously saved list of RO data.
> occlist = rodb.query( missions="champ" )
generates an OccList containing metadata on all CHAMP RO data. The inquiry can be performed instead over a range in time. The date-time fields are always ISO format times...
> occlist = rodb.query( datetimerange=("2019-06-01","2019-06-30") )
creates an OccList of metadata for all RO soundings in the month of June, 2019, regardless of mission.
The other option to creating an OccList is be restoring a previously saved OccList:
> occlist = rodb.restore( "old_occlist.json" )
in which the old OccList was saved in a JSON format file.
OccList
An instance of the class OccList is contains the metadata on a list of RO soundings along with pointers to the RO data files in the AWS Registry of Open Data S3 bucket. AWS functionality is completely embedded in the methods of the OccList class. Those methods include the ability to subset/filter the list according to geolocation and time, GNSS transmitter/constellation, GNSS receiver, whether it is a rising or a setting occultation, etc. It also includes the ability to combine instances of OccList, save the OccList to a JSON format file for future restoration by RODatabaseClient.restore, and even download RO data files.
In order to filter an OccList previously generated by RODatabaseClient.query or RODatabaseClient.restore, use the OccList.filter method:
> champoccs = rodb.query( missions="champ" )
> champoccs_2003 = champoccs.filter( datetimerange=("2003-01-01","2004-01-01") )
illustrates how to apply a filter in date-time, retaining all CHAMP RO metadata for the year 2003. Filtering can be done in longitude and latitude as well:
> champoccs_US = champoccs.filter( longituderange=(-110,-70), latituderange=(25,55) )
and even those can be subset by local time (a.k.a. solar time):
> champoccs_US_midnight = champoccs_US.filter( localtimerange=(22,2) )
in which the local time range is given in hours and can wrap around midnight. Other filter options are for the GNSS constellation used as transmitters ("G" for GPS, "R" for GLONASS, "E" for Galileo, "C" for BeiDou), for individual transmitters ("G01", etc.), for individual receivers ("cosmic1c1", "metopb", etc.), and for occultation 'geometry' ("rising" vs. "setting").
One can get information on the metadata in an OccList using the OccList.info method. For instance, if you want to get a listing of all of the Spire receiver satellites, do
> spire = rodb.query( "spire" )
> spire_receivers = spire.info( "receiver" )
The first step in this process could be time consuming if the Spire metadata do not already reside on the local file system and the rodb object does not interface with a local repository. One can also get a list of the GNSS transmitters tracked by Spire on a particular day by
> spire_day = spire.filter( datetimerange=("2021-12-01","2021-12-02") )
> spire_day_transmitters = spire_day.info("transmitter")
which will give a list of all GNSS transmitters tracked by all Spire satellites on December 1, 2021. The spire_day list can be split up between rising and setting RO soundings as well:
> spire_day_rising = spire_day.filter( geometry="rising" )
> spire_day_setting = spire_day.filter( geometry="setting" )
Then it is possible to save the spire metadata OccList to a JSON file for future restoration by
> spire.save( "spire_metadata.json" )
The metadata also contain pointers to the RO sounding data files in the AWS Open Data bucket. To get information on the data files available, use the OccList.info( "filetype" ) method. For example, to find out the types of RO data files avialable for the month of June, 2009:
> June2009 = rodb.query( datetimerange=("2009-06-01","2009-07-01") )
> filetype_dict = June2009.info( "filetype" )
which will return a dictionary with the AWS-native RO file types as keys with corresponding values being the counts of each. The file types have the format "{processing_center}_{file_type}" in which "processing_center" is an RO processing center that contributed to the AWS repository ("ucar", "romsaf", "jpl") and the "file_type" is one of "calibratedPhase", "refractivityRetrieval", or "atmosphericRetrieval".
The values of the longitude, latitude, datetime, and localtimes of the RO soundings in an OccList can be obtained using the OccList.values() method:
> longitudes = June2009.values( "longitude" )
> latitudes = June2009.values( "latitude" )
> localtimes = June2009.values( "localtime" )
each of these variables being a masked numpy ndarray.
Finally, RO data files themselves can be downloaded for subsequent scientific analysis using the OccList.download() method. If one wishes to download the all RO bending angle data contributed by JPL to the archive for the week of June 5-11, 2012, one only need execute the commands
> week_list = rodb.query( datetimerange=("2012-06-05","2012-06-12") )
> week_list.download( "jpl_refractivityRetrieval", "datadir" )
which will download all file type "refractivityRetrieval" contributed by JPL into the directory "datadir". All of the files will be entered into just one directory. If instead one wants to download the files maintaining the AWS directory structure, use the keyword "keep_aws_structure" in the method call:
> week_list.download( "jpl_refractivityRetrieval", "datadir", \
keep_aws_structure=True )
Project details
Release history Release notifications | RSS feed
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 awsgnssroutils-1.0.5.tar.gz
.
File metadata
- Download URL: awsgnssroutils-1.0.5.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1b8d6f6eb230ccae8935a4061006830943dec5017bba1cb3e8118e679c5a156 |
|
MD5 | 59b8e113221572442d5afd888d3f4570 |
|
BLAKE2b-256 | 6445c1b750b06d286db2055eb26f2b507314e015d995ba13dd2b992062f8f98f |
File details
Details for the file awsgnssroutils-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: awsgnssroutils-1.0.5-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19a973b2b7797cebe4f87d69e6cd6622a62492186da933df0604c2869cf45e70 |
|
MD5 | 4026c40a5f0cda16dc4f99fd36cbb855 |
|
BLAKE2b-256 | 35cd75866b25e7f485585a0980306d6c76dc4ff1a2ba756c94de69a523424d34 |