Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

We have the initial version of the OSS ODS Database REST API up and running and Daniel is populating the database with it from his VLA OSS ODS data sender.  

The API will provide information about all upcoming observation sources (scans?)  It does this by fetching records from the database whose 'src_end_utc' > now().

...

The REST URLs for getting and putting data to the OSS ODS are explained here:

Getting

...

ODS Data from the database:

The data is sent from the database as an array of JSON objects where each object contains information about a single observation source.  Information from all sites is sent in the same response and the information is sorted by by 'src_start_utc'

...

http://wirth.aoc.nrao.edu:8191/ossods_data

Example Response:

{"ossods_data":[

{"notes":"inAdv:True","src_id":"3C147","src_ra":85.65057465,"site_id":"vla","src_dec":49.85200932222222,"freq_lower":4000000000,"freq_upper":8000000000,"src_end_utc":"2023-06-28T14:00:06.000103","trk_rate_ra":0,"trk_rate_dec":0,"src_start_utc":"2023-06-28T13:51:09.000048","site_lat":34.07861,"site_lon":-107.61806,"site_elev":2115},

...

If there is no data to fetch the response will be an empty array:

{"ossods_data":[]}

Getting ODS Data from the database by time range:

2023.10.11 We added the ability to fetch ods_data from the database by time range.  This is done by using 'from' and 'to' attributes in the query portion of the fetch URL:

http://turing.aoc.nrao.edu:8191/ods_data?from='2023-10-04 21:00:00'&to='2023-10-04 23:00:00' 

...

That will return all ods_data entries that were added to the database between those times.

The format for the timestamp is: '2023-10-04 21:00:00'.  It must be quoted and contain a space between the date and time portions.

The following rules apply:

if 'from' & 'to' are absent - the ods_data for 'src_end_utc' >= now() are fetched

if 'from' & 'to' are both present - fetch ods_data that was entered into the database between those times

if 'from' only is present - fetch ods_data that was entered into database starting at that time and ending with the last entry in the database

if 'to' only is present - fetch ods_data from the beginning of the database up to that time.


Adding ODS data to the database

Data is added one row at a time; each row provides the antenna information for a single observation source.

...

http://wirth.aoc.nrao.edu:8191/ossods_put?{"notes":"inAdv:True","src_id":"FRB121102A","src_ra":82.99458333333334,"site_id":"vla","src_dec":33.14791666666667,"freq_lower":1000000000,"freq_upper":2000000000,"src_end_utc":"2023-06-28T14:22:48.000632","trk_rate_ra":0,"trk_rate_dec":0,"src_start_utc":"2023-06-28T14:11:02.000504","site_lat":34.07861,"site_lon":-107.61806,"site_elev":2115}]}

...

http://wirth.aoc.nrao.edu:8191/ossods_put

If the PUTs worked properly, you should get the following JSON response:

{"ossods_response":"INSERTed 1 row(s)"}

...