Skip to content

Commit

Permalink
✨ Add file SW-all from Celestrak (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmurphy6895 authored Aug 3, 2023
1 parent eb234e7 commit cb77132
Show file tree
Hide file tree
Showing 14 changed files with 650 additions and 374 deletions.
5 changes: 3 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ The space index sets supported in this version are:

| **Space Index Set** | **File** | **Expiry period** | **Information** |
|:--------------------|:----------------------------------|:-------------------|:------------------------------------------------------------|
| `Fluxtable` | `fluxtable.txt` | 1 day | F10.7 flux data (observed and adjusted). |
| `Celestrak` | `SW-All.csv` | 1 day | F10.7 flux data (observed and adjusted). Kp and Ap an |
| | | | Derived indices. Some Sun Indicies. |
| | | | Historic and Predicted for all. |
| `JB2008` | `DTCFILE.TXT` | 1 day | Exospheric temperature variation caused by the Dst index. |
| | `SOLFSMY.TXT` | 1 day | Indices necessary for the JB2008 atmospheric model. |
| `KpAp` | `Kp_ap_Ap_SN_F107_since_1932.txt` | 1 day | Kp and Ap indices. |

## Installation

Expand Down
5 changes: 2 additions & 3 deletions docs/src/man/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,10 @@ We can now use the **SpaceIndices.jl** system to fetch the information:

```julia
julia> SpaceIndices.init()
[ Info: Downloading the file 'fluxtable.txt' from 'ftp://ftp.seismo.nrcan.gc.ca/spaceweather/solar_flux/daily_flux_values/fluxtable.txt'...
[ Info: Downloading the file 'DTCFILE.TXT' from 'http://sol.spacenvironment.net/jb2008/indices/DTCFILE.TXT'...
[ Info: Downloading the file 'SOLFSMY.TXT' from 'http://sol.spacenvironment.net/jb2008/indices/SOLFSMY.TXT'...
[ Info: Downloading the file 'Kp_ap_Ap_SN_F107_since_1932.txt' from 'https://kp.gfz-potsdam.de/app/files/Kp_ap_Ap_SN_F107_since_1932.txt'...
[ Info: Downloading the file 'SW-All.csv' from 'https://celestrak.org/SpaceData/SW-All.csv'...

julia> space_index(Val(:LeapSeconds), now())
37.0
```
```
40 changes: 25 additions & 15 deletions docs/src/man/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,28 @@ julia> space_index(Val(:F10adj), 2.4590195e6)

The following space indices are currently supported:

| **Space Index Set** | **Index** | **Description** | **Unit** |
|:--------------------|:-----------|:----------------------------------------------------------|:-------------------|
| `Fluxtable` | `F10obs` | Observed F10.7 (10.7-cm solar flux) | 10⁻²² W / (M² ⋅ Hz) |
| | `F10adj` | Adjusted F10.7 (10.7-cm solar flux) | 10⁻²² W / (M² ⋅ Hz) |
| `JB2008` | `DTC` | Exospheric temperature variation caused by the Dst index. | K |
| | `S10` | EUV index (26-34 nm) scaled to F10.7 | 10⁻²² W / (M² ⋅ Hz) |
| | `M10` | MG2 index scaled to F10.7. | 10⁻²² W / (M² ⋅ Hz) |
| | `Y10` | Solar X-ray & Lya index scaled to F10.7 | 10⁻²² W / (M² ⋅ Hz) |
| | `S81a` | 81-day averaged EUV index (26-34 nm) scaled to F10.7 | 10⁻²² W / (M² ⋅ Hz) |
| | `M81a` | 81-day averaged MG2 index scaled to F10.7. | 10⁻²² W / (M² ⋅ Hz) |
| | `Y81a` | 81-day averaged solar X-ray & Lya index scaled to F10.7 | 10⁻²² W / (M² ⋅ Hz) |
| `KpAp` | `Ap` | Ap index computed every three hours. | |
| | `Ap_daily` | Daily Ap index. | |
| | `Kp` | Kp index computed every three hours. | |
| | `Kp_daily` | Daily Kp index. | |
| **Space Index Set** | **Index** | **Description** | **Unit** |
|:--------------------|:-----------------------|:-----------------------------------------------------------------------|:-------------------|
| `Celestrak` | `F10obs` | Observed F10.7 (10.7-cm solar flux) | 10⁻²² W / (M² ⋅ Hz) |
| | `F10adj` | Adjusted F10.7 (10.7-cm solar flux) | 10⁻²² W / (M² ⋅ Hz) |
| | `f107_obs_avg_center81`| Observed F10.7 (10.7-cm solar flux) averaged over 81 days centered | 10⁻²² W / (M² ⋅ Hz) |
| | `f107_obs_avg_last81` | Observed F10.7 (10.7-cm solar flux) averaged over 81 last days | 10⁻²² W / (M² ⋅ Hz) |
| | `f107_adj_avg_center81`| Observed F10.7 (10.7-cm solar flux) averaged over 81 days centered | 10⁻²² W / (M² ⋅ Hz) |
| | `f107_adj_avg_last81` | Observed F10.7 (10.7-cm solar flux) averaged over 81 last days | 10⁻²² W / (M² ⋅ Hz) |
| | `Ap` | Ap index computed every three hours. | |
| | `Ap_daily` | Daily Ap index. | |
| | `Kp` | Kp index computed every three hours. | |
| | `Kp_daily` | Daily Kp index. | |
| | `Cp` | Daily Planetary Character Figure | |
| | `C9` | Daily Magnetic Index on Cp Basis | |
| | `ISN` | International Sunspot Number | |
| | `BSRN` | Bartels Solar Rotation Number | |
| | `ND` | Number of Days into Bartels Solar Rotation Cycle | Days |
| `JB2008` | `DTC` | Exospheric temperature variation caused by the Dst index. | K |
| | `S10` | EUV index (26-34 nm) scaled to F10.7 | 10⁻²² W / (M² ⋅ Hz) |
| | `M10` | MG2 index scaled to F10.7. | 10⁻²² W / (M² ⋅ Hz) |
| | `Y10` | Solar X-ray & Lya index scaled to F10.7 | 10⁻²² W / (M² ⋅ Hz) |
| | `S81a` | 81-day averaged EUV index (26-34 nm) scaled to F10.7 | 10⁻²² W / (M² ⋅ Hz) |
| | `M81a` | 81-day averaged MG2 index scaled to F10.7. | 10⁻²² W / (M² ⋅ Hz) |
| | `Y81a` | 81-day averaged solar X-ray & Lya index scaled to F10.7 | 10⁻²² W / (M² ⋅ Hz) |

6 changes: 3 additions & 3 deletions docs/src/man/initialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If the user does not want to download a set of space indices, they can pass them
keyword `blocklist` to the function `SpaceIndices.init`.

```julia-repl
julia> SpaceIndices.init(; blocklist = [SpaceIndices.Fluxtable])
julia> SpaceIndices.init(; blocklist = [SpaceIndices.Celestrak])
```

If the user wants to initialize only one space index set, they can pass it to the same
Expand All @@ -41,8 +41,8 @@ timestamp.

```jldoctest
julia> SpaceIndices.init()
[ Info: Downloading the file 'fluxtable.txt' from 'ftp://ftp.seismo.nrcan.gc.ca/spaceweather/solar_flux/daily_flux_values/fluxtable.txt'...
[ Info: Downloading the file 'DTCFILE.TXT' from 'http://sol.spacenvironment.net/jb2008/indices/DTCFILE.TXT'...
[ Info: Downloading the file 'SOLFSMY.TXT' from 'http://sol.spacenvironment.net/jb2008/indices/SOLFSMY.TXT'...
[ Info: Downloading the file 'Kp_ap_Ap_SN_F107_since_1932.txt' from 'https://kp.gfz-potsdam.de/app/files/Kp_ap_Ap_SN_F107_since_1932.txt'...
[ Info: Downloading the file 'SW-All.csv' from 'https://celestrak.org/SpaceData/SW-All.csv'...
```
3 changes: 1 addition & 2 deletions docs/src/man/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ First, we need to initialize all the space indices:

```julia
julia> SpaceIndices.init()
[ Info: Downloading the file 'fluxtable.txt' from 'ftp://ftp.seismo.nrcan.gc.ca/spaceweather/solar_flux/daily_flux_values/fluxtable.txt'...
[ Info: Downloading the file 'DTCFILE.TXT' from 'http://sol.spacenvironment.net/jb2008/indices/DTCFILE.TXT'...
[ Info: Downloading the file 'SOLFSMY.TXT' from 'http://sol.spacenvironment.net/jb2008/indices/SOLFSMY.TXT'...
[ Info: Downloading the file 'Kp_ap_Ap_SN_F107_since_1932.txt' from 'https://kp.gfz-potsdam.de/app/files/Kp_ap_Ap_SN_F107_since_1932.txt'...
[ Info: Downloading the file 'SW-All.csv' from 'https://celestrak.org/SpaceData/SW-All.csv'...
```
Afterward, we can obtain the desired space index using:
Expand Down
4 changes: 2 additions & 2 deletions src/SpaceIndices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module SpaceIndices

using Reexport
using Scratch
using DelimitedFiles

@reexport using Dates
@reexport using OptionalData
Expand Down Expand Up @@ -29,8 +30,7 @@ include("./download.jl")
include("./initialize.jl")
include("./interpolations.jl")

include("./space_index_sets/fluxtable.jl")
include("./space_index_sets/jb2008.jl")
include("./space_index_sets/kp_ap.jl")
include("./space_index_sets/celestrak.jl")

end # module SpaceIndices
2 changes: 1 addition & 1 deletion src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ end
@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 optinal data handler for the processed structure.
space files and also creates the optional data handler for the processed structure.
"""
macro register(T)
opdata_handler = @data_handler(T)
Expand Down
2 changes: 1 addition & 1 deletion src/initialize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function init(::Type{T}; force_download::Bool = false) where T<:SpaceIndexSet
handler = _SPACE_INDEX_SETS[id] |> last

# Fetch the files, if necessary, and parse it.
filepaths = _fetch_files(T; force_download)
filepaths = _fetch_files(T; force_download=force_download)
obj = parse_files(T, filepaths)
push!(handler, obj)

Expand Down
Loading

0 comments on commit cb77132

Please sign in to comment.