Command line interface

pymagglobal can be accessed directly via the command line. This is documented below.

usage: pymagglobal [-h] [--version] [--list-models]
                   {local,dipole,coeffs-series,sec-vars-series,coeffs-epoch,sec-vars-epoch,map}
                   ... model

Positional Arguments

command

Possible choices: local, dipole, coeffs-series, sec-vars-series, coeffs-epoch, sec-vars-epoch, map

model

The model to be used.Use pymagglobal –list-models to get a list of the included models or pass a <path/to/your_model> to parse your own model.

options

--version

show program’s version number and exit

--list-models

List available models and exit.

Sub-commands:

local

Create a local curve for a specific location.

pymagglobal local [-h] [--no-show] [--output <path/to/output>]
                  [--savefig <path/to/figure.pdf>] [--longterm]
                  [--res n | --every n] [--begin b] [--end e]
                  [--type {dif,nez}]
                  lat lon

Positional Arguments

lat

The latitude at which to create the local curve.

lon

The longitude at which to create the local curve.

options

--no-show

Do not show the results.

Default: False

--output

Where to store the outputs. If not given, no output is stored. The outputs are produced as simple tables and are self-explaining.

--savefig

If given, save a figure at the given location. Use the file ending to specify the format.

--longterm

This flag is intended for longterm models. If given, all times will be interpreted as ages before the year 1950 in ka (kiloyears), i.e. the epoch 10 refers to the year -8050 without the flag.

Default: False

--res

The resolution of the time series as a number of points. May also be “knots”.In this case the time series is evaluated at the knots of the splinemodel. Default is {res_default}. Cannot be used together with –every.

Default: “knots”

--every

Output a value of the time series every n years. Cannot be used together with –res.

--begin

Beginning of the time series. If not given, use the earliest year possible.

--end

End of the time series. If not given, use the latest year possible.

--type

Possible choices: dif, nez

The type of the resulting field. May be either “dif” for declination, inclination and intensity (default) or “nez” for north, east and down components.

Default: “dif”

Example of use: pymagglobal local 12 12 ARCH10k.1

_images/pic_mst.png

dipole

Create a time series of the dipole moment.

pymagglobal dipole [-h] [--no-show] [--output <path/to/output>]
                   [--savefig <path/to/figure.pdf>] [--longterm]
                   [--res n | --every n] [--begin b] [--end e]

options

--no-show

Do not show the results.

Default: False

--output

Where to store the outputs. If not given, no output is stored. The outputs are produced as simple tables and are self-explaining.

--savefig

If given, save a figure at the given location. Use the file ending to specify the format.

--longterm

This flag is intended for longterm models. If given, all times will be interpreted as ages before the year 1950 in ka (kiloyears), i.e. the epoch 10 refers to the year -8050 without the flag.

Default: False

--res

The resolution of the time series as a number of points. May also be “knots”.In this case the time series is evaluated at the knots of the splinemodel. Default is {res_default}. Cannot be used together with –every.

Default: “knots”

--every

Output a value of the time series every n years. Cannot be used together with –res.

--begin

Beginning of the time series. If not given, use the earliest year possible.

--end

End of the time series. If not given, use the latest year possible.

Example of use: pymagglobal dipole CALS10k.2

_images/pic_dip.png

coeffs-series

Output time series for specific coefficients.

pymagglobal coeffs-series [-h] [--no-show] [--output <path/to/output>]
                          [--savefig <path/to/figure.pdf>] [--longterm]
                          [--res n | --every n] [--begin b] [--end e] -d
                          [DEGREE ...] -o [ORDER ...]

options

--no-show

Do not show the results.

Default: False

--output

Where to store the outputs. If not given, no output is stored. The outputs are produced as simple tables and are self-explaining.

--savefig

If given, save a figure at the given location. Use the file ending to specify the format.

--longterm

This flag is intended for longterm models. If given, all times will be interpreted as ages before the year 1950 in ka (kiloyears), i.e. the epoch 10 refers to the year -8050 without the flag.

Default: False

--res

The resolution of the time series as a number of points. May also be “knots”.In this case the time series is evaluated at the knots of the splinemodel. Default is {res_default}. Cannot be used together with –every.

Default: “knots”

--every

Output a value of the time series every n years. Cannot be used together with –res.

--begin

Beginning of the time series. If not given, use the earliest year possible.

--end

End of the time series. If not given, use the latest year possible.

-d, --degree

The Degree for which to calculate the time series. Multiple values may be given.

-o, --order

The order for which to calculate the time series. The same number as degrees has to be given.

Example of use: pymagglobal coeffs-series --longterm -d 1 1 1 -o 0 1 -1 GGF100k

_images/pic_cfs.png

sec-vars-series

Output secular variation time series for specific degree and order.

pymagglobal sec-vars-series [-h] [--no-show] [--output <path/to/output>]
                            [--savefig <path/to/figure.pdf>] [--longterm]
                            [--res n | --every n] [--begin b] [--end e] -d
                            [DEGREE ...] -o [ORDER ...]

options

--no-show

Do not show the results.

Default: False

--output

Where to store the outputs. If not given, no output is stored. The outputs are produced as simple tables and are self-explaining.

--savefig

If given, save a figure at the given location. Use the file ending to specify the format.

--longterm

This flag is intended for longterm models. If given, all times will be interpreted as ages before the year 1950 in ka (kiloyears), i.e. the epoch 10 refers to the year -8050 without the flag.

Default: False

--res

The resolution of the time series as a number of points. May also be “knots”.In this case the time series is evaluated at the knots of the splinemodel. Default is {res_default}. Cannot be used together with –every.

Default: “knots”

--every

Output a value of the time series every n years. Cannot be used together with –res.

--begin

Beginning of the time series. If not given, use the earliest year possible.

--end

End of the time series. If not given, use the latest year possible.

-d, --degree

The Degree for which to calculate the time series. Multiple values may be given.

-o, --order

The order for which to calculate the time series. The same number as degrees has to be given.

Example of use: pymagglobal sec-vars-series -d 1 -o 0 gufm1

_images/pic_svs.png

coeffs-epoch

Output coefficients for a specific epoch.

pymagglobal coeffs-epoch [-h] [--no-show] [--output <path/to/output>]
                         [--savefig <path/to/figure.pdf>] [--longterm]
                         epoch

Positional Arguments

epoch

The epoch for which the coeffients are returned.

options

--no-show

Do not show the results.

Default: False

--output

Where to store the outputs. If not given, no output is stored. The outputs are produced as simple tables and are self-explaining.

--savefig

If given, save a figure at the given location. Use the file ending to specify the format.

--longterm

This flag is intended for longterm models. If given, all times will be interpreted as ages before the year 1950 in ka (kiloyears), i.e. the epoch 10 refers to the year -8050 without the flag.

Default: False

Example of use: pymagglobal coeffs-epoch 1700 arhimag1k

_images/pic_cfe.png

sec-vars-epoch

Output secular variations for a specific epoch.

pymagglobal sec-vars-epoch [-h] [--no-show] [--output <path/to/output>]
                           [--savefig <path/to/figure.pdf>] [--longterm]
                           epoch

Positional Arguments

epoch

The epoch for which the secular variations are returned.

options

--no-show

Do not show the results.

Default: False

--output

Where to store the outputs. If not given, no output is stored. The outputs are produced as simple tables and are self-explaining.

--savefig

If given, save a figure at the given location. Use the file ending to specify the format.

--longterm

This flag is intended for longterm models. If given, all times will be interpreted as ages before the year 1950 in ka (kiloyears), i.e. the epoch 10 refers to the year -8050 without the flag.

Default: False

Example of use: pymagglobal sec-vars-epoch 1700 arhimag1k

_images/pic_sve.png

map

Output a grid of lat-lon-pairs and field components at the locations for a specific epoch. Note that the grid is equidistributed over the globe, so it may appear unconventional.

pymagglobal map [-h] [--no-show] [--output <path/to/output>]
                [--savefig <path/to/figure.pdf>] [--longterm]
                [--type {dif,nez}] [--res n]
                epoch

Positional Arguments

epoch

The epoch for which the field map is returned.

options

--no-show

Do not show the results.

Default: False

--output

Where to store the outputs. If not given, no output is stored. The outputs are produced as simple tables and are self-explaining.

--savefig

If given, save a figure at the given location. Use the file ending to specify the format.

--longterm

This flag is intended for longterm models. If given, all times will be interpreted as ages before the year 1950 in ka (kiloyears), i.e. the epoch 10 refers to the year -8050 without the flag.

Default: False

--type

Possible choices: dif, nez

The type of the resulting field. May be either “dif” for declination, inclination and intensity (default) or “nez” for north, east and down components.

Default: “dif”

--res

The resolution of the map as an approximate number of points. Default is 1000.

Default: 1000

Example of use: pymagglobal map 1700 gufm1

_images/pic_map.png