Python Reflectometry Software Package

githubhttps://github.com/kristinemlarson/gnssrefl
pypi https://pypi.org/project/gnssrefl
Cryosphere, Water, SnowUse Cases

Description of the API -using data archives

Parameter Description Default
station4 character lowercase station nameuser must supply
year4 character yearuser must supply
doyday of yearuser must supply
freqGPS frequency L1, L2, L2C,L5, or L1L2L1
pk2noiseminimum ratio of spectral peak to noise3
ampmininum amplitude of spectral peak 8 v/v
h1,h2minimum and maximum reflector heights 0.5,8 meters
e1, e2minimum and maximum elevation angles 5,25 degrees
rinexRINEX version 2.11 or 32.11
archiveunavco, sopac, cddis, sonel,or allall
jsononlyTrue returns solution via jsonFalse

Example: for the station p038, the year 2020, day of year 135:

http://gnss-reflections.org/api?station=p038&year=2020&doy=135&archive=unavco

The API starts a task queue and opens a web page with which will ultimately be populated with a png summary of spectral characteristics, links to the reflection solution, station location summary, a google map, and station photograph (if available). Here we specified the unavco archive because we know it is the primary archive for this site.

Regardless of the method you use to query the API, you will need to wait ~10 seconds for the solution to be posted.

If you only want solution information returned in a json using your browser:

http://gnss-reflections.org/api?station=p038&year=2020&doy=135&archive=unavco&jsononly=True

returns:

{
  "amp": 8,
  "archive": "unavco",
  "azim1": 0,
  "azim2": 360,
  "createdAt": "2021-04-24 11:41:11Z",
  "e1": 5.0,
  "e2": 25.0,
  "fileAddress": "http://gnss-reflections.org/results2/2ea83252-0377-45c1-8ad9-ee1f43b80b9e",
  "fileType": "rh",
  "h1": 0.4,
  "h2": 8.0,
  "pk2noise": 3.0,
  "siteId": "p038",
  "softwareVersion": 2.0,
  "startDate": "2020-05-05 00:00:00Z"
}

The reflector height solution is found in the fileAddress field.

The API can be accessed via curl:

curl "http://gnss-reflections.org/api?station=p038&year=2020&doy=135&jsononly=True&archive=unavco"

or using the http utility:

http http://gnss-reflections.org/api station==p038 year==2020 doy==135 jsononly==True archive==unavco

Example: for the station p041, the year 2020, day of year 198, and L1 data:

From the command line within a browser:

curl "https://gnss-reflections.org/api?station=p041&year=2020&doy=198&freq=L1"

From the command line, wth json returned, using curl:

curl "https://gnss-reflections.org/api?station=p041&year=2020&doy=198&freq=L1&jsononly=True"

Using the http utility:

http https://gnss-reflections.org/api station==p041 year==2020 doy==198 freq==L1 jsononly==True

returns:

{
    "amp": 8,
    "archive": "all",
    "azim1": 0,
    "azim2": 360,
    "createdAt": "2021-04-23 16:58:38Z",
    "e1": 5.0,
    "e2": 25.0,
    "fileAddress": "https://gnss-reflections.org/results2/1f943d0e-f704-4a50-a0bc-bf8213182468",
    "fileType": "rh",
    "h1": 0.4,
    "h2": 8.0,
    "pk2noise": 3.0,
    "siteId": "p041",
    "softwareVersion": 2.0,
    "startDate": "2020-07-07 00:00:00Z"
}


Description of the API - using data upload option

Parameter Description Default
file**Version 2.11 RINEX file, lowercase, gz or Z alloweduser must supply
freqGPS frequency L1, L2, L2C, or L5 L1
pk2noiseminimum ratio of spectral peak to noise3
ampminimum amplitude of spectral peak 8 v/v
h1,h2minimum and maximum reflector heights 0.5,8 meters
e1,e2minimum and maximum elevation angles 5,25 degrees

Example: you have a RINEX 2.11 file that has been gzipped, p0301000.20o.gz. The command to analyze the L1 data for this site is:

curl -F "file=@p0301000.20o.gz" -F "freq=L1" -F "jsononly=True" "http://gnss-reflections.org/api"

returns:

{
  "amp": 8,
  "archive": "local",
  "azim1": 0,
  "azim2": 360,
  "createdAt": "2021-04-23 18:21:47Z",
  "e1": 5,
  "e2": 25,
  "fileAddress": "http://gnss-reflections.org/static/files/319386247.txt",
  "fileType": "rh",
  "h1": 0.4,
  "h2": 8,
  "pk2noise": 3,
  "siteId": "p030",
  "softwareVersion": 2.0,
  "startDate": "2020-04-04 00:00:00Z"
}

Using the http utility:

http --form POST http://gnss-reflections.org/api file@p0301000.20o.gz freq=L1 jsononly=True

returns:

HTTP/1.0 200 OK
Content-Length: 358
Content-Type: application/json
Date: Sat, 24 Apr 2021 00:23:59 GMT
Server: Werkzeug/1.0.1 Python/3.8.7
{
    "amp": 8,
    "archive": "local",
    "azim1": 0,
    "azim2": 360,
    "createdAt": "2021-04-23 18:23:59Z",
    "e1": 5,
    "e2": 25,
    "fileAddress": "http://gnss-reflections.org/static/files/185639884.txt",
    "fileType": "rh",
    "h1": 0.4,
    "h2": 8,
    "pk2noise": 3,
    "siteId": "p030",
    "softwareVersion": 2.0,
    "startDate": "2020-04-04 00:00:00Z"
}

** You must use the geodetic naming convention for RINEX 2.11 files. Lowercase. Four character station name, three character day of year followed by a 0, a period, two character year, and o. gz and Z compression is also allowed.

Please note that 127.0.0.1:5000 is showing up in some of these addresses because I am testing things locally before uploading to heroku. I will do my best to fix these examples.