Provides the 3-hourly Ap and Kp indices from the full daily data set.
Accepts the same arguments as sw_daily().
All arguments are optional and changing them from the defaults should not
be required neither should it be necessary nor is it recommended.
Parameters:
swpath_all (None or str, optional, default None) – Filename for the large combined index file including the
historic data, absolute path or relative to the current dir.
None uses the package’s default file location.
swpath_5y (None or str, optional, default None) – Filename for the 5-year index file, absolute path or relative to the current dir.
None uses the package’s default file location.
update (bool, optional, default False) – Attempt to update the local data if it is older than update_interval.
update_interval (str, optional, default "30days") – The time after which the data are considered “old”.
By default, no automatic re-download is initiated, set update to true.
The online data is updated every 3 hours, thus setting this value to
a shorter time is not needed and not recommended.
Returns:
sw_df – The combined Ap and Kp index data (3h values).
The index values are centred at the 3h interval, i.e. at 01:30:00,
04:30:00, 07:30:00, … and so on.
Raises IOError if the data files cannot be found.
The index is returned timezone-naive but contains UTC timestamps.
To convert to a timezone-aware index, use
pandas.DataFrame.tz_localize(): sw_df.tz_localize("utc").
Reads the given file and parses it according to the space weather data format.
Parameters:
swpath (str) – File to parse, absolute path or relative to the current dir.
Returns:
sw_df – The parsed space weather data (daily values).
Raises an IOError if the file is not found.
The index is returned timezone-naive but contains UTC timestamps.
To convert to a timezone-aware index, use
pandas.DataFrame.tz_localize(): sw_df.tz_localize("utc").
The dataframe contains the following columns:
”year”, “month”, “day”:
The observation date
”bsrn”:
Bartels Solar Rotation Number.
A sequence of 27-day intervals counted continuously from 1832 Feb 8.
”rotd”:
Number of Day within the Bartels 27-day cycle (01-27).
Planetary Equivalent Amplitude (Ap) for 0000-0300, 0300-0600,
0600-0900, 0900-1200, 1200-1500, 1500-1800, 1800-2100, 2100-2400 UT
”Apavg”:
Arithmetic average of the 8 Ap indices for the day.
”Cp”:
Cp or Planetary Daily Character Figure. A qualitative estimate of
overall level of magnetic activity for the day determined from the sum
of the 8 Ap indices. Cp ranges, in steps of one-tenth, from 0 (quiet)
to 2.5 (highly disturbed). “C9”:
”isn”:
International Sunspot Number.
Records contain the Zurich number through 1980 Dec 31 and the
International Brussels number thereafter.
”f107_adj”:
10.7-cm Solar Radio Flux (F10.7) Adjusted to 1 AU.
Measured at Ottawa at 1700 UT daily from 1947 Feb 14 until
1991 May 31 and measured at Penticton at 2000 UT from 1991 Jun 01 on.
Expressed in units of 10-22 W/m2/Hz.
”Q”:
Flux Qualifier.
0 indicates flux required no adjustment;
1 indicates flux required adjustment for burst in progress at time of measurement;
2 indicates a flux approximated by either interpolation or extrapolation;
3 indicates no observation; and
4 indicates CSSI interpolation of missing data.
”f107_81ctr_adj”:
Centered 81-day arithmetic average of F10.7 (adjusted).
”f107_81lst_adj”:
Last 81-day arithmetic average of F10.7 (adjusted).
”f107_obs”:
Observed (unadjusted) value of F10.7.
”f107_81ctr_obs”:
Centered 81-day arithmetic average of F10.7 (observed).
”f107_81lst_obs”:
Last 81-day arithmetic average of F10.7 (observed).
Combines the “historic” and last-5-year data into one dataframe.
All arguments are optional and changing them from the defaults should not
be required neither should it be necessary nor is it recommended.
Parameters:
swpath_all (None or str, optional, default None) – Filename for the large combined index file including the
historic data, absolute path or relative to the current dir.
None uses the package’s default file location.
swpath_5y (None or str, optional, default None) – Filename for the 5-year index file, absolute path or relative to the current dir.
None uses the package’s default file location.
update (bool, optional, default False) – Attempt to update the local data if it is older than update_interval.
update_interval (str, optional, default "30days") – The time after which the data are considered “old”.
By default, no automatic re-download is initiated, set update to true.
The online data is updated every 3 hours, thus setting this value to
a shorter time is not needed and not recommended.
Returns:
sw_df – The combined parsed space weather data (daily values).
Raises IOError if the data files cannot be found.
The index is returned timezone-naive but contains UTC timestamps.
To convert to a timezone-aware index, use
pandas.DataFrame.tz_localize(): sw_df.tz_localize("utc").
Updates the local space weather index data from the website [2],
given that the 5-year file is older
than min_age, or the combined (large) file is older than four years.
If the data is missing for some reason, a download will be attempted nonetheless.
All arguments are optional and changing them from the defaults should not
be required neither should it be necessary nor is it recommended.
Parameters:
min_age (str, optional, default "3h") – The time after which a new download will be attempted.
The online data is updated every 3 hours, thus setting this value to
a shorter time is not needed and not recommended.
swpath_all (None or str, optional, default None) – Filename for the large combined index file including the
historic data, absolute path or relative to the current dir.
None uses the package’s default file location.
swpath_5y (None or str, optional, default None) – Filename for the 5-year index file, absolute path or relative to the current dir.
None uses the package’s default file location.
url_all (None or str, optional, default None) – The url of the “historic” data file.
None uses the default url.
url_5y (None or str, optional, default None) – The url of the data file of containing the indices of the last 5 years.
None uses the default url.
Python interface for space weather indices from GFZ Potsdam
GFZ space weather indices ASCII file parser for python [3].
Includes parser for the GFZ ASCII files, files in WDC format,
and for the Hpo 30 and 60 minute ASCII files [4].
For the file formats, see the gfz_xxx_format.txt files.
Provides the 3-hourly Ap and Kp indices from the full daily data set.
Accepts the same arguments as gfz_daily().
All arguments are optional and changing them from the defaults should not
be required neither should it be necessary nor is it recommended.
Parameters:
gfzpath_all (None or str, optional, default None) – Filename for the large combined index file including the
historic data, absolute path or relative to the current dir.
None uses the package’s default file location.
gfzpath_30d (None or str, optional, default None) – Filename for the 30-day (nowcast) index file,
absolute path or relative to the current dir.
None uses the package’s default file location.
update (bool, optional, default False) – Attempt to update the local data if it is older than update_interval.
update_interval (str, optional, default "10days") – The time after which the data are considered “old”.
By default, no automatic re-download is initiated, set update to true.
The online data is updated every 3 hours, thus setting this value to
a shorter time is not needed and not recommended.
gfz_format (None or str, optional, default None) – The file format to parse the files passed via gfzpath_all and gfzpath_all.
Use None, “default”, “gfz”, or “standard” for the “standard” GFZ ASCII files.
Use “wdc” to parse files in WDC format into a full-length pandas.DataFrame.
Use “hp30” or “hp60” to read the Hp30 and Hp60 data files.
Returns:
gfz_df – The combined Ap and Kp index data (3h values).
The index values are centred at the 3h interval, i.e. at 01:30:00,
04:30:00, 07:30:00, … and so on.
Raises IOError if the data files cannot be found.
The index is returned timezone-naive but contains UTC timestamps.
To convert to a timezone-aware index, use
pandas.DataFrame.tz_localize(): gfz_df.tz_localize("utc").
Combines the “historic” and last-30-day data into one dataframe.
All arguments are optional and changing them from the defaults should not
be required neither should it be necessary nor is it recommended.
Parameters:
gfzpath_all (None or str, optional, default None) – Filename for the large combined index file including the
historic data, absolute path or relative to the current dir.
None uses the package’s default file location.
gfzpath_30d (None or str, optional, default None) – Filename for the 30-day (nowcast) index file,
absolute path or relative to the current dir.
None uses the package’s default file location.
update (bool, optional, default False) – Attempt to update the local data if it is older than update_interval.
update_interval (str, optional, default "10days") – The time after which the data are considered “old”.
By default, no automatic re-download is initiated, set update to true.
The online data is updated every 3 hours, thus setting this value to
a shorter time is not needed and not recommended.
gfz_format (None or str, optional, default None) – The file format to parse the files passed via gfzpath_all and gfzpath_all.
Use None, “default”, “gfz”, or “standard” for the “standard” GFZ ASCII files.
Use “wdc” to parse files in WDC format into a full-length pandas.DataFrame.
Use “hp30” or “hp60” to read the Hp30 and Hp60 data files.
Returns:
gfz_df – The combined parsed space weather data (daily values).
Raises IOError if the data files cannot be found.
The index is returned timezone-naive but contains UTC timestamps.
To convert to a timezone-aware index, use
pandas.DataFrame.tz_localize(): gfz_df.tz_localize("utc").
Planetary Equivalent Amplitude (Ap) for 0000-0300, 0300-0600,
0600-0900, 0900-1200, 1200-1500, 1500-1800, 1800-2100, 2100-2400 UT
”Apavg”:
Arithmetic average of the 8 Ap indices for the day.
”isn”:
International Sunspot Number.
Records contain the Zurich number through 1980 Dec 31 and the
International Brussels number thereafter.
”f107_obs”:
Observed (unadjusted) value of F10.7.
”f107_adj”:
10.7-cm Solar Radio Flux (F10.7) Adjusted to 1 AU.
Measured at Ottawa at 1700 UT daily from 1947 Feb 14 until
1991 May 31 and measured at Penticton at 2000 UT from 1991 Jun 01 on.
Expressed in units of 10-22 W/m2/Hz.
”D”:
Definitive indicator.
0: Kp and SN preliminary
1: Kp definitive, SN preliminary
2: Kp and SN definitive
Reads the given file and parses it according to the Hp30 and Hp60 file format.
File format descriptions in [5] and [6]
Parameters:
gfzhppath (str) – File to parse, absolute path or relative to the current dir.
Returns:
hp_df – The parsed space weather data with the 30 min or 60 min index.
The index is returned timezone-naive but contains UTC timestamps.
To convert to a timezone-aware index, use
pandas.DataFrame.tz_localize(): hp_df.tz_localize("utc").
Raises an IOError if the file is not found.
The dataframe contains the following columns:
”index”:
padas.DateTimeIndex of the middle times of the intervals.
”year”, “month”, “day”:
The observation date.
”hh_h”:
Starting time in hours of interval.
”hh_m”:
Middle time in hours of interval.
”days”:
Days since 1932-01-01 00:00 UT to start of interval.
”days_m”:
Days since 1932-01-01 00:00 UT to middle of interval.
”Hp”:
Hp index during to the interval (30 min or 60 min).
”ap”:
ap index during to the interval (30 min or 60 min).
Updates the local space weather index data from the website [7],
given that the 30-day file is older than min_age,
or the combined (large) file is older than 30 days.
If the data is missing for some reason, a download will be attempted nonetheless.
All arguments are optional and changing them from the defaults should
neither be necessary nor is it recommended.
Parameters:
min_age (str, optional, default "1D") – The time after which a new download will be attempted.
The online data is updated every day, thus setting this value to
a shorter time is not needed and not recommended.
gfzpath_all (None or str, optional, default None) – Filename for the large combined index file including the
historic data, absolute path or relative to the current dir.
None uses the package’s default file location.
gfzpath_30d (None or str, optional, default None) – Filename for the 30-day (nowcast) index file, absolute path or relative
to the current dir.
None uses the package’s default file location.
url_all (None or str, optional, default None) – The url of the “historic” data file.
None uses the default url.
url_30d (None or str, optional, default None) – The url of the data file containing the indices for the last 30 days.
None uses the default url.
prefix (None or str, optional, default None) – File prefix for constructing the file name as <prefix>_year.<ext>.
None defaults to ‘omni2’.
ext (None or str, optional, default None) – File extension for constructing the file name as <prefix>_year.<ext>.
None defaults to ‘dat’.
local_path (None or str, optional, default None) – Path to the locally stored data yearly files, defaults to the
data location within the package.
None uses the package’s default file location.
url_base (None or str, optional, default None) – URL for the directory that contains the yearly files.
None uses the default base url.
Loads the OMNI hourly data for the given year,
from the locally cached data.
Use local_path to set a custom location if you
have the omni data already available.
prefix (None or str, optional, default None) – File prefix for constructing the file name as <prefix>_year.<ext>.
None defaults to ‘omni2’.
ext (None or str, optional, default None) – File extension for constructing the file name as <prefix>_year.<ext>.
None defaults to ‘dat’.
local_path (None or str, optional, default None) – Path to the locally stored data yearly files, defaults to the
data location within the package.
None uses the package’s default file location.
url_base (None or str, optional, default None) – URL for the directory that contains the yearly files.
None uses the default base url.
cache (boolean, optional, default False) – Download files locally if they are not already available.
Returns:
sw_df – The parsed space weather data (hourly values).
Raises an IOError if the file is not available.
The index is returned timezone-naive but contains UTC timestamps.
To convert to a timezone-aware index, use
pandas.DataFrame.tz_localize(): sw_df.tz_localize("utc").
Raises an IOError if the file is not found.
The index is returned timezone-naive but contains UTC timestamps.
To convert to a timezone-aware index, use
pandas.DataFrame.tz_localize(): sw_df.tz_localize("utc").