Main Content

fluxSolarAndGeomagnetic

Extract solar flux and geomagnetic field data

Since R2023a

Description

[f107average,f107daily,magneticIndex] = fluxSolarAndGeomagnetic(year,dayOfYear,UTseconds,matFile) extracts the solar flux and geomagnetic data from the MAT-file matFile that is generated by the aeroReadSpaceWeatherData function.

The fluxSolarAndGeomagnetic function returns the 81-day average of F10.7 solar flux f107average (centered on the day of year), daily F10.7 flux for previous day f107daily, and geomagnetic index information magneticIndex corresponding to the times specified in year, dayOfYear, and UTseconds. Use this output to specify the f107average ,f107daily, and magneticIndex values for the atmosnrlmsise00 function.

[___] = fluxSolarAndGeomagnetic(___,Name=Value) specifies additional options using one or more name-value arguments. For example, to specify that the elements of magneticIndex are extrapolated to the nearest data point available in the MAT-file, set MagneticIndexExtrapMethod to 'none-clip'.

Input Arguments

collapse all

Year, specified as an m-by-1 array.

Data Types: double

Day of year, specified as an m-by-1 array. For more information, see day.

Data Types: double

Universal time (UT), specified as an m-by-1 array in seconds.

Data Types: double

MAT-file of space weather data, specified as a character vector or string scalar. This file is the output from the aeroReadSpaceWeatherData function. If the file is not on the MATLAB® path, specify the full pathname. matFile must contain these variables from the space weather data file:

  • YEAR

  • MONTH

  • DAY

  • AP1

  • AP2

  • AP3

  • AP4

  • AP5

  • AP6

  • AP7

  • AP8

  • AP_AVG

  • F107_OBS

  • F107_DATA_TYPE

  • F107_OBS_CENTER81

For more information, see aeroReadSpaceWeatherData.

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: MagneticIndexExtrapMethod='none-clip' specifies that the elements of magneticIndex are extrapolated to the nearest data point available in the MAT-file.

Extrapolation method for f107Average and f107Daily for times outside the range of the MAT-file data, specified as one of these values.

MethodDescription
'none-clip'

Set f107Average and f107Daily to the nearest data point available in the MAT-file.

'constant'

Set f107Average and f107Daily to a constant value specified by the F107ExtrapolationValue name-value argument.

'least-squares-fit'

Approximate f107Average and f107Daily using a least-squares fit of the space weather data from October 1, 1957, to December 1, 2040. This method uses a trigonometric function of the form:

a + b*cos(c*t + d*sin(e*t)

where t is time.

Data Types: char | string

Extrapolation value to assign to f107Average and to calculate f107Daily, specified as a scalar.

Dependencies

This value is assigned when:

  • F107ExtrapMethod is set to 'constant'.

  • Time specified by year, dayOfYear, and UTseconds is outside the range of the data in the MAT-file.

Data Types: double

Extrapolation method for magneticIndex values for times outside the range of the MAT-file data, specified as one of these values.

MethodDescription
'none-clip'

Set elements of magneticIndex to the nearest data point available in the MAT-file.

'constant'

Set elements of magneticIndex to a constant value specified by the F107ExtrapolationValue name-value argument.

'igrf'

Calculate the elements of magneticIndex using the International Geomagnetic Reference Field. Because this model is defined for times between January 1, 1900, 12:00 AM UTC and January 1, 2025, 12:00 AM UTC, the predictions for times outside this range are clipped to values at these time limits.

Data Types: char | string

Extrapolation value used to calculate magneticIndex elements, specified as a scalar.

Dependencies

This value is assigned when:

  • MagneticIndexExtrapMethod is set to 'constant'.

  • Time specified by year, dayOfYear, and UTseconds is outside the range of the data in the MAT-file.

Data Types: double

Output Arguments

collapse all

81-day average of F10.7 flux, centered on day of year (dayOfYear), specified as an m-by-1 array. These values correspond to the 10.7 cm radio flux at the actual distance of the Earth from the Sun. They do not correspond to the radio flux at 1 AU.

Daily F10.7 flux for previous day, specified as an m-by-1 array. These values correspond to the 10.7 cm radio flux at the actual distance of the Earth from the Sun. They do not correspond to the radio flux at 1 AU.

Magnetic index information, specified as an m-by-7 array. This information consists of:

  • Daily magnetic index (AP)

  • 3-hour AP for current time

  • 3-hour AP for 3 hours before current time

  • 3-hour AP for 6 hours before current time

  • 3-hour AP for 9 hours before current time

  • Average of eight 3-hour AP indices from 12 to 33 hours before current time

  • Average of eight 3-hour AP indices from 36 to 57 hours before current time

    For more information, see Limitations.

Limitations

When specifying MagneticIndexExtrapvalue as 'igrf', the fluxSolarAndGeomagnetic function predicts the elements of magneticIndex outside the MAT-file data range using the International Geomagnetic Reference Field. Because this model is defined for times between January 1, 1900, 12:00 AM UTC and January 1, 2025, 12:00 AM UTC, the predictions for times outside this range are clipped to values at these time limits.

Algorithms

The default space weather data file aeroSpaceWeatherData.mat installed with the Aerospace Toolbox was created using the aeroReadSpaceWeatherData function. aeroReadSpaceWeatherData reads space weather data from a CelesTrak® consolidated space weather data file into a MAT-file.

  • Geomagnetic data - Provided by the Geomagnetic Observatory Niemegk, GFZ German Research Center for Geosciences, and licensed under the CC-BY-4.0 license. Matzka, J., Stolle, C., Yamazaki, Y., Bronkalla, O. and Morschhauser, A., 2021. The geomagnetic Kp index and derived indices of geomagnetic activity. Space Weather, https://doi.org/10.1029/2020SW002641.

  • Solar Radio Flux Data - Provided by Dominion Radio Astrophysical Observatory and Natural Resources Canada.

  • 45-Day and Monthly predictions - Provided by the Space Weather Prediction center of the National Oceanic and Atmospheric Administration (NOAA).

To generate an up-to-date space weather data MAT-file to use with the fluxSolarAndGeomagnetic function, use the aeroReadSpaceWeatherData function.

Version History

Introduced in R2023a