Skip to content

lidar532/CORS

Repository files navigation

CORS

Install

pip install CORS

Basic Usage:

import the CORS package.

import CORS

The url pointing to the CORS data site is predefined ( CORS.rinex_url ) as a module global variable and is used by CORS functions to reference the CORS RINEX date web site.

CORS.rinex_url
'https://geodesy.noaa.gov/corsdata/rinex/'

Place the desired CORS station identifiers in a list, and set the desired date you want the CORS data for. It must be in string format ‘YYYY/MM/DD’. The library defaults to storing the CORS data in the module global CORS.test_folder; however, you can use any writable exising directory.

station_list      = [
  'ncdu', 
  'ncbe', 
  'NCRT', 
  'LOY2', 
  'LS03' 
]

date = '2023/5/25'

local_test_folder = CORS.test_folder

Below we print out a summary of the input parameters.

Now call CORS.down_load_cors_data().

rv = CORS.down_load_cors_data( 
    folder       = local_test_folder, 
    date         = date, 
    station_list = station_list,
)
saving to: /tmp/test//2023-0525-J145-CORS
Downloading info on selected stations.
Downloading selected OBS files.
Downloading sp3 & nav files.
Downloading station coords, logs, and plots.
All downloads completed.

The returned value rv

print('The server responded with:')
for v in rv:
  if v.returncode != 0:
    print(f'{v.id:12}{CORS.wget_return_codes[ v.returncode ]}, See:{v.stderr}')
  else:
    print(f'{v.id:12}Ok.')
print('Done.')
The server responded with:
info        Ok.
OBS         8, Server issued an error response., See:/tmp/test//2023-0525-J145-CORS/2023-0615-123001-CORS-wget-OBS-log.txt
sp3         Ok.
coords      Ok.
station     Ok.
Plots       8, Server issued an error response., See:/tmp/test//2023-0525-J145-CORS/2023-0615-123027-CORS-wget-Plots-log.txt
Done.

Advanced Usage

Progress Callback

You can supply a progress callback function and the CORS.down_load_cors_data() will call it to report progress.
This callback can be used to update a users GUI status indicator.

def my_progress( message:str ):
  print(f'my_progress: { message }')
rv = CORS.down_load_cors_data( 
    folder       = local_test_folder, 
    date         = date, 
    station_list = station_list,
    progress_callback = my_progress,
)
my_progress: saving to: /tmp/test//2023-0525-J145-CORS
my_progress: Downloading info on selected stations.
my_progress: Downloading selected OBS files.
my_progress: Downloading sp3 & nav files.
my_progress: Downloading station coords, logs, and plots.
my_progress: All downloads completed.

About

Python code to Gather RINEX GNSS collections of data sets from https://geodesy.noaa.gov/cors/rinex/

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published