Application Programming Interface

This library contains components for PyIRI software.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather, ESS Open Archive, September 28, 2023, doi:10.22541/essoar.169592556.61105365/v1.

Bilitza et al. (2022), The International Reference Ionosphere model: A review and description of an ionospheric benchmark, Reviews of Geophysics, 60.

Nava et al. (2008). A new version of the NeQuick ionosphere electron density model. J. Atmos. Sol. Terr. Phys., 70 (15), doi:10.1016/j.jastp.2008.01.015.

Jones, W. B., Graham, R. P., & Leftin, M. (1966). Advances in ionospheric mapping by numerical methods.

PyIRI.main_library.EDP_builder(x, aalt)[source]

Construct vertical EDP.

Parameters:
xarray-like

Array where 1st dimention indicates the parameter (total 11 parameters), second dimension is time, and third is horizontal grid [11, N_T, N_G].

aaltarray-like

1-D array of altitudes [N_V] in km.

Returns:
density_outarray-like

3-D electron density [N_T, N_V, N_G] in m-3.

Notes

This function builds the EDP from the provided parameters for all time frames, all vertical and all horizontal points.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.main_library.F107_2_IG12(F107)[source]

Convert F10.7 to IG12 coefficients.

Parameters:
F107float or array-like

Solar flux F10.7 coefficient in SFU.

Returns:
IG12float or array-like

Ionosonde Global coefficient.

Notes

This function converts F10.7 to IG12.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Bilitza et al. (2022), The International Reference Ionosphere model: A review and description of an ionospheric benchmark, Reviews of Geophysics, 60.

PyIRI.main_library.F107_2_R12(F107)[source]

Convert F10.7 to R12 coefficients.

Parameters:
F107float or array-like

Solar flux at 10.7 in SFU.

Returns:
R12float or array-like

12-month sunspot number.

Notes

This function converts F10.7 to R12.

PyIRI.main_library.IG12_2_F107(IG12)[source]

Convert IG12 to F10.7 coefficients.

Parameters:
IG12float or array-like

Ionosonde Global coefficient.

Returns:
F107float or array-like

Solar flux F10.7 coefficient in SFU.

Notes

This function converts IG12 to F10.7.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Bilitza et al. (2022), The International Reference Ionosphere model: A review and description of an ionospheric benchmark, Reviews of Geophysics, 60.

PyIRI.main_library.IG12_2_R12(IG12)[source]

Convert IG12 to R12 coefficients.

Parameters:
IG12float or array-like

Ionosonde Global coefficient.

Returns:
R12float or array-like

Sunspot number coefficient R12.

Notes

This function converts IG12 to R12.

References

Bilitza et al. (2022), The International Reference Ionosphere model: A review and description of an ionospheric benchmark, Reviews of Geophysics, 60.

PyIRI.main_library.IRI_density_1day(year, mth, day, aUT, alon, alat, aalt, F107, coeff_dir, ccir_or_ursi=0)[source]

Output ionospheric parameters for a particular day.

Parameters:
yearint

Year.

mthint

Month of year.

dayint

Day of month.

aUTarray-like

Array of universal time (UT) in hours. Must be Numpy array of any size [N_T].

alonarray-like

Flattened array of geographic longitudes in degrees. Must be Numpy array of any size [N_G].

alatarray-like

Flattened array of geographic latitudes in degrees. Must be Numpy array of any size [N_G].

aaltarray-like

Array of altitudes in km. Must be Numpy array of any size [N_V].

F107float

User provided F10.7 solar flux index in SFU.

coeff_dirstr

Place where coefficients are located.

ccir_or_ursiint

If 0 is given CCIR will be used for F2 critical frequency. If 1 then URSI coefficients. (default=0)

Returns:
F2dict

‘Nm’ is peak density of F2 region in m-3. ‘fo’ is critical frequency of F2 region in MHz. ‘M3000’ is the obliquity factor for a distance of 3,000 km. Defined as refracted in the ionosphere, can be received at a distance of 3,000 km, unitless. ‘hm’ is height of the F2 peak in km. ‘B_topi is top thickness of the F2 region in km. ‘B_bot’ is bottom thickness of the F2 region in km. Shape [N_T, N_G, 2].

F1dict

‘Nm’ is peak density of F1 region in m-3. ‘fo’ is critical frequency of F1 region in MHz. ‘P’ is the probability occurrence of F1 region, unitless. ‘hm’ is height of the F1 peak in km. ‘B_bot’ is bottom thickness of the F1 region in km. Shape [N_T, N_G, 2].

Edict

‘Nm’ is peak density of E region in m-3. ‘fo’ is critical frequency of E region in MHz. ‘hm’ is height of the E peak in km. ‘B_top’ is bottom thickness of the E region in km. ‘B_bot’ is bottom thickness of the E region in km. Shape [N_T, N_G, 2].

Esdict

‘Nm’ is peak density of Es region in m-3. ‘fo’ is critical frequency of Es region in MHz. ‘hm’ is height of the Es peak in km. ‘B_top’ is bottom thickness of the Es region in km. ‘B_bot’ is bottom thickness of the Es region in km. Shape [N_T, N_G, 2].

sundict

‘lon’ is longitude of subsolar point in degrees. ‘lat’ is latitude of subsolar point in degrees. Shape [N_G].

magdict

‘inc’ is inclination of the magnetic field in degrees. ‘modip’ is modified dip angle in degrees. ‘mag_dip_lat’ is magnetic dip latitude in degrees. Shape [N_G].

EDParray-like

Electron density profiles in m-3 with shape [N_T, N_V, N_G]

Notes

This function returns ionospheric parameters and 3-D electron density for a given day and provided F10.7 solar flux index.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.main_library.IRI_monthly_mean_par(year, mth, aUT, alon, alat, coeff_dir, ccir_or_ursi=0)[source]

Output monthly mean ionospheric parameters.

Parameters:
yearint

Year.

mthint

Month of year.

aUTarray-like

Array of universal time (UT) in hours. Must be Numpy array of any size [N_T].

alonarray-like

Flattened array of geographic longitudes in degrees. Must be Numpy array of any size [N_G].

alatarray-like

Flattened array of geographic latitudes in degrees. Must be Numpy array of any size [N_G].

coeff_dirstr

Place where coefficients are.

ccir_or_ursiint

If 0 is given CCIR will be used for F2 critical frequency, if 1 then URSI. (default=0)

Returns:
F2dict

‘Nm’ is peak density of F2 region in m-3. ‘fo’ is critical frequency of F2 region in MHz. ‘M3000’ is the obliquity factor for a distance of 3,000 km. Defined as refracted in the ionosphere, can be received at a distance of 3,000 km, unitless. ‘hm’ is height of the F2 peak in km. ‘B_topi is top thickness of the F2 region in km. ‘B_bot’ is bottom thickness of the F2 region in km. Shape [N_T, N_G, 2].

F1dict

‘Nm’ is peak density of F1 region in m-3. ‘fo’ is critical frequency of F1 region in MHz. ‘P’ is the probability occurrence of F1 region, unitless. ‘hm’ is height of the F1 peak in km. ‘B_bot’ is bottom thickness of the F1 region in km. Shape [N_T, N_G, 2].

Edict

‘Nm’ is peak density of E region in m-3. ‘fo’ is critical frequency of E region in MHz. ‘hm’ is height of the E peak in km. ‘B_top’ is the top thickness of the E region in km. ‘B_bot’ is the bottom thickness of the E region in km. Shape [N_T, N_G, 2].

Esdict

‘Nm’ is peak density of Es region in m-3. ‘fo’ is critical frequency of Es region in MHz. ‘hm’ is height of the Es peak in km. ‘B_top’ is the top thickness of the Es region in km. ‘B_bot’ is the bottom thickness of the Es region in km. Shape [N_T, N_G, 2].

sundict

‘lon’ is longitude of subsolar point in degrees. ‘lat’ is latitude of subsolar point in degrees. Shape [N_G]

magdict

‘inc’ is inclination of the magnetic field in degrees. ‘modip’ is modified dip angle in degrees. ‘mag_dip_lat’ is magnetic dip latitude in degrees. Shape [N_G]

Notes

This function returns monthly mean ionospheric parameters for min and max levels of solar activity that correspond to the Ionosonde Index IG12 of 0 and 100.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.main_library.Probability_F1(year, mth, utime, alon, alat, mag_dip_lat, aIG, foE)[source]

Calculate probability occurrence of F1 layer.

Parameters:
yearint

Year.

mthint

Month.

timearray-like

Array of UTs in hours.

alonarray-like

Flattened array of longitudes in degrees.

alatarray-like

Flattened array of latitudes in degrees.

mag_dip_latarray-like

Flattened array of magnetic dip latitudes in degrees.

aIGarray-like

Min and Max of IG12.

foEarray-like

E-region critical frequency in MHz.

Returns:
a_Parray-like

Probability occurrence of F1 layer.

a_foF1array-like

Critical frequency of F1 layer in MHz.

Notes

This function calculates numerical maps probability of F1 layer.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Bilitza et al. (2022), The International Reference Ionosphere model: A review and description of an ionospheric benchmark, Reviews of Geophysics, 60.

PyIRI.main_library.R12_2_F107(R12)[source]

Convert R12 to F10.7 coefficients.

Parameters:
R12float or array-like

12-month sunspot number.

Returns:
F107float or array-like

Solar flux at 10.7 in SFU.

Notes

This function converts R12 to F10.7.

PyIRI.main_library.R12_2_IG12(R12)[source]

Convert R12 to IG12 coefficients.

Parameters:
R12float or array-like

Sunspot number coefficient R12.

Returns:
IG12float or array-like

Ionosonde Global Coefficient.

Notes

This function converts R12 to IG12.

PyIRI.main_library.adjust_longitude(lon, type)[source]

Adjust longitudes from 180 to 360 and back.

Parameters:
lonarray-like

Longitudes in degrees.

typestr

Indicates the type of adjustment.

Returns:
lonarray-like

Adjusted longitude.

Notes

This function adjusts the array of longitudes to go from -180-180 or from 0-360.

PyIRI.main_library.create_reg_grid(hr_res=1, lat_res=1, lon_res=1, alt_res=10, alt_min=0, alt_max=700)[source]

Run IRI for a single day on a regular grid.

Parameters:
hr_resint or float

Time resolution in hours (default=1)

lat_resint or float

Latitude resolution in degrees (default=1)

lon_resint or float

Longitude resolution in degrees (default=1)

alt_resint or float

Altitude resolution in km (default=10)

alt_minint or float

Altitude minimum in km (default=0)

alt_maxint or float

Altitude maximum in km (default=700)

Returns:
alonarray-like

1D longitude grid

alatarray-like

1D latitude grid

alon_2darray-like

2D longitude grid

alat_2darray-like

2D latitude grid

aaltarray-like

Altitude grid

ahrarray-like

UT grid

Notes

This function creates a regular global grid in Geographic coordinates using given spatial resolution lon_res, lat_res. In case you want to run IRI in magnetic coordinates, you can obtain a regular grid in magnetic coordinates, then convert it to geographic coordinates using your own methods, and then use these 1-D alon and alat arrays. Similarly, if you are interested in regional grid, then use your own alon and alat 1-D arrays. alon and alat can also be irregular arrays. In case you need to run IRI for 1 grid point, define alon and alat as NumPy arrays that have only 1 element. Size of alon and alat is [N_G]. This function creates creates an array of altitudes for the vertical dimension of electron density profiles. Any 1-D Numpy array in [km] would work, regularly or irregularly spaced. This function also creates time array aUT using a given temporal resolution hr_res in hours. E.g. if hr_res = 0.25 it will lead to 15-minutes time resolution. You can define aUT your own way, just keep it 1-D and expressed in hours. It can be regularly or irregularly spaced array. If you want to run PyIRI for just 1 time frame, then define aUT as NumPy arrays that have only 1 element. Size of aUT is [N_T].

PyIRI.main_library.day_of_the_month_corr(year, month, day)[source]

Find fractions of influence of months “before” and “after”.

Parameters:
yearint

Given year.

monthint

Given month.

dayday

Given day.

Returns:
t_beforeclass:dt.datetime

Consider mean values from this month as month “before”.

t_afterclass:dt.datetime

Consider mean values from this month as month “after”.

fraction1float

Fractional influence of month “before”.

fraction2float

Fractional influence of month “after”.

Notes

This function finds two months around the given day and calculates fractions of influence for previous and following months.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Bilitza et al. (2022), The International Reference Ionosphere model: A review and description of an ionospheric benchmark, Reviews of Geophysics, 60.

PyIRI.main_library.decimal_year(dtime)[source]

Determine the decimal year.

Parameters:
dtimeclass:dt.datetime

Given datetime.

Returns:
date_decimalfloat

Decimal year.

Notes

This function returns decimal year. For example, middle of the year is 2020.5.

PyIRI.main_library.den2freq(dens)[source]

Convert ionospheric plasma density to frequency.

Parameters:
densarray-like

Plasma density in m-3.

Returns:
freqarray-like

Ionospheric frequency in MHz.

Notes

This function converts plasma density to ionospheric frequency.

PyIRI.main_library.diurnal_functions(time_array)[source]

Set diurnal functions for F2, M3000, and Es.

Parameters:
time_arrayarray-like

Array of UTs in hours.

Returns:
D_f0f2array-like

Diurnal functions for foF2.

D_M3000array-like

Diurnal functions for M3000.

D_Es_medianarray-like

Diurnal functions for Es.

Notes

This function calculates diurnal functions for F0F2, M3000, and Es coefficients

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Jones, W. B., Graham, R. P., & Leftin, M. (1966). Advances in ionospheric mapping 476 by numerical methods.

PyIRI.main_library.drop_function(x)[source]

Calculate drop function from a simple family of curve.

Parameters:
xarray-like

Portion of the altitude array.

Returns:
yarray-like

Function that can be multiplied with x to reduce the influence of x.

Notes

This is a drop function from a simple family of curve. It is used to reduce the F1_top contribution for the F2_bot region, so that when the summation of Epstein functions is performed, the presence of F1 region would not mess up with the value of NmF2.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.main_library.edp_to_vtec(edp, aalt, min_alt=0.0, max_alt=202000.0)[source]

Calculate Vertical Total Electron Content (VTEC) from electron density.

Parameters:
edpnp.array

Electron density profile in per cubic m with dimensions of [N_T, N_V, N_G]

aaltnp.array

Altitude array with altitude in km used to create the edp, has dimensions of [N_V].

min_altfloat

Minimum allowable altitude in km to include in TEC calculation (default=0.0)

max_altfloat

Maximum allowable altitude in km to include in TEC calculation (default=202000.0)

Returns:
vtecnp.array

Vertical Total Electron Content in TECU with dimensions of [N_T, N_G]

Raises:
ValueError

If min_alt and max_alt result in no density data to integrate.

Notes

Providing aalt allows irregular altitude grids to be used.

Supplying min_alt and max_alt will not extend the electron density integration range, only limit it. Current limits extend from the ground to the altitude of the GPS satellite constellation.

1 TECU = 10^16 electrons per square meter

PyIRI.main_library.epstein(Nm, hm, B, alt)[source]

Calculate Epstein function for given parameters.

Parameters:
Nmarray-like

Peak density in m-3.

hmarray-like

Height of peak density in km.

Barray-like

Thickness of the layer in km.

altarray-like

Altitude array in km.

Returns:
resarray-like

Constructed Epstein profile in m-3.

Notes

This function returns Epstein function for given parameters. In a typical Epstein function: X = Nm, Y = hm, Z = B, and W = alt.

PyIRI.main_library.epstein_function_array(A1, hm, B, x)[source]

Construct density Epstein profile for any layer (except topside of F2).

Parameters:
A1array-like

Amplitude of layer in m-3.

hmarray-like

Height of layer in km.

Barray-like

Thickness in km.

xarray-like

Altitude in km.

Returns:
densityarray-like

Constructed density in m-3.

Notes

This function constructs density Epstein profile for any layer.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.main_library.epstein_function_top_array(A1, hmF2, B_F2_top, x)[source]

Construct density Epstein profile for the topside of F2 layer.

Parameters:
A1array-like

Amplitude of F2 layer in m-3.

hmF2array-like

Height of F2 layer in km.

B_F2_toparray-like

Thickness of topside F2 layer in km.

xarray-like

Altitude in km.

Returns:
densityarray-like

Constructed density in m-3.

Notes

This function constructs density Epstein profile for the topside of F2 layer.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.main_library.fexp(x)[source]

Calculate exponent without overflow.

Parameters:
xarray-like

Any input.

Returns:
yarray-like

Exponent of x.

Notes

This function function calculates exp(x) with restrictions to not cause overflow.

PyIRI.main_library.find_B_F1_bot(hmF1, hmE, P_F1)[source]

Determine the thickness of F1 layer.

Parameters:
hmF1array-like

Height of F1 layer in km.

hmEarray-like

Height of E layer in km.

P_F1array-like

Probability of observing F1 layer.

Returns:
B_F1_botarray-like

Thickness of F1 layer in km.

Notes

This function returns thickness of F1 layer in km. This is done using hmF1 and hmE, as described in NeQuick Eq 87

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.main_library.foE(mth, solzen_effective, alat, f107)[source]

Calculate critical frequency of E region.

Parameters:
mthint

Month.

solzen_effectivearray-like

Effective solar zenith angle with shape [ntime].

alatarray-like

Flattened array of latitudes in degrees with shape [ngrid].

f107float

F10.7 solar flux in SFU.

Returns:
foEarray-like

Critical frequency of E region in MHz with shape [ntime, ngrid].

Notes

This function caclulates foE for a given effective solar zenith angle and level of solar activity. This routine is based on the Ionospheric Correction Algorithm for Galileo Single Frequency Users that describes the NeQuick Model.

Result is: foE = critical frequency of the E region (MHz), np.array,

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Nava et al. (2008). A new version of the NeQuick ionosphere electron density model. J. Atmos. Sol. Terr. Phys., 70 (15), 490 doi: 10.1016/j.jastp.2008.01.015

PyIRI.main_library.fractional_correction_of_dictionary(fraction1, fraction2, F_before, F_after)[source]

Interpolate btw 2 middles of consequent months to the given day.

Parameters:
fraction1float

Fractional influence of month “before”.

fraction2float

Fractional influence of month “after”.

F_beforedict

Dictionary of mean parameters for month “before”.

F_afterdict

Dictionary of mean parameters for month “after”.

Returns:
F_newdict

Parameters interpolated according to given fractions.

Notes

This function interpolates between 2 middles of consequent months to the specified day by using provided fractions previously calculated by function “day_of_the_month_corr”.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Bilitza et al. (2022), The International Reference Ionosphere model: A review and description of an ionospheric benchmark, Reviews of Geophysics, 60.

PyIRI.main_library.freq2den(freq)[source]

Convert ionospheric frequency to plasma density.

Parameters:
freqarray-like

ionospheric frequency in MHz.

Returns:
densarray-like

plasma density in m-3.

Notes

This function converts ionospheric frequency to plasma density.

PyIRI.main_library.freq_to_Nm(foF2, foF1, foE, foEs)[source]

Convert critical frequency to plasma density.

Parameters:
foF2array-like

Critical frequency of F2 layer in MHz.

foF1array-like

Critical frequency of F1 layer in MHz.

foEarray-like

Critical frequency of E layer in MHz.

foEsarray-like

Critical frequency of Es layer in MHz.

Returns:
NmF2array-like

Peak density of F2 layer in m-3.

NmF1array-like

Peak density of F1 layer in m-3.

NmEarray-like

Peak density of E layer in m-3.

NmEsarray-like

Peak density of Es layer in m-3.

Notes

This function returns maximum density for the given critical frequency and limits it to 1 if it is below zero.

PyIRI.main_library.gamma(D_f0f2, D_M3000, D_Es_median, G_fof2, G_M3000, G_Es_median, F_fof2_coeff, F_M3000_coeff, F_Es_median)[source]

Calculate foF2, M3000 propagation parameter, and foEs.

Parameters:
D_f0f2array-like

Diurnal functions for F2 region.

D_M3000array-like

Diurnal functions for M3000 propagation parameter.

D_Es_medianarray-like

Diurnal functions for Es region.

G_fof2array-like

Global functions for F2 region.

G_M3000array-like

Global functions for M3000 propagation parameter.

G_Es_medianarray-like

Global functions for Es region.

F_fof2_coeffarray-like

CCIR or URCI coefficients.

F_M3000_coeffarray-like

CCIR coefficients.

F_Es_medianarray-like

Bradley Es coefficients.

Returns:
gamma_f0f2array-like

Critical frequency of F2 layer.

gamma_M3000array-like

M3000 propagation parameter.

gamma_Es_medianarray-like

Critical frequency of Es layer.

Notes

This function calculates numerical maps for F0F2, M3000, and Es for 2 levels of solar activity (min, max) using matrix multiplication

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.main_library.gammaE(year, mth, utime, alon, alat, aIG)[source]

Calculate numerical maps for critical frequency of E region.

Parameters:
yearint

Year.

mthint

Month.

utimearray-like

Array of UTs in hours.

alonarray-like

Flattened array of longitudes in degrees.

alatarray-like

Flattened array of latitudes in degrees.

aIGarray-like

Min and max of IG12 index.

Returns:
gamma_Earray-like

critical frequency of E region in MHz.

solzenarray-like

Solar zenith angle in degrees.

solzen_effarray-like

Effective solar zenith angle in degrees.

slonarray-like

Longitude of subsolar point in degrees.

slatarray-like

Latitude of subsolar point in degrees.

Notes

This function calculates numerical maps for FoE for 2 levels of solar activity.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.main_library.highest_power_of_extension()[source]

Provide the highest power of extension.

Returns:
constdict

Dictionary that has QM, nk, and nj parameters.

Notes

This function sets a common set of constants that define the power of expansions. QM = array of highest power of sin(x). nk = highest order of geographic extension. e.g. there are 76 functions in Table 3 on page 18 in Jones & Graham 1965. nj = highest order in diurnal variation.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Jones, W. B., & Gallet, R. M. (1965). Representation of diurnal and geographic variations of ionospheric data by numerical methods, control of instability, ITU Telecommunication Journal , 32 (1), 18–28.

PyIRI.main_library.hmF1_from_F2(NmF2, NmF1, hmF2, B_F2_bot)[source]

Determine the height of F1 layer.

Parameters:
NmF2array-like

Peak density of F2 layer in m-3.

NmF1array-like

Peak density of F1 layer in m-3.

hmF2array-like

Height of F2 layer in km.

B_F2_botarray-like

Thickness of F2 bottom layer in km.

Returns:
hmF1array-like

Height of F1 layer in km.

Notes

This function calculates hmF1 from known shape of F2 bottom side, where it drops to NmF1.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.main_library.hm_IRI(M3000, foE, foF2, modip, aIG)[source]

Return height of the ionospheric layers.

Parameters:
M3000array-like

Propagation parameter for F2 region related to hmF2.

foEarray-like

Critical frequency of E region in MHz.

foF2array-like

Critical frequency of F2 region in MHz.

modiparray-like

Modified dip angle in degrees.

aIGarray-like

Min and max of IG12 index.

Returns:
hmF2array-like

Height of F2 layer in km.

hmEarray-like

Height of E layer in km.

hmEsarray-like

Height of Es layer in km.

Notes

This function returns height of ionospheric layers like it is done in IRI.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Bilitza et al. (2022), The International Reference Ionosphere model: A review and description of an ionospheric benchmark, Reviews of Geophysics, 60.

PyIRI.main_library.juldat(times)[source]

Calculate the Julian time given calendar date and time.

Parameters:
timesclass:dt.datetime

Julian time in days.

Returns:
julian_datetimefloat

Julian date.

Raises:
ValueError

For input of the wrong type.

Notes

This function calculates the Julian time given calendar date and time in np.datetime64 array. This function is consistent with NOVAS, The US Navy Observatory Astronomy Software Library and algorithm by Fliegel and Van Flander.

PyIRI.main_library.limit_Nm(Nm, edens_lim=1000000.0)[source]

Enforce a realistic lower limit on the electron density.

Parameters:
Nmarray-like

Electron density in m-3.

edens_limfloat

Lowest allowable electron density (default=1e6)

Returns:
Nmarray-like

Electron density in m-3 without negative values.

Notes

This function replaces nans and negative density with 1e6.

PyIRI.main_library.quadratic(coeff)[source]

Solve quadratic equation for given coefficients a, b, c.

Parameters:
coeffarray-like

Array with a, b, and c coefficients as the first three elements, which may be floats or arrays.

Returns:
[root1, root2]list

List of two root solutions. The first solution, uses addition and the second solution uses subtraction.

Notes

This function solves quadratic equation and returns 2 roots.

PyIRI.main_library.read_ccir_ursi_coeff(mth, coeff_dir, output_deciles=False, output_quartiles=None)[source]

Read coefficients from CCIR, URSI, and Es.

Parameters:
mthint

Month.

coeff_dirstr

Place where the coefficient files are.

output_decilesbool

Return an additional output, the upper and lower deciles of the Bradley coefficients for Es (default=False)

output_quartilesbool

Deprecated since version 0.0.5 This argument will be removed in version 0.0.6+. Use ‘output_deciles’ instead. Return an additional output, the upper and lower deciles (not quartiles) of the Bradley coefficients for Es (default=None)

Returns:
F_fof2_CCIRarray-like

CCIR coefficients for F2 frequency.

F_fof2_URSIarray-like

URSI coefficients for F2 frequency.

F_M3000array-like

CCIR coefficients for M3000.

F_Es_medianarray-like

Bradley coefficients for Es.

F_Es_lowerarray-like

Lower decile sporadic E Bradley coefficients. Optional output only included if output_deciles (or the deprecated argument output_quartiles) is True.

F_Es_upperarray-like

Upper decile sporadic E Bradley coefficients. Optional output only included if output_deciles (or the deprecated argument output_quartiles) is True.

Notes

This function sets the combination of sin and cos functions that define the diurnal distribution of the parameters and that can be further multiplied by the coefficients U_jk (from CCIR, URSI, and Es maps). The desired equation can be found in the Technical Note Advances in Ionospheric Mapping by Numerical Methods, Jones & Graham 1966. Equation (c) page 38. Acknowledgement for Es coefficients: Mrs. Estelle D. Powell and Mrs. Gladys I. Waggoner in supervising the collection, keypunching and processing of the foEs data. This work was sponsored by U.S. Navy as part of the SS-267 program. The final development work and production of the foEs maps was supported by the U.S Information Agency. Acknowledgments to Doug Drob (NRL) for giving me these coefficients.

Deprecated since version 0.0.5: The ‘output_quartiles’ parameter is deprecated and will be removed in version 0.0.6+. Use ‘output_deciles’ instead.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Jones, W. B., Graham, R. P., & Leftin, M. (1966). Advances in ionospheric mapping 476 by numerical methods.

Bradley, P. A. (2003). Ingesting a sporadic-e model to iri. Adv. Space Res., 31(3), 577-588.

PyIRI.main_library.reconstruct_density_from_parameters(F2, F1, E, alt)[source]

Construct vertical EDP for 2 levels of solar activity.

Parameters:
F2dict

Dictionary of parameters for F2 layer.

F1dict

Dictionary of parameters for F1 layer.

Edict

Dictionary of parameters for E layer.

altarray-like

1-D array of altitudes [N_V] in km.

Returns:
x_outarray-like

Electron density for two levels of solar activity [2, N_T, N_V, N_G] in m-3.

Notes

This function calculates 3-D density from given dictionaries of the parameters for 2 levels of solar activity.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.main_library.reconstruct_density_from_parameters_1level(F2, F1, E, alt)[source]

Construct vertical EDP for 1 level of solar activity.

Parameters:
F2dict

Dictionary of parameters for F2 layer.

F1dict

Dictionary of parameters for F1 layer.

Edict

Dictionary of parameters for E layer.

altarray-like

1-D array of altitudes [N_V] in km.

Returns:
x_outarray-like

Electron density for two levels of solar activity [N_T, N_V, N_G] in m-3.

Notes

This function calculates 3-D density from given dictionaries of the parameters for 1 level of solar activity.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.main_library.run_iri_reg_grid(year, month, day, f107, hr_res=1, lat_res=1, lon_res=1, alt_res=10, alt_min=0, alt_max=700, ccir_or_ursi=0)[source]

Run IRI for a single day on a regular grid.

Parameters:
yearint

Four digit year in C.E.

monthint

Integer month (range 1-12)

dayint

Integer day of month (range 1-31)

f107int or float

F10.7 index for the given day

hr_resint or float

Time resolution in hours (default=1)

lat_resint or float

Latitude resolution in degrees (default=1)

lon_resint or float

Longitude resolution in degrees (default=1)

alt_resint or float

Altitude resolution in km (default=10)

alt_minint or float

Altitude minimum in km (default=0)

alt_maxint or float

Altitude maximum in km (default=700)

ccir_or_ursiint

If 0 use CCIR coefficients, if 1 use URSI coefficients

Returns:
alonarray-like

1D longitude grid

alatarray-like

1D latitude grid

alon_2darray-like

2D longitude grid

alat_2darray-like

2D latitude grid

aaltarray-like

Altitude grid

ahrarray-like

UT grid

f2array-like

F2 peak

f1array-like

F1 peak

epeakarray-like

E peak

es_peakarray-like

Sporadic E (Es) peak

sunarray-like

Solar zenith angle in degrees

magarray-like

Magnetic inclination in degrees

edens_profarray-like

Electron density profile in per cubic m

See also

create_reg_grid
PyIRI.main_library.run_seas_iri_reg_grid(year, month, hr_res=1, lat_res=1, lon_res=1, alt_res=10, alt_min=0, alt_max=700, ccir_or_ursi=0)[source]

Run IRI for monthly mean parameters on a regular grid.

Parameters:
yearint

Four digit year in C.E.

monthint

Integer month (range 1-12)

f107int or float

F10.7 index for the given day

hr_resint or float

Time resolution in hours (default=1)

lat_resint or float

Latitude resolution in degrees (default=1)

lon_resint or float

Longitude resolution in degrees (default=1)

alt_resint or float

Altitude resolution in km (default=10)

alt_minint or float

Altitude minimum in km (default=0)

alt_maxint or float

Altitude maximum in km (default=700)

ccir_or_ursiint

If 0 use CCIR coefficients, if 1 use URSI coefficients

Returns:
alonarray-like

1D longitude grid

alatarray-like

1D latitude grid

alon_2darray-like

2D longitude grid

alat_2darray-like

2D latitude grid

aaltarray-like

Altitude grid

ahrarray-like

UT grid

f2array-like

F2 peak

f1array-like

F1 peak

epeakarray-like

E peak

es_peakarray-like

Sporadic E (Es) peak

sunarray-like

Solar zenith angle in degrees

magarray-like

Magnetic inclination in degrees

edens_profarray-like

Electron density profile in per cubic m

See also

create_reg_grid
PyIRI.main_library.set_alt_grid(dalt)[source]

Set an altitude array with given vertical resolution.

Parameters:
daltfloat

Vertical step in km.

Returns:
aaltarray-like

Altitude array in km.

Notes

This function makes altitude array from 90 to 1000 km for given resolution.

PyIRI.main_library.set_diurnal_functions(nj, time_array)[source]

Calculate diurnal Fourier function components.

Parameters:
njarray-like

The highest order of diurnal variation.

time_arrayarray-like

Array of UTs in hours.

Returns:
Darray-like

Diurnal functions.

Notes

This function sets the combination of sin and cos functions that define the diurnal distribution of the parameters and that can be further multiplied by the coefficients U_jk (from CCIR, URSI, and Es maps). The desired equation can be found in the Technical Note Advances in Ionospheric Mapping by Numerical Methods, Jones & Graham 1966. Equation (c) page 38.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Jones, W. B., Graham, R. P., & Leftin, M. (1966). Advances in ionospheric mapping 476 by numerical methods.

PyIRI.main_library.set_geo_grid(dlon, dlat)[source]

Set geographical grid for given horizontal resolution.

Parameters:
dlonfloat

Longitudinal step size in degrees.

dlatfloat

Latitudinal step size in degrees.

Returns:
alonarray-like

Flattened coordinates of longitudes in degrees.

alatarray-like

Flattened coordinates of latitudes in degrees.

alon_2darray-like

Reshaped 2-D array of longitudes in degrees.

alat_2darray-like

Reshaped 2-D array of latitudes in degrees.

Notes

This function makes global grid arrays for given resolution.

PyIRI.main_library.set_gl_G(alon, alat, modip)[source]

Calculate global functions.

Parameters:
alonarray-like

Flattened array of geographic longitudes in degrees.

alatarray-like

Flattened array of geographic latitudes in degrees.

modiparray-like

Modified dip angle in degrees.

Returns:
G_fof2array-like

Global functions for F2 region.

G_M3000array-like

Global functions for M3000 propagation parameter.

G_Es_medianarray-like

Global functions for Es region.

Notes

This function sets Geographic Coordinate Functions G_k(position) page # 18 of Jones & Graham 1965 for F0F2, M3000, and Es coefficients

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Jones, W. B., & Gallet, R. M. (1965). Representation of diurnal and geographic variations of ionospheric data by numerical methods, control of instability, ITU Telecommunication Journal , 32 (1), 18–28.

PyIRI.main_library.set_global_functions(Q, nk, alon, alat, modip)[source]

Set global functions.

Parameters:
Qarray-like

Vector of highest order of sin(x).

nkarray-like

Highest order of geographic extension, or how many functions are there (e.g., there are 76 functions in Table 3 on page 18 of Jones & Graham 1966).

alonarray-like

Flattened array of geographic longitudes in degrees.

alatarray-like

Flattened array of geographic latitudes in degrees.

modiparray-like

Modified dip angle in degrees.

Returns:
Gkarray-like

Global functions

Notes

This function sets Geographic Coordinate Functions G_k(position) page # 18 of Jones & Graham 1965

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Jones, W. B., Graham, R. P., & Leftin, M. (1966). Advances in ionospheric mapping 476 by numerical methods.

PyIRI.main_library.set_temporal_array(dUT)[source]

Set a time array with given time step.

Parameters:
dUTfloat

Time step in hours.

Returns:
aUTarray-like

Universal time array in hours.

ahourarray-like

int array of hours.

aminutearray-like

int array of minutes.

asecondarray-like

int array of seconds.

atime_frame_stringsarray-like

String array of time stamps HHMM.

Notes

This function converts ionospheric frequency to plasma density.

PyIRI.main_library.solar_interpolate(F_min, F_max, F107)[source]

Interpolate given array to provided F10.7 level.

Parameters:
F_minarray-like

Any given array of parameters that corresponds to solar min.

F_maxarray-like

Any given array of parameters that corresponds to solar max.

F107float

Given solar flux index in SFU.

Returns:
Farray-like

Parameters interpolated to the given F10.7.

Notes

This function interpolates it between to a given F10.7. The reference points are set in terms of IG12 coefficients of 0 and 100. The F10.7 is first converted to IG12 and then the interpolation is occurred.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Bilitza et al. (2022), The International Reference Ionosphere model: A review and description of an ionospheric benchmark, Reviews of Geophysics, 60.

PyIRI.main_library.solar_interpolate_R12(F_min, F_max, R12)[source]

Interpolate given array to provided R12 level.

Parameters:
F_minarray-like

Any given array of parameters that corresponds to solar min.

F_maxarray-like

Any given array of parameters that corresponds to solar max.

R12float

Given R12 index (12-month running mean of sunspot number).

Returns:
Farray-like

Parameters interpolated to the given R12.

Notes

This function interpolates the given F_min and F_max parameters (corresponding to solar min and solar max) to the given R12 index. The R12 reference points corresponding to solar min and max are R12=10 and 180 as specified by Leftin, 1968.

References

Leftin, M., Ostrow, S. M., and Preston, C. (1968), Numerical Maps of foEs for Solar Cycle Minimum and Maximum, ESSA Tech Report ERL 73-ITS63, US GPO, Washington, DC.

PyIRI.main_library.solar_interpolation_of_dictionary(F, F107, use_R12=False)[source]

Interpolate given dictionary to provided F10.7.

Parameters:
Fdict

Dictionary of parameters with 2 levels of solar activity specified as 1st dimension.

F107float

Interpolate to this particular level of F10.7.

use_R12bool

Convert F10.7 to R12 and use R12 to perform the interpolation (default = False)

Returns:
F_newdict

Parameters interpolated to the given F10.7.

Notes

This function looks at each key in the dictionary and interpolates it between solar min and solar max to the given F10.7 value.

By default, the reference points are set in terms of IG12 coefficients of 0 and 100. The F10.7 is first converted to IG12 and then the interpolation is occurred.

If use_R12 is set to ‘True’, F10.7 is converted to a corresponding R12 index and this is used to interpolate the provided dictionary. The R12 reference points corresponding to solar min and max are R12=10 and 180 as specified by Leftin, 1968. (This is required for foEs interpolation)

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Bilitza et al. (2022), The International Reference Ionosphere model: A review and description of an ionospheric benchmark, Reviews of Geophysics, 60.

Leftin, M., Ostrow, S. M., and Preston, C. (1968), Numerical Maps of foEs for Solar Cycle Minimum and Maximum, ESSA Tech Report ERL 73-ITS63, US GPO, Washington, DC.

PyIRI.main_library.solar_zenith(lon_sun, lat_sun, lon_observer, lat_observer)[source]

Calculate solar zenith angle from known location of the sun.

Parameters:
lon_sunarray-like

Longitude of the sun in degrees.

lat_sunarray-like

Latitude of the sun in degrees.

lon_observerarray-like

Longitude of the observer in degrees.

lat_observerarray-like

Latitude of the observer in degrees.

Returns:
azenitharray-like

Solar zenith angle.

Raises:
ValueError

If the solar longitude and latitude inputs aren’t the same size

Notes

This function takes lon and lat of the subsolar point and lon and lat of the observer, and calculates solar zenith angle.

PyIRI.main_library.solzen_effective(chi)[source]

Calculate effective solar zenith angle.

Parameters:
chiarray-like

Solar zenith angle (deg).

Returns:
chi_effarray-like

Effective solar zenith angle (deg).

Notes

This function calculates effective solar zenith angle as a function of solar zenith angle and solar zenith angle at day-night transition, according to the Titheridge model. f2 is used during daytime, and f1 during nighttime, and the exponential day-night transition is used to ensure the continuity of foE and its first derivative at solar terminator [Nava et al, 2008 “A new version of the NeQuick ionosphere electron density model”]

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Nava et al. (2008). A new version of the NeQuick ionosphere electron density model. J. Atmos. Sol. Terr. Phys., 70 (15), 490 doi: 10.1016/j.jastp.2008.01.015

PyIRI.main_library.solzen_timearray_grid(year, mth, day, T0, alon, alat)[source]

Calculate solar zenith angle.

Parameters:
yearint

Year.

mthint

Month.

dayint

Day.

T0array-like

Array of UTs in hours.

alonarray-like

Flattened array of longitudes in degrees.

alatarray-like

Flattened array of latitudes in degrees.

Returns:
solzenarray-like

Solar zenith angle.

aslonarray-like

Longitude of subsolar point in degrees.

aslatarray-like

Latitude of subsolar point in degrees.

Raises:
ValueError

If the input arrays are not the same shape

Notes

This function returns solar zenith angle for the given year, month, day, array of UT, and arrays of lon and lat of the grid.

PyIRI.main_library.subsolar_point(juliantime)[source]

Find location of subsolar point.

Parameters:
juliantimefloat

Julian time in days.

Returns:
lonsunfloat

Longitude of the sun in degrees.

latsunfloat

Latitude of the sun in degrees.

Notes

This function returns the lon and lat of subsolar point for a given Juliantime Latitude of subsolar point is same as solar declination angle.

PyIRI.main_library.thickness(foF2, M3000, hmF2, hmE, mth, aIG)[source]

Return thicknesses of ionospheric layers.

Parameters:
foF2array-like

Critical frequency of F2 region in MHz.

M3000array-like

Propagation parameter for F2 region related to hmF2.

hmF2array-like

Height of the F2 layer.

hmEarray-like

Height of the E layer.

mthint

Month of the year.

aIGarray-like

Min and max of IG12 index.

Returns:
B_F2_botarray-like

Thickness of F2 bottom in km.

B_F2_toparray-like

Thickness of F2 top in km.

B_E_botarray-like

Thickness of E bottom in km.

B_E_toparray-like

Thickness of E top in km.

B_Es_botarray-like

Thickness of Es bottom in km.

B_Es_toparray-like

Thickness of Es top in km.

Notes

This function returns thicknesses of ionospheric layers.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.main_library.to_numpy_array(x)[source]

Convert input to a numpy float array.

Parameters:
xarray-like

Anything that numpy.asarray can interpret (e.g.: scalar, list, numpy array).

Returns:
numpy.ndarray

Float array; scalars are promoted to 1D arrays.

This library contains components for IGRF.

References

Alken et al. (2021). International geomagnetic reference field: the thirteenth generation. Earth, Planets and Space, 73(49), doi:10.1186/s40623-020-01288-x.

PyIRI.igrf_library.geo_to_gg(radius, theta)[source]

Compute geodetic colatitude and vertical height above the ellipsoid.

Parameters:
radiusarray-like

Geocentric radius in kilometers.

thetaarray-like

Geocentric colatitude in degrees.

Returns:
heightarray-like

Altitude in kilometers.

betaarray-like

Geodetic colatitude.

Notes

IGRF-13 Alken et al., 2021. Compute geodetic colatitude and vertical height above the ellipsoid from geocentric radius and colatitude. Round-off errors might lead to a failure of the algorithm especially but not exclusively for points close to the geographic poles. Corresponding geodetic coordinates are returned as NaN.

References

Zhu, J., “Conversion of Earth-centered Earth-fixed coordinates to geodetic coordinates”, IEEE Transactions on Aerospace and Electronic Systems}, 1994, vol. 30, num. 3, pp. 957-961.

PyIRI.igrf_library.gg_to_geo(h, gdcolat)[source]

Compute geocentric colatitude and radius from geodetic colat and height.

Parameters:
harray-like

Altitude in kilometers.

gdcolatarray-like

Geodetic colatitude in degrees.

Returns:
radarray-like

Geocentric radius in kilometers.

thcarray-like

Geocentric colatitude in degrees.

sdarray-like

Rotate B_X to gd_lat.

cdarray-like

Rotate B_Z to gd_lat.

Notes

IGRF-13 Alken et al., 2021.

References

Equations (51)-(53) from “The main field” (chapter 4) by Langel, R. A. in: “Geomagnetism”, Volume 1, Jacobs, J. A., Academic Press, 1987.

Malin, S.R.C. and Barraclough, D.R., 1981. An algorithm for synthesizing the geomagnetic field. Computers & Geosciences, 7(4), pp. 401-405.

PyIRI.igrf_library.inc2magnetic_dip_latitude(inc)[source]

Calculate magnetic dip latitude from magnetic inclination.

Parameters:
incarray-like

Magnetic inclination in degrees.

Returns:
magnetic_dip_latitudearray-like

Magnetic dip latitude in degrees.

Notes

This function calculates magnetic dip latitude.

PyIRI.igrf_library.inc2modip(inc, alat)[source]

Calculate modified dip angle from magnetic inclination.

Parameters:
incarray-like

Magnetic inclination in degrees.

alatarray-like

Flattened array of latitudes in degrees.

Returns:
modip_degarray-like

Modified dip angle in degrees.

Notes

This function calculates modified dip angle for a given inclination and geographic latitude.

PyIRI.igrf_library.inclination(coeff_dir, date_decimal, alon, alat, alt=300.0, only_inc=True)[source]

Calculate magnetic inclination using IGRF13.

Parameters:
coeff_dirstr

Where IGRF13 coefficients are located.

date_decimalfloat

Decimal year

alonarray-like

Flattened array of geographic longitudes in degrees.

alatarray-like

Flattened array of geographic latitudes in degrees.

altflt

Altitude in km, default is 300 km.

only_incbool

Only output the inclination, otherwise output the magnetic field information as well (default=True)

Returns:
incarray-like

Magnetic inclination in degrees.

Xarray-like (optional)

North component of the magnetic field in nT.

Yarray-like (optional)

East component of the magnetic field in nT.

Zarray-like (optional)

Vertical component of the magnetic field in nT.

decarray-like (optional)

Declination of the magnetic field in degrees.

hozarray-like (optional)

Horizontal intensity of the magnetic field in nT.

effarray-like (optional)

Total intensity of the magnetic field in nT.

Raises:
IOError

If unable to find IGRF coefficient file

Notes

This code is a slight modification of the IGRF13 pyIGRF release, https://www.ngdc.noaa.gov/IAGA/vmod/igrf.html The reading of the IGRF coefficient file was modified to speded up the process, and the main code was simlified.

PyIRI.igrf_library.legendre_poly(nmax, theta)[source]

Calculate associated Legendre polynomials P(n,m).

Parameters:
nmaxint

Maximum degree up to which expansion, with a minimum value of one.

thetaarray-like

Array containing the colatitude in degrees.

Returns:
Pnmarray-like

Evaluated values and derivatives.

Raises:
IndexError

If nmax is less than 1

Notes

by IGRF-13 Alken et al., 2021 Returns associated Legendre polynomials P(n,m) (Schmidt quasi-normalized), and the derivative :d P(n,m) / d theta evaluated at theta.

References

Langel, R. A. “Chapter four: Main field.” Geomagnetism, edited by JA Jacobs 1 (1987). Zhu, J., “Conversion of Earth-centered Earth-fixed coordinates to geodetic coordinates”, IEEE Transactions on Aerospace and Electronic Systems}, 1994, vol. 30, num. 3, pp. 957-961.

PyIRI.igrf_library.synth_values(coeffs, radius, theta, phi, nmax=None, nmin=1, grid=False)[source]

Compute radial, colatitude and azimuthal field components.

Parameters:
coeffsarray-like

Coefficients of the spherical harmonic expansion. The last dimension is equal to the number of coefficients, N at the grid points.

radiusarray-like

Array containing the radius in km.

thetaarray-like

Array containing the colatitude in degrees.

phiarray-like

Array containing the longitude in degrees.

nmaxint or NoneType

Maximum degree up to which expansion is to be used, if None it will be specified by the coeffs variable. However, smaller values are also valid if specified. (default=None)

nminint

Minimum degree from which expansion is to be used. Note that it will just skip the degrees smaller than nmin, the whole sequence of coefficients 1 through nmax must still be given in coeffs. (default=1)

gridbool

If True, field components are computed on a regular grid. Arrays theta and phi must have one dimension less than the output grid since the grid will be created as their outer product (default=False).

Returns:
B_radiusarray-like

Radial field components in km.

B_thetaarray-like

Colatitude field components in degrees.

B_phiarray-like

Azimuthal field components in degrees.

Raises:
ValueError

If an inappropriate input value is supplied

Notes

by IGRF-13 Alken et al., 2021 Based on chaosmagpy from Clemens Kloss (DTU Space, Copenhagen) Computes radial, colatitude and azimuthal field components from the magnetic potential field in terms of spherical harmonic coefficients. A reduced version of the DTU synth_values chaosmagpy code.

References

Zhu, J., “Conversion of Earth-centered Earth-fixed coordinates to geodetic coordinates”, IEEE Transactions on Aerospace and Electronic Systems}, 1994, vol. 30, num. 3, pp. 957-961.

PyIRI.igrf_library.verify_inclination(inc)[source]

Test the validity of an inclination input.

Parameters:
incint, float, or array-like

Magnetic inclination in degrees.

Returns:
incint, float, or array-like

Magnetic inclination in degrees

Raises:
ValueError

If inclination is not between -90 and 90 degrees

PyIRI.igrf_library.xyz2dhif(x, y, z)[source]

Calculate declination, intensity, inclination of mag field.

Parameters:
xarray-like

North component of the magnetic field in nT.

yarray-like

East component of the magnetic field in nT.

yarray-like

Vertical component of the magnetic field in nT.

Returns:
decarray-like

Declination of the magnetic field in degrees.

hozarray-like

Horizontal intensity of the magnetic field in nT.

incarray-like

Inclination of the magnetic field in degrees.

effarray-like

Total intensity of the magnetic filed in nT.

Notes

by IGRF-13 Alken et al., 2021 Calculate D, H, I and F from (X, Y, Z) Based on code from D. Kerridge, 2019.

This library contains components visualization routines for PyIRI.

PyIRI.plotting.PyIRI_EDP_sample(EDP, aUT, alon, alat, lon_plot, lat_plot, aalt, UT, plot_dir, plot_name='PyIRI_EDP_sample.png')[source]

Plot EDP for one location for solar min and max.

Parameters:
EDParray-like

3-D electron density array output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

lon_plotfloat

Longitude location for EDP.

lat_plotarray-like

Latitude location for EDP.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_EDP_sample.png’)

PyIRI.plotting.PyIRI_EDP_sample_1day(EDP, aUT, alon, alat, lon_plot, lat_plot, aalt, UT, plot_dir, plot_name='PyIRI_EDP_sample_1day.png')[source]

Plot EDP for one location.

Parameters:
EDParray-like

3-D electron density array output of IRI_density_1day.

aUTarray-like

Array of universal times in hours used in PyIRI

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

lon_plotfloat

Longitude location for EDP.

lat_plotarray-like

Latitude location for EDP.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_EDP_sample_1day.png’)

PyIRI.plotting.PyIRI_plot_1location_diurnal_density(EDP, alon, alat, lon_plot, lat_plot, aalt, aUT, plot_dir, plot_name='PyIRI_EDP_diurnal.png')[source]

Plot diurnal parameters for one location.

Parameters:
EDParray-like

3-D electron density array output of IRI_density_1day with shape [N_T, N_V, N_H].

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

lon_plotfloat

Longitude location for EDP.

lat_plotarray-like

Latitude location for EDP.

aaltarray-like

Flattened array of altitudes in km.

aUTarray-like

Array of universal times in hours used in PyIRI.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_foF1_min_max.png’)

PyIRI.plotting.PyIRI_plot_1location_diurnal_par(F2, F1, E, Es, alon, alat, lon_plot, lat_plot, aUT, plot_dir, plot_name='PyIRI_diurnal.png')[source]

Plot diurnal parameters for one location.

Parameters:
F2dict

Dictionary output of IRI_monthly_mean_parameters.

F1dict

Dictionary output of IRI_monthly_mean_parameters.

Edict

Dictionary output of IRI_monthly_mean_parameters.

Esdict

Dictionary output of IRI_monthly_mean_parameters.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

lon_plotfloat

Longitude location for EDP.

lat_plotarray-like

Latitude location for EDP.

aUTarray-like

Array of universal times in hours used in PyIRI.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_foF1_min_max.png’)

PyIRI.plotting.PyIRI_plot_B_F1_bot(F1, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_B_F1_bot.png')[source]

Plot thickness of F1 bottom side.

Parameters:
F1dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_B_F1_bot.png’)

PyIRI.plotting.PyIRI_plot_B_F1_bot_min_max(F1, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_B_F1_bot_min_max.png')[source]

Plot thickness of F1 bottom side for solar min and max.

Parameters:
F1dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_B_F1_bot_min_max.png’)

PyIRI.plotting.PyIRI_plot_B_F2_bot(F2, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_B_F2_bot.png')[source]

Plot thickness of F2 bottom side.

Parameters:
F2dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_B_F2_bot.png’)

PyIRI.plotting.PyIRI_plot_B_F2_bot_min_max(F2, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_B_F2_bot_min_max.png')[source]

Plot thickness of F2 bottom side for solar min and max.

Parameters:
F2dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_B_F2_bot_min_max.png’)

PyIRI.plotting.PyIRI_plot_B_F2_top(F2, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_B_F2_top.png')[source]

Plot thickness of F2 topside.

Parameters:
F2dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_B_F2_top.png’)

PyIRI.plotting.PyIRI_plot_B_F2_top_min_max(F2, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_B_F2_top_min_max.png')[source]

Plot thickness of F2 topside for solar min and max.

Parameters:
F2dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_B_F2_top_min_max.png’)

PyIRI.plotting.PyIRI_plot_M3000(F2, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_M3000.png')[source]

Plot M3000 propagation parameter.

Parameters:
F2dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_M3000.png’)

PyIRI.plotting.PyIRI_plot_M3000_min_max(F2, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_M3000_min_max.png')[source]

Plot M3000 propagation parameter for solar min and max.

Parameters:
F2dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_M3000_min_max.png’)

PyIRI.plotting.PyIRI_plot_NmF1(F1, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_NmF1.png')[source]

Plot NmF1.

Parameters:
F1dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_NmF1_min_max.png’)

PyIRI.plotting.PyIRI_plot_NmF1_min_max(F1, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_NmF1_min_max.png')[source]

Plot NmF1 for solar min and max.

Parameters:
F1dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_NmF1_min_max.png’)

PyIRI.plotting.PyIRI_plot_NmF2(F2, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_NmF2.png')[source]

Plot NmF2.

Parameters:
F2dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_NmF2_min_max.png’)

PyIRI.plotting.PyIRI_plot_NmF2_min_max(F2, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_NmF2_min_max.png')[source]

Plot NmF2 for solar min and max.

Parameters:
F2dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_NmF2_min_max.png’)

PyIRI.plotting.PyIRI_plot_foE(E, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_foE.png')[source]

Plot foE.

Parameters:
Edict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_foE_min_max.png’)

PyIRI.plotting.PyIRI_plot_foE_min_max(E, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_foE_min_max.png')[source]

Plot foE for solar min and max.

Parameters:
Edict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_foE_min_max.png’)

PyIRI.plotting.PyIRI_plot_foEs(Es, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_foEs.png')[source]

Plot foEs.

Parameters:
Esdict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_foEs_min_max.png’)

PyIRI.plotting.PyIRI_plot_foEs_min_max(Es, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_foEs_min_max.png')[source]

Plot foEs for solar min and max.

Parameters:
Esdict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_foEs_min_max.png’)

PyIRI.plotting.PyIRI_plot_foF1(F1, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_foF1.png')[source]

Plot foF1.

Parameters:
F1dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_foF1_min_max.png’)

PyIRI.plotting.PyIRI_plot_foF1_min_max(F1, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_foF1_min_max.png')[source]

Plot foF1 for solar min and max.

Parameters:
F1dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_foF1_min_max.png’)

PyIRI.plotting.PyIRI_plot_foF2(F2, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_foF2.png')[source]

Plot foF2.

Parameters:
F2dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_foF2_min_max.png’)

PyIRI.plotting.PyIRI_plot_foF2_min_max(F2, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_foF2_min_max.png')[source]

Plot foF2 for solar min and max.

Parameters:
F2dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_foF2_min_max.png’)

PyIRI.plotting.PyIRI_plot_hmF1(F1, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_hmF1.png')[source]

Plot hmF1 for solar min and max.

Parameters:
F1dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_hmF1_min_max.png’)

PyIRI.plotting.PyIRI_plot_hmF1_min_max(F1, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_hmF1_min_max.png')[source]

Plot hmF1 for solar min and max.

Parameters:
F1dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_hmF1_min_max.png’)

PyIRI.plotting.PyIRI_plot_hmF2(F2, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_hmF2.png')[source]

Plot hmF2.

Parameters:
F2dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_hmF2.png’)

PyIRI.plotting.PyIRI_plot_hmF2_min_max(F2, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_hmF2_min_max.png')[source]

Plot hmF2 for solar min and max.

Parameters:
F2dict

Dictionary output of IRI_monthly_mean_parameters.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_hmF2_min_max.png’)

PyIRI.plotting.PyIRI_plot_inc(mag, alon, alat, alon_2d, alat_2d, plot_dir, plot_name='PyIRI_inc.png')[source]

Plot magnetic inclination.

Parameters:
magdict

Dictionary output of IRI_monthly_mean_parameters.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_inc.png’)

PyIRI.plotting.PyIRI_plot_mag_dip_lat(mag, alon, alat, alon_2d, alat_2d, plot_dir, plot_name='PyIRI_mag_dip_lat.png')[source]

Plot magnetic dip latitude.

Parameters:
magdict

Dictionary output of IRI_monthly_mean_parameters.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

plot_dirstr

Direction where to save the figure.

plot_namestr

Output name, without directory, for the saved figure (default=’PyIRI_mag_dip_lat.png’)

PyIRI.plotting.PyIRI_plot_modip(mag, alon, alat, alon_2d, alat_2d, plot_dir, plot_name='PyIRI_modip.png')[source]

Plot modified dip angle.

Parameters:
magdict

Dictionary output of IRI_monthly_mean_parameters.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_modip.png’)

PyIRI.plotting.PyIRI_plot_vTEC(TEC, aUT, alon, alat, alon_2d, alat_2d, sun, UT, plot_dir, plot_name='PyIRI_vTEC.png')[source]

Plot vTEC.

Parameters:
TECarray-like

Array output of edp_to_vtec.

aUTarray-like

Array of universal times in hours used in PyIRI.

alonarray-like

Flattened array of geo longitudes in degrees.

alatarray-like

Flattened array of geo latitudes in degrees.

alon_2darray-like

2-D array of geo longitudes in degrees.

alat_2darray-like

2-D array of geo latitudes in degrees.

sundict

Dictionary output of IRI_monthly_mean_parameters.

UTfloat

UT time frame from array aUT to plot.

plot_dirstr

Direction where to save the figure.

plot_namestr

Name for the output figure, without directory (default=’PyIRI_NmF1_min_max.png’)

This library contains Spherical Harmonics and Apex features for PyIRI.

The Apex coordinates were estimated for each year from 1900 to 2025 using apexpy. These results were converted to the spherical harmonic coefficients up to lmax=20 and saved in the .nc file PyIRI.coeff_dir / ‘Apex’ / ‘Apex.nc’.

The ionospheric parameters of F2, F1, E, and Es are computed using spherical harmonics based on the IRI (and PyIRI) model.

References

Emmert et al. (2010), A computationally compact representation of Magnetic-Apex and Quasi-Dipole coordinates with smooth base vectors, J. Geophys. Res., 115(A8), A08322, doi:10.1029/2010JA015326.

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather, ESS Open Archive, September 28, 2023, doi:10.22541/essoar.169592556.61105365/v1.

PyIRI.sh_library.Apex(Lat, Lon, dtime, transform_type)[source]

Convert between GEO, QD, and MLT coordinates.

Convert between geographic (GEO), quasi-dipole (QD), and magnetic local time (MLT) coordinates suing spherical harmoncis.

Parameters:
Latarray-like

Geographic or quasi-dipole latitude grid [deg].

Lonarray-like

Geographic or quasi-dipole longitude [deg] or magnetic local time grid [hour].

dtimedatetime object

UT time specifying the target year for Apex coefficients.

transform_typestr
Transformation type:

‘GEO_2_QD’ — convert from geographic to quasi-dipole ‘QD_2_GEO’ — convert from quasi-dipole to geographic ‘GEO_2_MLT’ — convert from geographic to magnetic local time ‘MLT_2_GEO’ — convert from magnetic local time to geographic ‘QD_2_MLT’ — convert from quasi-dipole to magnetic local time ‘MLT_2_QD’ — convert from magnetic local time to quasi-dipole

Returns:
tuple of numpy.ndarray

(Latitude, Longitude) in the transformed coordinate system, reshaped to match the input grid dimensions.

See also

Apex_geo_qd
PyIRI.sh_library.Apex_geo_qd(Lat, Lon, dtime, transform_type)[source]

Convert between geographic (GEO) and quasi-dipole (QD) coordinates.

Parameters:
Latarray-like

Geographic or quasi-dipole latitude grid [deg].

Lonarray-like

Geographic or quasi-dipole longitude grid [deg].

dtimedatetime.datetime

UT time specifying the target year for Apex coefficients.

transform_typestr
Transformation type:

‘GEO_2_QD’ — convert from geographic to quasi-dipole ‘QD_2_GEO’ — convert from quasi-dipole to geographic

Returns:
tuple of numpy.ndarray

(Latitude, Longitude) in the transformed coordinate system, reshaped to match the input grid dimensions.

Notes

This function converts between geographic (GEO) and quasi-dipole (QD) coordinates using precomputed spherical harmonic (SH) coefficients stored in Apex.nc. Coefficients are 4π-normalized real spherical harmonics. If the requested year is outside the available range, the nearest available year is used and an error is logged. Requires the file: PyIRI.coeff_dir / ‘Apex’ / ‘Apex.nc’

PyIRI.sh_library.EDP_builder_continuous(F2, F1, E, aalt)[source]

Construct vertical EDP with continuous F1 layer.

Parameters:
F2dict

Dictionary of parameters for the F2 layer. Shape (N_T, N_G)

F1dict

Dictionary of parameters for the F1 layer. Shape (N_T, N_G)

Edict

Dictionary of parameters for the E layer. Shape (N_T, N_G)

aaltarray-like

1-D array of altitudes [km]. Shape (N_V,)

Returns:
densitynumpy.ndarray

3-D electron density profiles [m-3]. Shape (N_T, N_V, N_G)

Notes

This function builds the EDP from the provided parameters for all time frames, all vertical and all horizontal points.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.sh_library.IRI_density_1day(year, month, day, aUT, alon, alat, aalt, F107, coeff_dir=None, foF2_coeff='URSI', hmF2_model='SHU2015', coord='GEO')[source]

Output ionospheric parameters for a particular day.

Parameters:
yearint

Year.

monthint

Month of the year.

dayint

Day of the month.

aUTfloat, int, or array-like

UT time in [hour]. Scalar inputs will be converted to a Numpy array. Shape (N_T,)

alonfloat, list, or array-like

Flattened array of longitude (geographic or quasi-dipole) [deg] or magnetic local time [hour]. Scalar inputs will be converted to a Numpy array. Shape (N_G,)

alatfloat, list, or array-like

Flattened array of latitude (geographic or quasi-dipole) [deg]. Scalar inputs will be converted to a Numpy array. Shape (N_G,)

aaltarray-like

Altitude [km]. Scalar inputs will be converted to a Numpy array. Shape (N_V,)

F107int or float

User provided F10.7 solar flux index [SFU].

coeff_dir: str

Directory where the coefficient files are stored. If None, uses the default coefficient files stored in PyIRI.coeff_dir. (default=None)

foF2_coeffstr

Coefficients to use for foF2. Options are ‘URSI’ and ‘CCIR’. (default=’URSI’)

hmF2_modelstr

Model to use for hmF2. Options are ‘SHU2015’, ‘AMTB2013’, and ‘BSE1979’. (default=’SHU2015’)

coordstr

Coordinate system. Options are ‘GEO’ for geographic, ‘QD’ for quasi- dipole, and ‘MLT’ for magnetic local time. (default=’GEO’)

Returns:
F2dict

‘Nm’: Peak density of F2 region [m-3]. ‘fo’ : Critical frequency of F2 region [MHz]. ‘M3000’ : Obliquity factor for a distance of 3,000 km. Defined as refracted in the ionosphere, can be received at a distance of 3,000 km [unitless]. ‘hm’ : Height of the F2 peak [km]. ‘B_top’ : PyIRI top thickness of the F2 region [km]. ‘B_bot’ : PyIRI bottom thickness of the F2 region in [km]. ‘B0’ : IRI ABT-2009 bottom thickness parameter of the F2 region [km]. ‘B1’ : IRI ABT-2009 bottom shape parameter of the F2 region [unitless]. Shape (N_T, N_G)

F1dict

‘Nm’ : Peak density of F1 region [m-3]. ‘fo’ : Critical frequency of F1 region [MHz]. ‘P’ : Probability occurrence of F1 region [unitless]. ‘hm’ : Height of the F1 peak [km]. ‘B_bot’ : Bottom thickness of the F1 region [km]. Shape (N_T, N_G)

Edict

‘Nm’ : Peak density of E region [m-3]. ‘fo’ : Critical frequency of E region [MHz]. ‘hm’ : Height of the E peak [km]. ‘B_top’ : Bottom thickness of the E region [km]. ‘B_bot’ : Bottom thickness of the E region [km]. Shape (N_T, N_G)

sundict

‘lon’ : Subsolar point longitude (geographic or quasi-dipole) [deg] or magnetic local time [hour]. ‘lat’ : Subsolar point latitude (geographic or quasi-dipole) [deg]. Shape (N_T,)

magdict

‘inc’ : Inclination of the magnetic field [deg]. ‘modip’ : Modified dip angle [deg]. ‘mag_dip_lat’ : Magnetic dip latitude [deg]. Shape (N_G,) if coord=’GEO’ or ‘QD’, (N_T, N_G) if coord=’MLT’

EDPnumpy.ndarray

Electron density profiles [m-3]. Shape (N_T, N_V, N_G)

Notes

This function returns ionospheric parameters and 3-D electron density for a given day and provided F10.7 solar flux index.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.sh_library.IRI_monthly_mean_par(year, month, aUT, alon, alat, coeff_dir=None, foF2_coeff='URSI', hmF2_model='SHU2015', coord='GEO')[source]

Output monthly mean ionospheric parameters using spherical harmonics.

Parameters:
yearint

Year.

monthint

Month of the year.

aUTfloat, int, or array-like

UT time [hour]. Scalar inputs will be converted to a Numpy array. Shape (N_T,)

alonfloat, list, or array-like

Flattened array of longitude (geographic or quasi-dipole) [deg] or magnetic local time [hour]. Scalar inputs will be converted to a Numpy array. Shape (N_G,)

alatfloat, list, or array-like

Flattened array of latitude (geographic or quasi-dipole) [deg]. Scalar inputs will be converted to a Numpy array. Shape (N_G,)

coeff_dir: str

Directory where the coefficient files are stored. If None, uses the default coefficient files stored in PyIRI.coeff_dir. (default=None)

foF2_coeffstr

Coefficients to use for foF2. Options are ‘URSI’ and ‘CCIR’. (default=’URSI’)

hmF2_modelstr

Model to use for hmF2. Options are ‘SHU2015’, ‘AMTB2013’, and ‘BSE1979’. (default=’SHU2015’)

coordstr

Coordinate system. Options are ‘GEO’ for geographic, ‘QD’ for quasi- dipole, and ‘MLT’ for magnetic local time. (default=’GEO’)

Returns:
F2dict

‘Nm’: Peak density of F2 region [m-3]. ‘fo’ : Critical frequency of F2 region [MHz]. ‘M3000’ : Obliquity factor for a distance of 3,000 km. Defined as refracted in the ionosphere, can be received at a distance of 3,000 km [unitless]. ‘hm’ : Height of the F2 peak [km]. ‘B_top’ : PyIRI top thickness of the F2 region [km]. ‘B_bot’ : PyIRI bottom thickness of the F2 region in [km]. ‘B0’ : IRI ABT-2009 bottom thickness parameter of the F2 region [km]. ‘B1’ : IRI ABT-2009 bottom shape parameter of the F2 region [unitless]. Shape (N_T, N_G, 2)

F1dict

‘Nm’ : Peak density of F1 region [m-3]. ‘fo’ : Critical frequency of F1 region [MHz]. ‘P’ : Probability occurrence of F1 region [unitless]. ‘hm’ : Height of the F1 peak [km]. ‘B_bot’ : Bottom thickness of the F1 region [km]. Shape (N_T, N_G, 2)

Edict

‘Nm’ : Peak density of E region [m-3]. ‘fo’ : Critical frequency of E region [MHz]. ‘hm’ : Height of the E peak [km]. ‘B_top’ : Bottom thickness of the E region [km]. ‘B_bot’ : Bottom thickness of the E region [km]. Shape (N_T, N_G, 2)

sundict

‘lon’ : Subsolar point longitude (geographic or quasi-dipole) [deg] or magnetic local time [hour]. ‘lat’ : Subsolar point latitude (geographic or quasi-dipole) [deg]. Shape (N_T,)

magdict

‘inc’ : Inclination of the magnetic field [deg]. ‘modip’ : Modified dip angle [deg]. ‘mag_dip_lat’ : Magnetic dip latitude [deg]. Shape (N_G,) if coord=’GEO’ or ‘QD’, (N_T, N_G) if coord=’MLT’

Notes

This function returns monthly mean ionospheric parameters for min and max levels of solar activity, i.e., 12-month running mean of the Global Ionosonde Index IG12 of value 0 and 100.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.sh_library.Probability_F1_with_solzen(solzen)[source]

Calculate probability occurrence of F1 layer.

Parameters:
solzenarray-like

Array of solar zenith angles [deg]. Shape (N_T, N_G, 2)

Returns:
a_Pnumpy.ndarray

Probability occurrence of F1 layer. Shape (N_T, N_G, 2)

Notes

This function calculates the probability of an F1 layer as a numerical map.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Bilitza et al. (2022), The International Reference Ionosphere model: A review and description of an ionospheric benchmark, Reviews of Geophysics, 60.

PyIRI.sh_library.Ramakrishnan_Rawer_function(NmF2, hmF2, B0, B1, h)[source]

Construct density of the Ramakrishnan & Rawer F2 bottomside.

Parameters:
NmF2array-like

F2 region peak electron density [m-3].

hmF2array-like

F2 region peak height [km].

B0array-like

F2 region thickness parameter [km].

B1array-like

F2 region thickness parameter [km].

harray-like

Altitude [km].

Returns:
dennumpy.ndarray

Constructed density [m-3]. Same shape as inputs.

Notes

This function constructs bottomside of F2 layer using Ramakrishnan & Rawer equation (as in IRI). All inputs are supposed to have same size.

References

Bilitza et al. (2022), The International Reference Ionosphere model: A review and description of an ionospheric benchmark, Reviews of Geophysics, 60.

PyIRI.sh_library.create_reg_grid_geo_or_mag(hr_res=1, lat_res=1, lon_res=1, alt_res=10, alt_min=0, alt_max=700, coord='GEO')[source]

Create a regular grid in geographic or magnetic coordinates.

Parameters:
hr_resint or float

Time resolution [hour]. (default=1)

lat_resint or float

Latitude resolution (geographic or quasi-dipole) [deg]. (default=1)

lon_resint or float

Longitude (geographic or quasi-dipole) [deg] or magnetic local time [1/15 hour] resolution. (default=1)

alt_resint or float

Altitude resolution [km]. (default=10)

alt_minint or float

Altitude minimum [km]. (default=0)

alt_maxint or float

Altitude maximum [km]. (default=700)

coordstr

Coordinate system. Options are ‘GEO’ for geographic, ‘QD’ for quasi- dipole, and ‘MLT’ for magnetic local time. (default=’GEO’)

Returns:
alonnumpy.ndarray

Flattened array of longitude (geographic or quasi-dipole) [deg] or magnetic local time [hour]. Shape ((180 / lat_res + 1) * (360 / lon_res + 1),)

alatnumpy.ndarray

Flattened array of latitude (geographic or quasi-dipole) [deg]. Shape ((180 / lat_res + 1) * (360 / lon_res + 1),)

alon_2dnumpy.ndarray

2-D array of longitude (geographic or quasi-dipole) [deg] or magnetic local time [hour]. Shape (180 / lat_res + 1, 360 / lon_res + 1)

alat_2dnumpy.ndarray

2-D array of latitude (geographic or quasi-dipole) [deg]. Shape (180 / lat_res + 1, 360 / lon_res + 1)

aaltnumpy.ndarray

Array of altitudes [km]. Shape (24 / hour_res,)

aUTnumpy.ndarray

Array of UT times [hour]. Shape ((alt_max - alt_min) / alt_res + 1,)

Notes

This function creates a regular global grid in geographic, quasi-dipole, or magnetic local time coordinates using the given spatial resolution lon_res, lat_res; an array of altitudes using the given altitude resolution alt_res for the vertical dimension of electron density profiles; and a time array using the given temporal resolution hr_res.

PyIRI.sh_library.derive_dependent_F1_parameters(P, NmF2, hmF2, B0, B1, hmE, threshold=0.1, thickness_fraction=0.75)[source]

Combine DA with background F1 region.

Parameters:
Parray-like

Probability of F1 to occurre from PyIRI.

NmF2array-like

NmF2 parameter peak density of F2 layer.

hmF2array-like

hmF2 parameter height of the peak of F2.

B0array-like

B0 parameter thickness of F2.

B1array-like

B1 parameter shape of F2.

hmEarray-like

hmE parameter height of E layer.

thresholdflt

Cuts the probability P at this threshhold. Default is 0.1.

thickness_fractionflt

F1 thickness as a fraction of hmF1 - hmE. Default is 0.75.

Returns:
NmF1array_like

NmF1 parameter peak of F1 layer.

foF1array_like

foF1 parameter peak of F1 layer.

hmF1array_like

hmF1 parameter peak height of F1 layer.

B_F1_botarray_like

B_F1_bot thickness of F1 layer.

Notes

This function derives F1 from F2 fields.

PyIRI.sh_library.find_subsolar(dtime, adjust_type='to360')[source]

Calculate the geographic coordinates of the subsolar point.

Parameters:
dtime: datetime object

UT time at which to calculate the coordinates.

Returns:
slon: float

Geographic longitude of the subsolar point [deg].

slat: float

Geographic latitude of the subsolar point [deg].

PyIRI.sh_library.gammaE_dynamic(year, month, aUT, alon, alat, aIG, coord='GEO')[source]

Calculate numerical maps for critical frequency of E region.

Parameters:
yearint

Year.

monthint

Month.

aUTint, float, or array-like

UT time [hour]. Scalar inputs will be converted to a Numpy array. Shape (N_T,)

alonint, float, or array-like

Flattened array of geographic longitudes [deg]. Scalar inputs will be converted to a Numpy array. Shape (N_G,)

alatint, float, or array-like

Flattened array of geographic latitudes [deg]. Scalar inputs will be converted to a Numpy array. Shape (N_G,)

aIGarray-like

Min and max of IG12 index. Shape (2,)

Returns:
gamma_Enumpy.ndarray

Critical frequency of the E region [MHz]. Shape (N_T, N_G, 2)

solzennumpy.ndarray

Solar zenith angle [deg]. Shape (N_T, N_G, 2)

solzen_effnumpy.ndarray

Effective solar zenith angle [deg]. Shape (N_T, N_G, 2)

slonnumpy.ndarray

Subsolar point longitude (geographic or quasi-dipole) [deg] or magnetic local time [hour]. Shape (N_T,)

slatnumpy.ndarray

Subsolar point latitude (geographic or quasi-dipole) [deg]. Shape (N_T,)

Notes

This function calculates numerical maps for foE for two levels of solar activity.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.sh_library.load_Es_coeff_matrix(month, coeff_dir=None)[source]

Load sporadic E layer coefficient matrix from its NetCDF file.

Parameters:
monthint

Month of the year.

coeff_dir: str

Directory where the coefficient files are stored. If None, uses the default coefficient files stored in PyIRI.coeff_dir. (default=None)

Returns:
Cnumpy.ndarray

Coefficient matrix. N_IG=2 is the number of IG12 values stored (IG12=0 and IG12=100), N_FS=9 is the number of real FS coefficients used, and N_SH=8100 is the number of real SH coefficients used. Shape (N_IG, N_FS, N_SH)

PyIRI.sh_library.load_coeff_matrices(month, coeff_dir=None, foF2_coeff='URSI', hmF2_model='SHU2015')[source]

Load ionospheric model coefficient matrices from NetCDF files.

Parameters:
monthint

Month of the year.

coeff_dir: str

Directory where the coefficient files are stored. If None, uses the default coefficient files stored in PyIRI.coeff_dir. (default=None)

foF2_coeffstr

Coefficients to use for foF2. Options are ‘URSI’ and ‘CCIR’. (default=’URSI’)

hmF2_modelstr

Model to use for hmF2. Options are ‘SHU2015’, ‘AMTB2013’, and ‘BSE1979’. (default=’SHU2015’)

Returns:
Cnumpy.ndarray

Coefficient matrix. N_P is the number of parameters (N_P=4 if hmF2_model == ‘BSE1979’ else N_P=5), N_IG=2 is the number of IG12 values stored (IG12=0 and IG12=100), N_FS=9 is the number of real FS coefficients used, and N_SH=900 is the number of real SH coefficients used. Shape (N_P, N_IG, N_FS, N_SH)

PyIRI.sh_library.real_FS_func(aUT, N_FS_c=5)[source]

Generate a real-valued Fourier Series (FS) basis matrix.

Parameters:
aUTint, float, or array-like

User input time values in Universal Time (UT) [0-24) [hour]. Scalar inputs will be converted to a Numpy array. Shape (N_T,)

N_FS_cint

Number of complex Fourier coefficients to use as a truncation level. (default=5) The associated number of real Fourier coefficients is N_FS_r = 2 * N_FS_c - 1.

Returns:
F_FSnumpy.ndarray

Real-valued FS basis matrix. Shape (N_T, N_FS_r)

PyIRI.sh_library.real_SH_func(theta, phi, lmax=29)[source]

Generate real-valued spherical harmonic basis functions.

Generate real-valued spherical harmonic basis functions up to degree lmax (4pi-normalized). Includes Condon-Shortley phase. To use with SH coefficients created with pyshtools, set cspase=-1 and normalization=’4pi’ in pyshtools.

Parameters:
thetaarray-like

User input colatitudes [0-π] [rad]. Shape (N_T, N_G) if grids are converted to magnetic local time from geographic or quasi-dipole coordinates, (N_G,) if grids are originally in magnetic local time coordinates

phiarray-like

User input longitudes [0-2π) [rad]. Shape (N_T, N_G) grids are converted to magnetic local time from geographic or quasi-dipole coordinates, (N_G,) if grids are originally in magnetic local time coordinates coordinates

lmaxint

Maximum spherical harmonic degree (and order). (default=29)

Returns:
F_SHnumpy.ndarray

Real-valued spherical harmonic basis matrix, with N_SH=(lmax+1)**2. Each column corresponds to a pair of coordinates, each row to an SH mode. The SH mode of degree l and order m is stored in row i=l*(l+1)+m. Shape (N_SH, N_T, N_G) if input grids were converted to magnetic local time from geographic or quasi-dipole coordinates, (N_SH, N_G) if grids were originally in magnetic local time coordinates

PyIRI.sh_library.run_iri_reg_grid(year, month, day, F107, coeff_dir=None, hr_res=1, lat_res=1, lon_res=1, alt_res=10, alt_min=0, alt_max=700, foF2_coeff='URSI', hmF2_model='SHU2015', coord='GEO')[source]

Run IRI for a single day on a regular grid.

Parameters:
yearint

Year.

monthint

Month of the year.

dayint

Day of the month.

F107int or float

User provided F10.7 solar flux index in SFU.

coeff_dir: str

Directory where the coefficient files are stored. If None, uses the default coefficient files stored in PyIRI.coeff_dir. (default=None)

hr_resint or float

Time resolution [hour]. (default=1)

lat_resint or float

Latitude resolution (geographic or quasi-dipole) [deg]. (default=1)

lon_resint or float

Longitude (geographic or quasi-dipole) [deg] or magnetic local time [1/15 hour] resolution. (default=1)

alt_resint or float

Altitude resolution [km]. (default=10)

alt_minint or float

Altitude minimum [km]. (default=0)

alt_maxint or float

Altitude maximum [km]. (default=700)

foF2_coeffstr

Coefficients to use for foF2. Options are ‘URSI’ and ‘CCIR’. (default=’URSI’)

hmF2_modelstr

Model to use for hmF2. Options are ‘SHU2015’, ‘AMTB2013’, and ‘BSE1979’. (default=’SHU2015’)

coordstr

Coordinate system. Options are ‘GEO’ for geographic, ‘QD’ for quasi- dipole, and ‘MLT’ for magnetic local time. (default=’GEO’)

Returns:
alonnumpy.ndarray

Flattened array of longitude (geographic or quasi-dipole) [deg] or magnetic local time [hour]. Shape (N_G,)

alatnumpy.ndarray

Flattened array of latitude (geographic or quasi-dipole) [deg]. Shape (N_G,)

alon_2dnumpy.ndarray

2-D array of longitude (geographic or quasi-dipole) [deg] or magnetic local time [hour]. Shape (180 // lat_res + 1, 360 // lon_res + 1)

alat_2dnumpy.ndarray

2-D array of latitude (geographic or quasi-dipole) [deg]. Shape (180 // lat_res + 1, 360 // lon_res + 1)

aaltnumpy.ndarray

Array of altitudes [km]. Shape (N_V,)

aUTnumpy.ndarray

Array of UT times [hour]. Shape (N_T,)

F2dict

‘Nm’: Peak density of F2 region [m-3]. ‘fo’ : Critical frequency of F2 region [MHz]. ‘M3000’ : Obliquity factor for a distance of 3,000 km. Defined as refracted in the ionosphere, can be received at a distance of 3,000 km [unitless]. ‘hm’ : Height of the F2 peak [km]. ‘B_top’ : PyIRI top thickness of the F2 region [km]. ‘B_bot’ : PyIRI bottom thickness of the F2 region in [km]. ‘B0’ : IRI ABT-2009 bottom thickness parameter of the F2 region [km]. ‘B1’ : IRI ABT-2009 bottom shape parameter of the F2 region [unitless]. Shape (N_T, N_G)

F1dict

‘Nm’ : Peak density of F1 region [m-3]. ‘fo’ : Critical frequency of F1 region [MHz]. ‘P’ : Probability occurrence of F1 region [unitless]. ‘hm’ : Height of the F1 peak [km]. ‘B_bot’ : Bottom thickness of the F1 region [km]. Shape (N_T, N_G)

Edict

‘Nm’ : Peak density of E region [m-3]. ‘fo’ : Critical frequency of E region [MHz]. ‘hm’ : Height of the E peak [km]. ‘B_top’ : Bottom thickness of the E region [km]. ‘B_bot’ : Bottom thickness of the E region [km]. Shape (N_T, N_G)

sundict

‘lon’ : Longitude of subsolar point [deg]. ‘lat’ : Latitude of subsolar point [deg]. Shape (N_T,)

magdict

‘inc’ : Inclination of the magnetic field [deg]. ‘modip’ : Modified dip angle [deg]. ‘mag_dip_lat’ : Magnetic dip latitude [deg]. Shape (N_G,) if coord=’GEO’ or ‘QD’, (N_T, N_G) if coord=’MLT’

EDPnumpy.ndarray

Electron density profiles [m-3]. Shape (N_T, N_V, N_G)

PyIRI.sh_library.run_seas_iri_reg_grid(year, month, coeff_dir=None, hr_res=1, lat_res=1, lon_res=1, alt_res=10, alt_min=0, alt_max=700, foF2_coeff='URSI', hmF2_model='SHU2015', coord='GEO')[source]

Run IRI for monthly mean parameters on a regular grid.

Parameters:
yearint

Year.

monthint

Month of the year.

coeff_dir: str

Directory where the coefficient files are stored. If None, uses the default coefficient files stored in PyIRI.coeff_dir. (default=None)

hr_resint or float

Time resolution [hour]. (default=1)

lat_resint or float

Latitude resolution (geographic or quasi-dipole) [deg]. (default=1)

lon_resint or float

Longitude (geographic or quasi-dipole) [deg] or magnetic local time [1/15 hour] resolution. (default=1)

alt_resint or float

Altitude resolution [km]. (default=10)

alt_minint or float

Altitude minimum [km]. (default=0)

alt_maxint or float

Altitude maximum [km]. (default=700)

foF2_coeffstr

Coefficients to use for foF2. Options are ‘URSI’ and ‘CCIR’. (default=’URSI’)

hmF2_modelstr

Model to use for hmF2. Options are ‘SHU2015’, ‘AMTB2013’, and ‘BSE1979’. (default=’SHU2015’)

coordstr

Coordinate system. Options are ‘GEO’ for geographic, ‘QD’ for quasi- dipole, and ‘MLT’ for magnetic local time. (default=’GEO’)

Returns:
alonnumpy.ndarray

Flattened array of longitude (geographic or quasi-dipole) [deg] or magnetic local time [hour]. Shape ((180 / lat_res + 1) * (360 / lon_res + 1),)

alatnumpy.ndarray

Flattened array of latitude (geographic or quasi-dipole) [deg]. Shape ((180 / lat_res + 1) * (360 / lon_res + 1),)

alon_2dnumpy.ndarray

2-D array of longitude (geographic or quasi-dipole) [deg] or magnetic local time [hour]. Shape (180 / lat_res + 1, 360 / lon_res + 1)

alat_2dnumpy.ndarray

2-D array of latitude (geographic or quasi-dipole) [deg]. Shape (180 / lat_res + 1, 360 / lon_res + 1)

aaltnumpy.ndarray

Array of altitudes [km]. Shape (24 / hour_res,)

aUTnumpy.ndarray

Array of UT times [hour]. Shape ((alt_max - alt_min) / alt_res + 1,)

F2dict

‘Nm’: Peak density of F2 region [m-3]. ‘fo’ : Critical frequency of F2 region [MHz]. ‘M3000’ : Obliquity factor for a distance of 3,000 km. Defined as refracted in the ionosphere, can be received at a distance of 3,000 km [unitless]. ‘hm’ : Height of the F2 peak [km]. ‘B_top’ : PyIRI top thickness of the F2 region [km]. ‘B_bot’ : PyIRI bottom thickness of the F2 region in [km]. ‘B0’ : IRI ABT-2009 bottom thickness parameter of the F2 region [km]. ‘B1’ : IRI ABT-2009 bottom shape parameter of the F2 region [unitless]. Shape (N_T, N_G, 2)

F1dict

‘Nm’ : Peak density of F1 region [m-3]. ‘fo’ : Critical frequency of F1 region [MHz]. ‘P’ : Probability occurrence of F1 region [unitless]. ‘hm’ : Height of the F1 peak [km]. ‘B_bot’ : Bottom thickness of the F1 region [km]. Shape (N_T, N_G, 2)

Edict

‘Nm’ : Peak density of E region [m-3]. ‘fo’ : Critical frequency of E region [MHz]. ‘hm’ : Height of the E peak [km]. ‘B_top’ : Bottom thickness of the E region [km]. ‘B_bot’ : Bottom thickness of the E region [km]. Shape (N_T, N_G, 2)

sundict

‘lon’ : Longitude of subsolar point [deg]. ‘lat’ : Latitude of subsolar point [deg]. Shape (N_T)

magdict

‘inc’ : Inclination of the magnetic field [deg]. ‘modip’ : Modified dip angle [deg]. ‘mag_dip_lat’ : Magnetic dip latitude [deg]. Shape (N_G) if coord=’GEO’ or ‘QD’, (N_T, N_G) if coord=’MLT’

PyIRI.sh_library.sporadic_E_1day(year, month, day, aUT, alon, alat, F107, coeff_dir=None, coord='GEO')[source]

Output sporadic E layer parameters for a particular day.

Parameters:
yearint

Year.

monthint

Month of the year.

dayint

Day of the month.

aUTfloat, int, or array-like of float or int

UT time [hour]. Scalar inputs will be converted to a Numpy array. Shape (N_T,)

alonfloat, list, or array-like

Flattened array of longitude (geographic or quasi-dipole) [deg] or magnetic local time [hour]. Scalar inputs will be converted to a Numpy array. Shape (N_G,)

alatfloat, list, or array-like

Flattened array of latitude (geographic or quasi-dipole) [deg]. Scalar inputs will be converted to a Numpy array. Shape (N_G,)

F107int or float

User provided F10.7 solar flux index [SFU].

coeff_dir: str

Directory where the coefficient files are stored. If None, uses the default coefficient files stored in PyIRI.coeff_dir. (default=None)

coordstr

Coordinate system. Options are ‘GEO’ for geographic, ‘QD’ for quasi- dipole, and ‘MLT’ for magnetic local time. (default=’GEO’)

Returns:
Esdict

‘Nm’ : Peak density of Es region [m-3]. ‘fo’ : Critical frequency of Es region [MHz]. ‘hm’ : Height of the Es peak [km]. ‘B_top’ : Bottom thickness of the Es region [km]. ‘B_bot’ : Bottom thickness of the Es region [km]. Shape (N_T, N_G)

Notes

This function returns ionospheric parameters of the sporadic E layer for a given day and solar activity input.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.sh_library.sporadic_E_monthly_mean(year, month, aUT, alon, alat, coeff_dir=None, coord='GEO')[source]

Output monthly mean sporadic E layer using spherical harmonics.

Parameters:
yearint

Year.

monthint

Month of the year.

aUTfloat, int, or array-like of float or int

UT time [hour]. Scalar inputs will be converted to a Numpy array. Shape (N_T,)

alonfloat, list, or array-like

Flattened array of longitude (geographic or quasi-dipole) [deg] or magnetic local time [hour]. Scalar inputs will be converted to a Numpy array. Shape (N_G,)

alatfloat, list, or array-like

Flattened array of latitude (geographic or quasi-dipole) [deg]. Scalar inputs will be converted to a Numpy array. Shape (N_G,)

coeff_dir: str

Directory where the coefficient files are stored. If None, uses the default coefficient files stored in PyIRI.coeff_dir. (default=None)

coordstr

Coordinate system. Options are ‘GEO’ for geographic, ‘QD’ for quasi- dipole, and ‘MLT’ for magnetic local time. (default=’GEO’)

Returns:
Esdict

‘Nm’ : Peak density of Es region [m-3]. ‘fo’ : Critical frequency of Es region [MHz]. ‘hm’ : Height of the Es peak [km]. ‘B_top’ : Bottom thickness of the Es region [km]. ‘B_bot’ : Bottom thickness of the Es region [km]. Shape (N_T, N_G, 2)

Notes

This function returns monthly mean ionospheric parameters for min and max levels of solar activity, i.e., 12-month running mean of the Global Ionosonde Index IG12 of value 0 and 100.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

This library contains components for PyIRI software.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather, ESS Open Archive, September 28, 2023, doi:10.22541/essoar.169592556.61105365/v1.

Bilitza et al. (2022), The International Reference Ionosphere model: A review and description of an ionospheric benchmark, Reviews of Geophysics, 60.

Nava et al. (2008). A new version of the NeQuick ionosphere electron density model. J. Atmos. Sol. Terr. Phys., 70 (15), doi:10.1016/j.jastp.2008.01.015.

Jones, W. B., Graham, R. P., & Leftin, M. (1966). Advances in ionospheric mapping by numerical methods.

PyIRI.edp_update.EDP_builder(x, aalt)[source]

Construct vertical EDP.

Parameters:
xarray-like

Array where 1st dimention indicates the parameter (total 11 parameters), second dimension is time, and third is horizontal grid [11, N_T, N_G].

aaltarray-like

1-D array of altitudes [N_V] in km.

Returns:
density_outarray-like

3-D electron density [N_T, N_V, N_G] in m-3.

Notes

This function builds the EDP from the provided parameters for all time frames, all vertical and all horizontal points.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.edp_update.IRI_density_1day(year, mth, day, aUT, alon, alat, aalt, F107, coeff_dir, ccir_or_ursi=0)[source]

Output ionospheric parameters for a particular day.

Parameters:
yearint

Year.

mthint

Month of year.

dayint

Day of month.

aUTarray-like

Array of universal time (UT) in hours. Must be Numpy array of any size [N_T].

alonarray-like

Flattened array of geographic longitudes in degrees. Must be Numpy array of any size [N_G].

alatarray-like

Flattened array of geographic latitudes in degrees. Must be Numpy array of any size [N_G].

aaltarray-like

Array of altitudes in km. Must be Numpy array of any size [N_V].

F107float

User provided F10.7 solar flux index in SFU.

coeff_dirstr

Place where coefficients are located.

ccir_or_ursiint

If 0 is given CCIR will be used for F2 critical frequency. If 1 then URSI coefficients. (default=0)

Returns:
F2dict

‘Nm’ is peak density of F2 region in m-3. ‘fo’ is critical frequency of F2 region in MHz. ‘M3000’ is the obliquity factor for a distance of 3,000 km. Defined as refracted in the ionosphere, can be received at a distance of 3,000 km, unitless. ‘hm’ is height of the F2 peak in km. ‘B_topi is top thickness of the F2 region in km. ‘B_bot’ is bottom thickness of the F2 region in km. Shape [N_T, N_G, 2].

F1dict

‘Nm’ is peak density of F1 region in m-3. ‘fo’ is critical frequency of F1 region in MHz. ‘P’ is the probability occurrence of F1 region, unitless. ‘hm’ is height of the F1 peak in km. ‘B_bot’ is bottom thickness of the F1 region in km. Shape [N_T, N_G, 2].

Edict

‘Nm’ is peak density of E region in m-3. ‘fo’ is critical frequency of E region in MHz. ‘hm’ is height of the E peak in km. ‘B_top’ is bottom thickness of the E region in km. ‘B_bot’ is bottom thickness of the E region in km. Shape [N_T, N_G, 2].

Esdict

‘Nm’ is peak density of Es region in m-3. ‘fo’ is critical frequency of Es region in MHz. ‘hm’ is height of the Es peak in km. ‘B_top’ is bottom thickness of the Es region in km. ‘B_bot’ is bottom thickness of the Es region in km. Shape [N_T, N_G, 2].

sundict

‘lon’ is longitude of subsolar point in degrees. ‘lat’ is latitude of subsolar point in degrees. Shape [N_G].

magdict

‘inc’ is inclination of the magnetic field in degrees. ‘modip’ is modified dip angle in degrees. ‘mag_dip_lat’ is magnetic dip latitude in degrees. Shape [N_G].

EDParray-like

Electron density profiles in m-3 with shape [N_T, N_V, N_G]

Notes

This function returns ionospheric parameters and 3-D electron density for a given day and provided F10.7 solar flux index.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.edp_update.IRI_monthly_mean_par(year, mth, aUT, alon, alat, coeff_dir, ccir_or_ursi=0)[source]

Output monthly mean ionospheric parameters using new EDP construction.

Parameters:
yearint

Year.

mthint

Month of year.

aUTarray-like

Array of universal time (UT) in hours. Must be Numpy array of any size [N_T].

alonarray-like

Flattened array of geographic longitudes in degrees. Must be Numpy array of any size [N_G].

alatarray-like

Flattened array of geographic latitudes in degrees. Must be Numpy array of any size [N_G].

coeff_dirstr

Place where coefficients are.

ccir_or_ursiint

If 0 is given CCIR will be used for F2 critical frequency, if 1 then URSI. (default=0)

Returns:
F2dict

‘Nm’ is peak density of F2 region in m-3. ‘fo’ is critical frequency of F2 region in MHz. ‘M3000’ is the obliquity factor for a distance of 3,000 km. Defined as refracted in the ionosphere, can be received at a distance of 3,000 km, unitless. ‘hm’ is height of the F2 peak in km. ‘B_topi is top thickness of the F2 region in km. ‘B_bot’ is bottom thickness of the F2 region in km. Shape [N_T, N_G, 2].

F1dict

‘Nm’ is peak density of F1 region in m-3. ‘fo’ is critical frequency of F1 region in MHz. ‘P’ is the probability occurrence of F1 region, unitless. ‘hm’ is height of the F1 peak in km. ‘B_bot’ is bottom thickness of the F1 region in km. Shape [N_T, N_G, 2].

Edict

‘Nm’ is peak density of E region in m-3. ‘fo’ is critical frequency of E region in MHz. ‘hm’ is height of the E peak in km. ‘B_top’ is bottom thickness of the E region in km. ‘B_bot’ is bottom thickness of the E region in km. Shape [N_T, N_G, 2].

Esdict

‘Nm’ is peak density of Es region in m-3. ‘fo’ is critical frequency of Es region in MHz. ‘hm’ is height of the Es peak in km. ‘B_top’ is bottom thickness of the Es region in km. ‘B_bot’ is bottom thickness of the Es region in km. Shape [N_T, N_G, 2].

sundict

‘lon’ is longitude of subsolar point in degrees. ‘lat’ is latitude of subsolar point in degrees. Shape [N_G]

magdict

‘inc’ is inclination of the magnetic field in degrees. ‘modip’ is modified dip angle in degrees. ‘mag_dip_lat’ is magnetic dip latitude in degrees. Shape [N_G]

Notes

This function returns monthly mean ionospheric parameters for min and max levels of solar activity that correspond to the Ionosonde Index IG12 of 0 and 100.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.edp_update.Probability_F1(year, mth, utime, alon, alat)[source]

Calculate probability occurrence of F1 layer.

Parameters:
yearint

Year.

mthint

Month.

timearray-like

Array of UTs in hours.

alonarray-like

Flattened array of longitudes in degrees.

alatarray-like

Flattened array of latitudes in degrees.

Returns:
a_Parray-like

Probability occurrence of F1 layer.

Notes

This function calculates numerical maps probability of F1 layer.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

Bilitza et al. (2022), The International Reference Ionosphere model: A review and description of an ionospheric benchmark, Reviews of Geophysics, 60.

PyIRI.edp_update.derive_dependent_F1_parameters(P, NmF2, hmF2, B_F2_bot, hmE)[source]

Combine DA with background F1 region.

Parameters:
Parray-like

Probability of F1 to occurre from PyIRI.

NmF2array-like

NmF2 parameter - peak density of F2 layer.

hmF2array-like

hmF2 parameter - height of the peak of F2.

B_F2_botarray-like

B_F2_bot parameter - thickness of F2.

hmEarray-like

hmE parameter - height of E layer.

Returns:
NmF1array_like

NmF1 parameter - peak of F1 layer.

foF1array_like

foF1 parameter - critical freqeuncy of F1 layer.

hmF1array_like

hmF1 parameter - peak height of F1 layer.

B_F1_botarray_like

B_F1_bot - thickness of F1 layer.

Notes

This function derives F1 from F2 fields.

PyIRI.edp_update.drop_down(h, hmF2, hmE, drop_fraction=0.1)[source]

Smooth function of altitude with a sharp rise.

Parameters:
hfloat or array-like

Altitude in km.

hmF2float

Altitude where function = 1.

hmEfloat

Altitude where function = 0.

drop_fractionfloat, optional

Fraction of the total distance (hmF2 - hmE) over which the transition occurs.

Returns:
ffloat or array

Function value at altitude h.

PyIRI.edp_update.drop_up(h, hmE, hmF2, drop_fraction=0.2)[source]

Smooth function of altitude with a sharp drop.

Parameters:
hfloat or array-like

Altitude in km.

hmEfloat

Altitude where function = 1.

hmF2float

Altitude where function = 0.

drop_fractionfloat, optional

Fraction of the distance (hmF2 - hmE) over which the drop occurs.

Returns:
ffloat or array

Function value at altitude h.

PyIRI.edp_update.logistic_curve(h, h0, B)[source]

Logistic function centered at h0 with width parameter B.

Parameters:
hfloat or array-like

Input value(s), e.g., altitude in km.

h0float

Center point of the logistic curve (where it equals 0.5).

Bfloat

Width parameter controlling the steepness of the transition.

Returns:
ffloat or array

Logistic function value(s) in the range (0, 1).

PyIRI.edp_update.reconstruct_density_from_parameters(F2, F1, E, alt)[source]

Construct vertical EDP for 2 levels of solar activity.

Parameters:
F2dict

Dictionary of parameters for F2 layer.

F1dict

Dictionary of parameters for F1 layer.

Edict

Dictionary of parameters for E layer.

altarray-like

1-D array of altitudes [N_V] in km.

Returns:
x_outarray-like

Electron density for two levels of solar activity [2, N_T, N_V, N_G] in m-3.

Notes

This function calculates 3-D density from given dictionaries of the parameters for 2 levels of solar activity.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.edp_update.reconstruct_density_from_parameters_1level(F2, F1, E, alt)[source]

Construct vertical EDP for 1 level of solar activity.

Parameters:
F2dict

Dictionary of parameters for F2 layer.

F1dict

Dictionary of parameters for F1 layer.

Edict

Dictionary of parameters for E layer.

altarray-like

1-D array of altitudes [N_V] in km.

Returns:
x_outarray-like

Electron density for two levels of solar activity [N_T, N_V, N_G] in m-3.

Notes

This function calculates 3-D density from given dictionaries of the parameters for 1 level of solar activity.

References

Forsythe et al. (2023), PyIRI: Whole-Globe Approach to the International Reference Ionosphere Modeling Implemented in Python, Space Weather.

PyIRI.edp_update.run_iri_reg_grid(year, month, day, f107, hr_res=1, lat_res=1, lon_res=1, alt_res=10, alt_min=0, alt_max=700, ccir_or_ursi=0)[source]

Run IRI for a single day on a regular grid.

Parameters:
yearint

Four digit year in C.E.

monthint

Integer month (range 1-12)

dayint

Integer day of month (range 1-31)

f107int or float

F10.7 index for the given day

hr_resint or float

Time resolution in hours (default=1)

lat_resint or float

Latitude resolution in degrees (default=1)

lon_resint or float

Longitude resolution in degrees (default=1)

alt_resint or float

Altitude resolution in km (default=10)

alt_minint or float

Altitude minimum in km (default=0)

alt_maxint or float

Altitude maximum in km (default=700)

ccir_or_ursiint

If 0 use CCIR coefficients, if 1 use URSI coefficients

Returns:
alonarray-like

1D longitude grid

alatarray-like

1D latitude grid

alon_2darray-like

2D longitude grid

alat_2darray-like

2D latitude grid

aaltarray-like

Altitude grid

ahrarray-like

UT grid

f2array-like

F2 peak

f1array-like

F1 peak

epeakarray-like

E peak

es_peakarray-like

Sporadic E (Es) peak

sunarray-like

Solar zenith angle in degrees

magarray-like

Magnetic inclination in degrees

edens_profarray-like

Electron density profile in per cubic m

See also

create_reg_grid
PyIRI.edp_update.run_seas_iri_reg_grid(year, month, hr_res=1, lat_res=1, lon_res=1, alt_res=10, alt_min=0, alt_max=700, ccir_or_ursi=0)[source]

Run IRI for monthly mean parameters on a regular grid.

Parameters:
yearint

Four digit year in C.E.

monthint

Integer month (range 1-12)

f107int or float

F10.7 index for the given day

hr_resint or float

Time resolution in hours (default=1)

lat_resint or float

Latitude resolution in degrees (default=1)

lon_resint or float

Longitude resolution in degrees (default=1)

alt_resint or float

Altitude resolution in km (default=10)

alt_minint or float

Altitude minimum in km (default=0)

alt_maxint or float

Altitude maximum in km (default=700)

ccir_or_ursiint

If 0 use CCIR coefficients, if 1 use URSI coefficients

Returns:
alonarray-like

1D longitude grid

alatarray-like

1D latitude grid

alon_2darray-like

2D longitude grid

alat_2darray-like

2D latitude grid

aaltarray-like

Altitude grid

ahrarray-like

UT grid

f2array-like

F2 peak

f1array-like

F1 peak

epeakarray-like

E peak

es_peakarray-like

Sporadic E (Es) peak

sunarray-like

Solar zenith angle in degrees

magarray-like

Magnetic inclination in degrees

edens_profarray-like

Electron density profile in per cubic m

See also

create_reg_grid