Main Content

aeroReadSpaceWeatherData

Output MAT-file of space weather data

Since R2023a

Description

matfile = aeroReadSpaceWeatherData(spaceWeatherFile) reads space weather data from the space weather data file, spaceWeatherFile, downloaded from CelesTrak® and stores the data in a MAT-file, matfile. The function saves the MAT-file to the current working directory, and returns the filename along with its full path in matfile.

The fluxSolarAndGeomagnetic function extracts the solar flux and geomagnetic data from the MAT-file.

matfile = aeroReadSpaceWeatherData(spaceWeatherFile,Name=Value) creates matfile based on additional parameters specified by one or more name-value arguments.

[matfile,startdate] = aeroReadSpaceWeatherData(___) returns the earliest date startdate that corresponds to the data that is saved in matfile. Specify input argument combinations from the previous syntaxes.

[matfile,startdate,enddate] = aeroReadSpaceWeatherData(___) returns the earliest and latest dates, startdate and enddate, respectively, corresponding to the data that is saved in matfile.

Input Arguments

collapse all

Space weather data file, a comma-separated values (CSV) file containing consolidated space weather data from https://celestrak.org/spacedata/, specified as a character vector or string. The extension .csv must be appended to the file name. The filename must be on the MATLAB® path or you must specify the path with the filename.

Data Types: char | string

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: Format='numeric' specifies that the space weather data is stored as one-dimensional cell arrays (F107_DATA_TYPE) and numeric arrays (all other data in matfile).

Earliest date to read data from spaceWeatherFile, specified as a datetime object or scalar. The default value is the earliest date in spaceWeatherFile. StartDate cannot occur after EndDate.

Latest date to read data from spaceWeatherFile, specified as a datetime object or scalar. The default value is the latest date in spaceWeatherFile. EndDate cannot occur before StartDate.

Folder in which to save matfile, specified as a character vector or string scalar. The default folder is the current folder with write permissions. Create this folder with write permission first before specifying FolderName.

Format in which space weather data is stored in matfile, specified as one of these values:

  • 'numeric' — Data is stored as one-dimensional cell arrays (F107_DATA_TYPE) and numeric arrays (all other data in matfile). These variables are stored in matfile.

    Space Weather Data File VariablesDescription

    YEAR

    ISO 8601 year.

    MONTH

    ISO 8601 month.

    DAY

    ISO 8601 day.

    BRSN

    Bartels Solar Rotation Number. A sequence of 27-day intervals counted continuously from Feb 8, 1832.

    ND

    Number of day within the Bartels 27-day cycle (01-27).

    KP1

    Planetary 3-hour range index (Kp) for 0000-0300 coordinated universal time.

    KP2

    Planetary 3-hour range index (Kp) for 0300-0600 coordinated universal time.

    KP3

    Planetary 3-hour range index (Kp) for 0600-0900 coordinated universal time.

    KP4

    Planetary 3-hour range index (Kp) for 0900-1200 coordinated universal time.

    KP5

    Planetary 3-hour range index (Kp) for 1200-1500 coordinated universal time.

    KP6

    Planetary 3-hour range index (Kp) for 1500-1800 coordinated universal time.

    KP7

    Planetary 3-hour range index (Kp) for 1800-2100 coordinated universal time.

    KP8

    Planetary 3-hour range index (Kp) for 2100-0000 coordinated universal time.

    KP_SUM

    Sum of the 8 planetary 3-hour range indices (Kp) for the day.

    AP1

    Planetary equivalent amplitude (Ap) for 0000-0300 coordinated universal time.

    AP2

    Planetary equivalent amplitude (Ap) for 0300-0600 coordinated universal time.

    AP3

    Planetary 3-hour range index (Kp) for 0600-0900 coordinated universal time.

    AP4

    Planetary equivalent amplitude (Ap) for 0900-1200 coordinated universal time.

    AP5

    Planetary equivalent amplitude (Ap) for 1200-1500 coordinated universal time.

    AP6

    Planetary equivalent amplitude (Ap) for 1500-1800 coordinated universal time.

    AP7

    Planetary equivalent amplitude (Ap) for 1800-2100 coordinated universal time.

    AP8

    Planetary equivalent amplitude (Ap) for 2100-0000 coordinated universal time.

    AP_AVG

    Arithmetic average of the 8 planetary equivalent amplitude indices (Ap) 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

    A conversion of the 0 to 2.5 range of the Cp index to one digit between 0 and 9.

    ISN

    International sunspot number. Records contain the Zurich number through December 31, 1980, and the international Brussels number thereafter.

    F107_OBS

    Observed 10.7-cm solar radio flux (F10.7). Measured in units of 10-22 W/m2/Hz. at:

    • Ottawa, Canada at 1700 coordinated universal time daily from February 14, 1947, to May 31, 1991.

    • Penticton, British Columbia, Canada at 2000 coordinated universal time daily from June 1, 1991.

    F107_ADJ

    10.7-cm solar radio flux (F10.7) (adjusted to 1 AU).

    F107_DATA_TYPE

    Flux qualifier:

    • OBS — Observed flux measurement.

    • INT — CelesTrak linear interpolation of missing data.

    • PRD — 45-Day predicted flux.

    • PRM — Monthly predicted flux.

    F107_OBS_CENTER81

    Centered 81-day arithmetic average of F10.7 (observed).

    F107_OBS_LAST81

    Last 81-day arithmetic average of F10.7 (observed).

    F107_ADJ_CENTER81

    Centered 81-day arithmetic average of F10.7 (adjusted to 1 AU).

    F107_ADJ_LAST81

    Last 81-day arithmetic average of F10.7 (adjusted to 1 AU).

  • 'timetable' — Data is stored in a timetable.

    matfile contains a timetable variable named 'fluxData'. The columns of the timetable have the same names as the 'numeric' variables with the exception that YEAR, MONTH, and DAY are combined into a single DATE column that contains datetime objects.

Output Arguments

collapse all

Full path to new MAT-file containing space weather data, specified as a character array. The MAT-file name has the format aerospaceweatherdataYYYYMMDD.mat, where:

  • YYYY —Year when the CelesTrak file was read.

  • MM — Month when the CelesTrak file was read.

  • DD — Calendar day when the CelesTrak file was read.

Earliest date corresponding to the data saved in matfile, specified as a 3-element vector formatted as [year,dayOfYear,UTSeconds]. The default value is the earliest date in spaceWeatherFile.

Latest date corresponding to the data saved in matfile, specified as a 3-element vector formatted as [year,dayOfYear,UTSeconds]. The default value is the latest date in spaceWeatherFile.

Version History

Introduced in R2023a