[Thread Prev][Thread Next][Index]

Re: How to read netCDF files with ferret



Enils,

hopefully, you have been able to access the data following Jon's
suggested command sequence.

being new to Ferret though, I would suggest checking out at least the
first six chapters of the Ferret User Guide, conveniently provided
online here:
http://ferret.wrc.noaa.gov/Ferret/Documentation/Users_Guide/current/fer_html.htm

and in particular try running the demo scripts until you begin 'thinking
like a ferret'

For example try,
ferret
yes? go multi_variable_demo

or 

yes? go coads_demo 

It helps to have the User Guide open in another window, so you can read
documentation for interesting commands as they appear when you progress
through each demo script.

If you find you do need to download copies of the NetCDF data files
(because you want your own local copies for some reason), the best way
is to remove the DODS-specific part from the URL, and then select the
file of interest from the list.  In your case:
http://stellwagen.er.usgs.gov/data/time_series/hourly/

Hope this helps,
Cyndy Chandler

PS - NetCDF files are binary
full description here:
http://www.unidata.ucar.edu/packages/netcdf/guide_toc.html


Jonathan Callahan wrote:
> 
> Enils,
> 
> You are missing the point of DODS/OPeNDAP access to data.  The files at
> the address you give can be read by Ferret directly.  There is no need
> to download or translate.  The following three Ferret commands give me a
> lovely plot of one particular time series:
> 
> yes? use
> "http://stellwagen.er.usgs.gov/cgi-bin/nph-nc/data/time_series/hourly/1012-A1H.cdf";
> yes? show data
>      currently SET data sets:
>     1>
> http://stellwagen.er.usgs.gov/cgi-bin/nph-nc/data/time_series/hourly/1012-A1H.cdf
> (default)
>  name     title                             I         J         K         L
>  U_1205   Eastward Velocity                1:1       1:1       1:1
> 1:2784
>  V_1206   Northward Velocity               1:1       1:1       1:1
> 1:2784
>  CD_310   CURRENT DIRECTION (T)            1:1       1:1       1:1
> 1:2784
>  CS_300   CURRENT SPEED (CM/S)             1:1       1:1       1:1
> 1:2784
>  UPR_4001 UPPER ROTOR SPEED                1:1       1:1       1:1
> 1:2784
>  STEAD_4009
>           STEADINESS                       1:1       1:1       1:1
> 1:2784
>  T_20     TEMPERATURE (C)                  1:1       1:1       1:1
> 1:2784
> 
> yes? plot t_20
> 
> -- Jon
> 
> Enils Bashi wrote:
> 
> >Hello,
> >
> >I am new to ferret and I am having problems reading netcdf files. I got my
> >files from
> >http://stellwagen.er.usgs.gov/cgi-bin/nph-nc/data/time_series/hourly/ . I
> >got them in an ascii format and saved them as netCDF. Are netcdf files text
> >files or are they binary?
> >Here is what I did:
> >
> >yes? file/variable=v1 1022-A_cdf_ascii.cdf
> >yes? plot v1
> > **TMAP ERR: error 0
> >             Last or next-to-last record read:
> >u_1205.u_1205[u_1205.time=2442673][u_1205.depth=43.5][u_1205.lat=40.8678],
> >7.927
> >
> >             Data set: .\1022-A_cdf_ascii.cdf
> >             Data file: .\1022-A_cdf_ascii.cdf
> >yes?
> >
> >It was not clear to me from the Ferret online documentation how to read a
> >file in. The example there was very vague.
> >I would greatly appreciate any help with this problem. A small sample netcdf
> >file would be helpful, along with the proper commands to open the file and
> >plot some variables.
> >
> >Thank you in advance,
> >
> >Enils Bashi
> >Programmer
> >Veridyne Incorporated
> >Annapolis: (410) 267-9833
> >ebashi@chesapeakebay.net <mailto:'ebashi@chesapeakebay.net'>
> >
> >
> >


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement