Skip to content
Snippets Groups Projects

Command Line Usage

You can install the project if you haven't already with

  pip install git+https://github.com/usgs/geomag-algorithms.git

Running geomag-py -h or geomag-py --help will show an extensive list of input parameters.

Some of the key parameters that should be specified are listed here along with examples. They include

Parameter Format
start time YYYY-MM-DDTHH:MM:SSZ
end time YYYY-MM-DDTHH:MM:SSZ
observatory code 3-letter observatory code
data input format 'edge', 'iaga2002', 'pcdcp', ...
data input source {--input, --input-file, ...}
data output format 'edge', 'iaga2002', 'pcdcp', ...
data output source {--output-url, --output-file, ...}
input data channels {[CHANNEL [CHANNEL ...]]}
output data channels {[CHANNEL [CHANNEL ...]]}
data type {variation, quasi-definitive, definitive}
interval {minute, second, hour, day}

Examples

To retrieve all raw (variation) H, E, Z and F minute data from Boulder Observatory (BOU) for the entire day of July 1st 2014 from an iaga2002 formatted file and output H, E, Z and F data to a pcdcp formatted file:

  geomag.py \
  --type variation \
  --inchannels H E Z F \
  --interval minute \
  --observatory BOU \
  --starttime 2014-07-01T00:00:00Z \
  --endtime 2014-07-01T23:59:00Z \
  --input iaga2002 \
  --input-file BOU20140701vmin.min \
  --outchannels H E Z F \
  --output pcdcp \
  --output-file BOU2014182.min

To retrieve all raw (variation) H, E, Z and F minute data from Tucson Observatory (TUC) for the entire month of March 2013 from a group of pcdcp formatted files in a "data-pcdcp" directory and output H, E, Z and F data to a group of iaga2002 formatted files in a "data-iaga" directory:

  geomag.py \
  --type variation \
  --inchannels H E Z F \
  --interval minute \
  --observatory TUC \
  --starttime 2013-03-01T00:00:00Z \
  --endtime 2013-03-31T23:59:00Z \
  --input pcdcp
  --input-url file://data-pcdcp/./{OBS}/{date:%Y%j}.{i} \
  --output iaga2002 \
  --output-url file://data-iaga/./{obs}{date:%Y%m%d}{t}{i}.{i} \
  --outchannels H E Z F

Here is the same example written for use in the Windows command line.

  geomag.py ^
  --type variation ^
  --inchannels H E Z F ^
  --interval minute ^
  --observatory TUC ^
  --starttime 2013-03-01T00:00:00Z ^
  --endtime 2013-03-31T23:59:00Z ^
  --input pcdcp
  --input-url file://data-pcdcp/./{OBS}/{date:%%Y%%j}.{i} ^
  --output iaga2002 ^
  --output-url file://data-iaga/./{obs}{date:%%Y%%m%%d}{t}{i}.{i} ^
  --outchannels H E Z F

To retrieve all Dst 4 minute, and Dst 3 minute data from USGS for the entire day of Oct 1st 2015 from an edge server (at edgecwb.usgs.gov) and output Dst 4 minute, and Dst 3 minute data to an iaga2002 formatted file:

  geomag.py \
  --type variation \
  --inchannels MGD MSD \
  --interval minute \
  --observatory USGS \
  --starttime 2015-10-01T00:00:00Z \
  --endtime 2015-10-01T23:59:00Z \
  --input edge
  --output iaga2002
  --output-stdout \
  --outchannels MGD MSD

Algorithms

There are flags to specify certain algorithms should be run against the data.

Adjusted

--algorithm adjusted

--adjusted-statefile=/etc/adjusted/adjbou_state_.json

--outchannels X Y Z F

XYZ

--algorithm xyz

--xyz-from {geo, mag, obs, obsd} (default is obs)

--xyz-to {geo, mag, obs, obsd} (default is geo)

XYZ Usage

Rotate data from HEZ (obs) or HDZ (mag) to XYZ (geo) and back.

Document: /algorithms/XYZ_usage.md

Extensive explanation of all input and output methods: IO Methods