readap 0.1.0

A parser for the OpenDAP DAP2 protocol
Documentation
  • Coverage
  • 0%
    0 out of 113 items documented0 out of 51 items with examples
  • Size
  • Source code size: 135.87 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 7.14 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 24s Average build duration of successful builds.
  • all releases: 17s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • mpiannucci/readap
    2 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mpiannucci

readap

Read OpenDAP binary data with pure rust

Install

with cargo add:

cargo add readap

or Cargo.toml:

[dependencies]
readap = "0.1.0"

Getting Started

Read DAS metadata

let attrs = parse_das_attributes(input).unwrap();

This returns a HashMap containing all of the attributes and their children, within another hashmap

let units: String = attrs["time"]["units"].clone().try_into().unwrap();

Read a DDS dataset

let dataset = DdsDataset::from_bytes(&input).unwrap();

Read a DODS dataset

let dataset = DodsDataset::from_bytes(&input).unwrap();

Then extract the data and coordinates for a given variable

let mwd = if let DataArray::Int32(mwd) = dataset.variable_data("mean_wave_dir").unwrap() {
   	mwd
} else {
    vec![]
};

let coords = dataset.variable_coords("mean_wave_dir").unwrap();
let time_data: Vec<i32> = coords[0].1.try_into().unwrap();

For concrete examples, see the parse tests

What this library is

This library is an OpenDAP binary data and metadata parser. It is not a data downloader. It is a lower level tool to be used in higher level data access applications.

License

MIT - 2025 Matthew Iannucci