spacepy.pybats.kyoto¶
kyoto is a tool set for obtaining and handling geomagnetic indices stored at the Kyoto World Data Center (WDC) website. Indices can be loaded from file or fetched from the web.
Instantiation of objects from this module should be done through the constructor
functions fetch()
and load(). Use help on these objects
for more information.
Functions
|
A function to fetch Kyoto AE directly from the Kyoto WDC website. |
|
A function to fetch Kyoto Dst directly from the Kyoto WDC website. |
|
Fetch Kyoto data of type dtype from the web given a start time, tstart, and a stop time, tstop. |
|
Turn integer month into string month. |
|
A function to fetch Kyoto Kp directly from the Kyoto WDC website. |
|
KyotoWDC uses two format types: WDC, which is data specific, and IAGA-2002, which is general for all data types. |
|
A function to fetch Kyoto SYM-H directly from the Kyoto WDC website. |
Classes
|
Handle Ae index from Kyoto WDC. |
|
Handle hourly dst index from Kyoto WDC. |
|
Handles global Kp index from Kyoto WDC. |
|
Handle Sym-H and related indices from Kyoto WDC. |
- spacepy.pybats.kyoto.aefetch(t_start, t_stop)[source]¶
A function to fetch Kyoto AE directly from the Kyoto WDC website. Returns raw ascii lines obtained from the website representing the data in IAGA 2002 format.
Note that, because of the higher density of the data, full date times are required for the start and stop time. This is in contrast to other fetch functions, where hourly or three-hourly resolution allows for only the start and stop years and months are required as integers.
- Parameters:
- t_startdatetime.datetime
Start time for range of requested data as a datetime object.
- t_stopdatetime.datetime
Stop time for range of requested data as a datetime object.
- spacepy.pybats.kyoto.dstfetch(yrstart, mostart, yrstop, mostop)[source]¶
A function to fetch Kyoto Dst directly from the Kyoto WDC website. Returns raw ascii lines.
- spacepy.pybats.kyoto.fetch(dtype, tstart, tstop, debug=False)[source]¶
Fetch Kyoto data of type dtype from the web given a start time, tstart, and a stop time, tstop.
dtype can be any of the following strings:
dst – The hourly Dst index.
kp – The 3-hour global Kp index.
ae – The AE, AL, and AU minute-resolution auroral indices.
sym – The minute resolution SYM and ASY indices for H and D directions.
Start and stop times can be year-month tuples or datetime objects.
The filled corresponding data class will be returned.
Example 1: Get Kp for the whole year of 2005: kp=fetch(‘kp’, (2005,1), (2005,12))
Example 2: Get Dst for the a few months from 1981: import datetime t1=datetime.datetime(1981,9, 1) t2=datetime.datetime(1981,11, 31) dst=fetch(‘dst’, t1, t2)
- spacepy.pybats.kyoto.inttomonth(inmonth)[source]¶
Turn integer month into string month. Necessary for webfetch.
- spacepy.pybats.kyoto.kpfetch(yrstart, mostart, yrstop, mostop)[source]¶
A function to fetch Kyoto Kp directly from the Kyoto WDC website. Returns raw ascii lines.
- spacepy.pybats.kyoto.parse_iaga(lines, iagacode=None)[source]¶
KyotoWDC uses two format types: WDC, which is data specific, and IAGA-2002, which is general for all data types. This function is a general reader for this format. It returns a dictionary of vectors, each corresponding to a column from the file.
‘lines’ is simply a list of lines from the IAGA-formatted file. ‘iagacode’, if given, should be a string containing the IAGA code for the file contents. If given, this function will raise an exception if iagacode does not match the file’s code. This is useful for ensure the correct data values are located in this file.
- spacepy.pybats.kyoto.symfetch(t_start, t_stop)[source]¶
A function to fetch Kyoto SYM-H directly from the Kyoto WDC website. Returns raw ascii lines obtained from the website representing the data in IAGA 2002 format.
Note that, because of the higher density of the data, full datetimes are required for the start and stop time. This is in contrast to other fetch functions, where hourly or three-hourly resolution allows for only the start and stop years and months are required as integers.
- Parameters:
- t_startdatetime.datetime
Start time for range of requested data as a datetime object.
- t_stopdatetime.datetime
Stop time for range of requested data as a datetime object.