Library
Documentation for SpaceIndices.jl
.
SpaceIndices.SpaceIndexSet
— Typeabstract type SpaceIndexSet
Abstract type for all structures that represent space index sets.
SpaceIndices._round_Kp
— Method_round_Kp(x::Float64)
Celestrak mulitples Kp by 10 and rounds to the nearest integer this puts it back.
SpaceIndices.constant_interpolation
— Methodconstant_interpolation(knots::AbstractVector, values::AbstractVector, x) -> eltype(values)
Perform a constant interpolation at x
of values
evaluated at knots
. The interpolation returns value(knots[k-1])
in which knots[k-1] <= x < knots[k]
.
SpaceIndices.destroy
— Methoddestroy() -> Nothing
Destroy the objects of all space index sets that were initialized.
SpaceIndices.expiry_periods
— Functionexpiry_periods(::Type{T}) where T<:SpaceIndexSet -> Vector{DatePeriod}
Return the expiry periods for the remote files associated with the space index set T
. If a time interval greater than this period has elapsed since the last download, the remote files will be downloaded again.
SpaceIndices.filenames
— Methodfilenames(::Type{T}) where T<:SpaceIndexSet -> Vector{String}
Return the filenames for the remote files associated with the space index set T
. If this function is not defined for T
, the filenames will be obtained based on the URLs.
SpaceIndices.init
— Methodinit(; blocklist::Vector = []) -> Nothing
Initialize all the registered space index sets.
This function will download the remote files associated to the space index sets if they do not exist or if the expiry period has been elapsed. Afterward, it will parse the files and populate the objects to be accessed by the function space_index
.
If the user does not want to initialize some sets, they can pass them in the keyword blocklist
.
SpaceIndices.init
— Methodinit(::Type{T}; kwargs...) where T<:SpaceIndexSet -> Nothing
Initialize the space index set T
.
This function will download the remote files associated with the space index set T
if they do not exist or if their expiry period has been elapsed. Aftward, it will parse the files and populate the object to be accessed by the function space_index
.
Keywords
force_download::Bool
: Iftrue
, the remote files will be downloaded regardless of their timestamps. (Default =false
)filepaths::Union{Nothing, Vector{String}}
: If it isnothing
, the function will download the space index files from the locations specified in theurls
API function. However, the user can pass a vector with the file locations, which will be used instead of downloading the data. In this case, the user must provide all the files in the space index setT
. (Default =nothing
)
SpaceIndices.linear_interpolation
— Methodlinear_interpolation(knots::AbstractVector, values::AbstractVector, x)
Perform a linear interpolation at x
of values
evaluated at knots
.
SpaceIndices.parse_files
— Functionparse_files(::Type{T}, filepaths::Vector{String}) where T<:SpaceIndexSet -> T
Parse the files associated with the space index set T
using the files in filepaths
. It must return an object of type T
with the parsed data.
SpaceIndices.space_index
— Functionspace_index(::Val{:index}, jd::Number; kwargs...) -> Number
space_index(::Val{:index}, date::DateTime; kwargs...) -> Number
Get the space index
for the Julian day jd
or the instant
. The latter must be an object of type DateTime
. kwargs...
can be used to pass additional configuration for the space index.
SpaceIndices.space_index
— Methodspace_index(::Val{:Ap_daily}, jd::Number) -> Int64
Get the daily Ap index for the day at instant
.
SpaceIndices.space_index
— Methodspace_index(::Val{:Ap}, jd::Number) -> NTuple{8, Float64}
Get the Ap index for the day at instant
compute every three hours.
SpaceIndices.space_index
— Methodspace_index(::Val{:BSRN}, jd::Number) -> Int64
Get the BSRN index for the day at instant
SpaceIndices.space_index
— Methodspace_index(::Val{:C9}, jd::Number) -> Float64
Get the C9 index for the day at instant
SpaceIndices.space_index
— Methodspace_index(::Val{:Cp}, jd::Number) -> Float64
Get the Cp index for the day at instant
SpaceIndices.space_index
— Methodspace_index(::Val{:DTC}, date::Number) -> Float64
Get the exospheric temperature variation [K] caused by the Dst index at instant
(UTC).
SpaceIndices.space_index
— Methodspace_index(::Val{:F10adj_avg_center81}, jd::Number) -> Float64
Get the adjusted F10.7 index (10.7-cm solar flux) [10⁻²² W / (M² ⋅ Hz)] averaged over 81 days centered for the instant
(UTC).
SpaceIndices.space_index
— Methodspace_index(::Val{:F10adj_avg_last81}, jd::Number) -> Float64
Get the adjusted F10.7 index (10.7-cm solar flux) [10⁻²² W / (M² ⋅ Hz)] averaged over the last 81 days from the instant
(UTC).
SpaceIndices.space_index
— Methodspace_index(::Val{:F10adj}, jd::Number) -> Float64
Get the adjusted F10.7 index (10.7-cm solar flux) [10⁻²² W / (M² ⋅ Hz)] for the instant
(UTC).
SpaceIndices.space_index
— Methodspace_index(::Val{:F10obs_avg_center81}, jd::Number) -> Float64
Get the observed F10.7 index (10.7-cm solar flux) [10⁻²² W / (M² ⋅ Hz)] averaged over 81 days centered for the instant
(UTC).
SpaceIndices.space_index
— Methodspace_index(::Val{:F10obs_avg_last81}, jd::Number) -> Float64
Get the observed F10.7 index (10.7-cm solar flux) [10⁻²² W / (M² ⋅ Hz)] averaged over the last 81 days from the instant
(UTC).
SpaceIndices.space_index
— Methodspace_index(::Val{:F10obs}, jd::Number) -> Float64
Get the observed F10.7 index (10.7-cm solar flux) [10⁻²² W / (M² ⋅ Hz)] for the instant
(UTC).
SpaceIndices.space_index
— Methodspace_index(::Val{:ISN}, jd::Number) -> Int64
Get the ISN index for the day at instant
SpaceIndices.space_index
— Methodspace_index(::Val{:Kp_daily}, jd::Number) -> Float64
Get the daily Kp index for the day at instant
.
SpaceIndices.space_index
— Methodspace_index(::Val{:Kp}, jd::Number) -> NTuple{8, Float64}
Get the Kp index for the day at instant
compute every three hours.
SpaceIndices.space_index
— Methodget_space_index(::Val{:M10}, date::Number) -> Float64
Get the MG2 index scaled to F10.7 [10⁻²² W / (M² ⋅ Hz)] for the instant
(UTC).
SpaceIndices.space_index
— Methodspace_index(::Val{:M81a}, date::Number) -> Float64
Get the 81-day averaged MG2 index scaled to F10.7 [10⁻²² W / (M² ⋅ Hz)] for the instant
(UTC).
SpaceIndices.space_index
— Methodspace_index(::Val{:ND}, jd::Number) -> Int64
Get the ND index for the day at instant
SpaceIndices.space_index
— Methodspace_index(::Val{:S10}, date::Number) -> Float64
Get the EUV index (26-34 nm) scaled to F10.7 [10⁻²² W / (M² ⋅ Hz)] for the instant
(UTC).
SpaceIndices.space_index
— Methodspace_index(::Val{:S81a}, date::Number) -> Float64
Get the 81-day averaged EUV index (26-34 nm) scaled to F10.7 [10⁻²² W / (M² ⋅ Hz)] for the instant
(UTC).
SpaceIndices.space_index
— Methodspace_index(::Val{:Y10}, date::Number) -> Float64
Get the solar X-ray & Lya index scaled to F10.7 [10⁻²² W / (M² ⋅ Hz)] for the instant
(UTC).
SpaceIndices.space_index
— Methodspace_index(::Val{:Y81a}, date::Number) -> Float64
Get the 81-day averaged solar X-ray & Lya index scaled to F10.7 [10⁻²² W / (M² ⋅ Hz)] for the instant
(UTC).
SpaceIndices.urls
— Functionurls(::Type{T}) where T<:SpaceIndexSet -> Vector{String}
Return the URLs to fetch the remote files associated with the space index set T
.
SpaceIndices.@data_handler
— Macro@data_handler(T)
Return the optional data handler associated with space index set T
. This variable stores an instance of T
if the set was already initialized.
SpaceIndices.@object
— Macro@object(T)
Return the object associated with the space index set T
.
Throws
Error
: If the space indexT
was not initialized.
SpaceIndices.@register
— Macro@register(T)
Register the the space index set T
. This macro push the data into the global vector of space files and also creates the optional data handler for the processed structure.