extract a variable in netCDF file

540
4
12-20-2012 10:26 AM
GualbertoHernández_Juárez
New Contributor
Hi,

Anyone have a script to extract a variable in NetCDF file?

I hope you can help me.

thanks
Gualberto
Tags (2)
0 Kudos
4 Replies
markdenil
Occasional Contributor III
MakeNetCDFFeatureLayer_m is the key tool. It will convert the netCDF to points.

There are lots of arguments to the tool, making it pretty flexible.

I used it (for a 9.3 geoprocessor) thus:

netCDF = r"c:\thePath\theNetCDFFile"
outLayer = "Xout_Layer"
gp.MakeNetCDFFeatureLayer_md(netCDF, "uvel;vvel",
                                "lon", "lat", outLayer,
                                "lat;lon", "", "", "", "BY_VALUE")

This extracts the lat/long located cell centers as lat/long points with uvel and vvel attributes to a layer.

with arcpy, use python lists instead of semicolon delimited strings for the variables and dimension lists.
0 Kudos
GualbertoHernández_Juárez
New Contributor
Hi Mark,

My netCDF file has forecast variables: wind, rh, SPLV, etc and they all have the time dimension.

I just need the variable dimension PSLV but with time, he knows how to go?

Thank you very much for your reply.
0 Kudos
markdenil
Occasional Contributor III
If you want a seperate feature for each time step, include time as a row dimension.
0 Kudos
GualbertoHernández_Juárez
New Contributor
mdenil,

I did what you said and it worked, but I need to do this for each grid point of my netcdf file is 150 x 200, so are 30,000 points.

Can you suggest any procedure to get them?

Thank you very much for your help!.

Gualberto
0 Kudos