getLatestSpaceData: Retrieves the latest space data

View source: R/auxiliaryFunctions.R

getLatestSpaceDataR Documentation

Retrieves the latest space data

Description

The asteRiskData package provides the data and coefficients required for calculation of forces for hpop and other functions such certain conversions between reference frames. Some of the data tables included in the package are updated periodically with new data. These include Earth orientation parameters, space weather data and solar and geomagnetic storms. In order to perform the calculations dependent on such data for the most recent times, the latest available data must be retrieved.

This function automatically updates the data tables, enabling such calculations for the most recent times.

Usage

getLatestSpaceData(targets="all")

Arguments

targets

Character vector specifying the data that should be updated. It should be a vector containing one or more of the following strings: "all" (to update all data), "EOP" (Earth orientation parameters), "SW" (space weather), "SS" (solar storms) or "GS" (geomagnetic storms). By default, all data are updated.

Value

This function is invoked for its side effect, which is updating the data tables used internally for calculations requiring asteRiskData package, such as those performed by hpop.

References

http://www.celestrak.org/SpaceData/EOP-All.txt https://celestrak.org/SpaceData/SW-All.txt https://sol.spacenvironment.net/jb2008/indices.html

Examples

if(interactive()) {
if(requireNamespace("asteRiskData", quietly = TRUE)) {
# The table of Earth orientation parameters distributed with asteRiskData
# comprises data up to the 21st of March, 2021

asteRiskData::earthPositions[nrow(asteRiskData::earthPositions),]

# The table can be easily updated to include the most recent available data

getLatestSpaceData(targets="all")
asteRiskData::earthPositions[nrow(asteRiskData::earthPositions),]
}
}

asteRisk documentation built on Jan. 14, 2023, 5:07 p.m.