https://github.com/juliaspacephysics/madrigal.jl
A Julia API to access the Madrigal database.
https://github.com/juliaspacephysics/madrigal.jl
julia space-physics
Last synced: 4 months ago
JSON representation
A Julia API to access the Madrigal database.
- Host: GitHub
- URL: https://github.com/juliaspacephysics/madrigal.jl
- Owner: JuliaSpacePhysics
- License: mit
- Created: 2025-06-03T01:21:26.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-18T08:25:42.000Z (12 months ago)
- Last Synced: 2025-06-18T08:26:36.479Z (12 months ago)
- Topics: julia, space-physics
- Language: Julia
- Homepage: https://juliaspacephysics.github.io/Madrigal.jl/
- Size: 230 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Madrigal.jl
[](https://doi.org/10.5281/zenodo.15710129)
[](https://github.com/juliaspacephysics/Madrigal.jl/actions/workflows/CI.yml?query=branch%3Amain)
[](https://codecov.io/gh/juliaspacephysics/Madrigal.jl)
[](https://github.com/JuliaTesting/Aqua.jl)
A Julia API to access the [Madrigal database](https://cedar.openmadrigal.org/): an upper atmospheric science database.
**Installation**: at the Julia REPL, run `using Pkg; Pkg.add("Madrigal")`
**Documentation**: [](https://JuliaSpacePhysics.github.io/Madrigal.jl/dev/)
## Examples
```julia
using Madrigal
using Dates
# Get instruments (fast cached access by default)
insts = get_instruments()
kinst = 30 # "Millstone Hill IS Radar"
kindat = 3408 # "Combined basic parameters file - all antennas and modes"
tstart = Date(1998, 1, 19)
tend = Date(1998, 12, 31)
# Get experiments (cached by default, use source=:web for latest data)
exps = get_experiments(kinst, tstart, tend)
files = get_experiment_files(exps[1])
file = filter(f -> f.kindat == kindat, files)[1]
params = get_experiment_file_parameters(file)
path = download_file(file)
```
You can also query / download files given the instrument id (`kinst`), kind of data file code (`kindat`), and time range `tstart` to `tend`. See [Madrigal instrument metadata](https://cedar.openmadrigal.org/instMetadata) for a list of `kinst` and [Madrigal kind of data file types metadata](https://cedar.openmadrigal.org/kindatMetadata) for a list of `kindat`.
```julia
get_instrument_files(kinst, tstart, tend)
files = get_instrument_files(kinst, kindat, tstart, tend)
download_file.(files)
# or
download_files(kinst, kindat, "1998-01-18", "1998-01-22")
```
## Notes
> Madrigal data are arranged into "experiments", which may contain data files, images, documentation, links, etc.
## References and Elsewhere
- [Madrigal Database Documentation](https://cedar.openmadrigal.org/docs/name/madContents.html)
- [madrigalWeb](https://github.com/MITHaystack/madrigalWeb): a (official) python API to access the Madrigal database
- [pysatMadrigal](https://github.com/pysat/pysatMadrigal) allows importing Madrigal data sets into the `pysat` ecosystem. However, it only supports a few data sets and is not general purpose.