-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Dsl to replace NcML:
https://github.com/JohnLCaron/devcdm/tree/main/dataset/src/main/kotlin/dev/ucdm/dataset/cdmdsl
Here are examples (one is pasted below), with Ncml on top, Dsl on bottom, for comparison:
https://github.com/JohnLCaron/devcdm/tree/main/dataset/src/test/data/cdml
The dataset module also has a rewrite of the coordinate system builders and an implementation of nccopy and ncdump.
Other modules have a gRpc client/server, start of a grib port to kotlin, a new grid API in Java.
We could consider porting some of this functionality to netchdf or another library built on top. Have to be cautious about getting too ambitious.
<?xml version="1.0" encoding="UTF-8"?>
<nc:netcdf xmlns:nc="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2"
location="nc/[example.nc](http://example.nc/)">
<nc:variable name="ReletiveHumidity" type="int" shape="time lat lon" orgName="rh">
<nc:attribute name="long_name" type="string" value="relative humidity"/>
<nc:attribute name="units" type="string" value="percent"/>
</nc:variable>
<nc:variable name="lat" type="float" shape="lat">
<nc:attribute name="units" type="string" value="degrees_north"/>
<nc:values separator=" ">41.0 40.0 39.0</nc:values>
</nc:variable>
<nc:variable name="lon" type="float" shape="lon">
<nc:attribute name="units" type="string" value="degrees_east"/>
<nc:values separator=" ">-109.0 -107.0 -105.0 -103.0</nc:values>
</nc:variable>
<nc:variable name="time" type="int" shape="time">
<nc:attribute name="units" type="string" value="hours"/>
<nc:values separator=" ">6 18 24 36</nc:values>
</nc:variable>
</nc:netcdf>
Cdml("nc/[example.nc](http://example.nc/)") {
getVariable("rh").rename("ReletiveHumidity") {
addAttribute("long_name").setValue("relatively humidity")
addAttribute("units", "percent")
}
addVariable("lat", ArrayType.FLOAT, "lat").setValues(41.0 40.0 39.0) {
addAttribute("units", "degrees_north")
}
addVariable("lon", ArrayType.FLOAT, "lon").setValues(-109.0 -107.0 -105.0 -103.0) {
addAttribute("units", "degrees_east")
}
addVariable("time", ArrayType.INT, "time").setValues(6 18 24 36) {
addAttribute("units", "hours since 2020/11/11T00:00:01")
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels