[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hdf5 and ncml



On 4/13/2011 11:11 PM, Andrew Schuh wrote:
I hate to cold call, but your name came up regarding a question I have. I use ncWMS and godiva to quickly review mesoscale weather model data (RAMS out of Colorado State). I have used a script called lats4d.gs to convert the original grads files to netcdf files. This script also apparently attached some kind of COARDS metadata to it such that when I dropped the netcdf files into godiva, presto, it automatically worked. So to bypass the conversion of native binary to grads to netcdf, the RAMS folks have implemented a simple hdf5 output routine. 1 timestep for each file and they are pretty large. However, there is little to no metadata at all. My hope was that I could take an ncml script and add the stereographic projection info and coordinate system that I'm using and thus bypass having to make any big adjustments or conversions to the underlying hdf5 files. I found a few web sites and checkers to use to try to figure it out but honestly, its a bit over my head and there don't appear to be enough cookbook examples to keep it easy.

What I've started with is at http://biocycle.atmos.colostate.edu/~aschuh/for_ncWMS/test.ncml .

Do you have any ideas on where I might turn for help or a site that might walk me through exactly what I need to do to set up my ncml file the right way?


Hi Andrew:

Unfortunately, the tutorials are sparse. You can look here for the coordinate transforms:

http://www.unidata.ucar.edu/software/netcdf-java/reference/StandardCoordinateTransforms.html

Really, you need to mimic a netcdf-CF file:

http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.5/cf-conventions.html

The Hdf5 file "the RAMS folks" write is really bad, you should shame them into making a netcdf-4 CF compliant file.

here's the start of something you should be able to continue with, or write a script to automate. each data variable has to have the dimensions changed to shared dimensions (x,y), i just did one. also the 3D variables will need coordinate added also.

<?xml version="1.0" encoding="UTF-8"?>
<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2"; location="A-A-2007-06-25-040000-g1.h5m">

<attribute name="Conventions" value="CF-1.0"/>
<dimension name="x" length="160"/>
<dimension name="y" length="120"/>

<variable name="ACCPA" shape="x y">
<attribute name="grid_mapping" value="polar_stereographic" />
</variable>

<variable name="polar_stereographic" type="char">
<attribute name="grid_mapping_name" value="polar_stereographic" />
<attribute name="straight_vertical_longitude_from_pole" value="0"/>
<attribute name="longitude_of_projection_origin" value="0"/>
<attribute name="scale_factor_at_projection_origin" value="1"/>
</variable>

<variable name="x"  shape="x" type="double">
<attribute name="axis" value="X"/>
<attribute name="units" value="meters"/>
<values start="-400000" increment="5000"/>
</variable>

<variable name="y"  shape="y" type="double">
<attribute name="axis" value="Y"/>
<attribute name="units" value="meters"/>
<values start="-300000" increment="5000"/>
</variable>

</netcdf>

good luck!