[Thread Prev][Thread Next][Index]

RE: how to create netcdf from ascii files



Hi Ansley,

Yes, each of the ascii files corresponds to a time series for a specific
station. These files are generated from MySQL Relational Databases. Each
table of the MySql Database corresponds to a station. The idea is to create
visual representation for variables like temperature, salinity, ph,
turbidity and other parameters for each station on Chesapeake Bay using
ferret and other netcdf tools. Your idea about concatenating the files
sounds interesting, but the buoys are not sampled at the same time. It would
be valuable to observe each variable based on a spatial pattern.

Enils



Hi,
So, do you have separate files for each location?  Are the locations
already at the locations of the lat/lon grid you want to define?  Are
all the buoys sampled at the same times?  If so, I think I would
recommend making a separate NetCDF file for each location, and
then use the information in the section on appending in Example 4 of
Ch10 Sec2. SIMPLE CONVERSIONS USING FERRET. That
example has data in x and y and appends different levels to the master
file, and you will need to append x/y points to the file.

Another way might be to concatenate all your files into one ASCII
file and use the FILE command, with the /ORDER qualifier to let
Ferret know that T is varying fastest.  Say you have your files
named according to latitude and longitude.  If you append your files
in this order using the Unix cat command,  (assuming that you have
removed any header lines in the files)

>cat w80n36.dat w78n36.dat w74n36.dat w72n36 w80n38.dat ... > all.dat

Then in your file time would vary fastest, then X, then Y.

Define axes
DEFINE AXIS/X=80w:72w:2 xax2
DEFINE AXIS/Y=36n:40N:2 yax2
DEFINE AXIS/T=  ??  tax
DEFINE GRID/X=xax2/Y=yax2/T=tax ingrid

Then you would use a FILE/ORDER=TXY/GRID=ingrid/var="...  all.dat

Please ask the Users' List again if you need more assistance.  This is
probably something others have done and they will be able to help you.
You will need to explain that each of your ascii data filse is a time series
at one location, with different files for the different locations.



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement