A Julia API to access the Madrigal database: an upper atmospheric science database.
Installation: at the Julia REPL, run using Pkg; Pkg.add("Madrigal")
For Python, see the wrapper in python/ (PyPI: madrigal-jl).
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 for a list of kinst and Madrigal kind of data file types metadata for a list of kindat.
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")Madrigal data are arranged into "experiments", which may contain data files, images, documentation, links, etc.
- Madrigal Database Documentation
- madrigalWeb: a (official) python API to access the Madrigal database
- pysatMadrigal allows importing Madrigal data sets into the
pysatecosystem. However, it only supports a few data sets and is not general purpose.