Access the Madrigal database, an upper atmospheric science database.
For Python, see the wrapper in python/ (PyPI: madrigal-jl).
using Pkg; Pkg.add("Madrigal")
using Madrigal, Dates
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)
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")An instrument can be named by its mnemonic instead of its kinst: get_instrument_files(:mlh, tstart, tend).
The queries return CSV.File, accessed by column name:
insts[1].kinst, .mnemonic, .name, .latitude, .longitude, .altitude, .category
exps[1].id, .url, .name, .site_id, .start_date, .end_date, .kinst, .pi_name, .pi_email
files[1].name, .id, .kindat, .category, .status, .permission, .mod_date
params[1].mnemonic, .description, .units, .is_measured, .is_error, .categorydownload_file(file, destination = nothing; dir, format = :hdf5, force = false, throw = false) returns the path, or nothing after a warning if the request fails. Without dir, files go to a temporary directory that disappears with the process; set dir to keep them. An existing file at the target path is returned untouched unless force = true. format is :hdf5, :simple (ASCII), or :netCDF4.
Other servers, live (uncached) queries, and configuration options are covered in docs/src/index.md (rendered).
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.