[Thread Prev][Thread Next][Index]
Re: [ferret_users] reading BIG ascii files
Hi Leticia,
Ferret can read HDF files directly, if they are on an OPeNDAP server. If
that's available for the data you're using, you can bypass all of this
and just point to the data using its OPeNDAP address. You would need to
use the /ORDER= qualifier to reverse the Y axis as I show at the end of
this but otherwise you'd be all set.
To get the data from the axcii, file, here is an outline of what to do.
When you know that the grid is regularly spaced, then it is far easier
to just define the axes in Ferret and then read only the data field when
reading the file. Ferret requires that latitudes run from south to
north, but we can deal with that in a second step. First define the X
axis and a Y axis which is the reverse of the Y axis you will want.
yes? define axis/x=-179.917:179.917/npoints=2160/units=degrees_east
lon_ax
yes? define axis/y=-89.917:89.917/npoints=1080/units=degrees_north
rev_lat_ax
yes? define grid/x=lon_ax/y=rev_lat_x xygrid
yes? file/var="dum1, dum2, npp"/skip=1/grid=xygrid my_file.dat
yes? shade npp ! the variable will be reversed in y with the south
pole at the top.
If there is a missing-data flag for the variable, set that after the
FILE command, with the SET VARIABLE/BAD= command.
Now, Ferret can reverse coordinate axes if the data is coming in from a
netCDF file (or an HDF file on an OPeNDAP server). If we save the data
as netCDF, then we can visualize it correctly:
yes? save/file=nppdata.nc npp
yes? exit
Then to read and access the data with the Y axis reversed
> ferret
yes? set data/ORDER=x-yt nppdata.nc
yes? show grid npp
yes? shade npp
Leticia Cotrim da Cunha wrote:
Hello,
I tried to open big ASCII files organised in columns like this:
lon lat NPP
-179.917 89.917 -9999.
-179.750 89.917 -9999.
-179.583 89.917 -9999.
etc
The file has 1542035 lines.
The format of the ASCII data is F10.3
I wanted to use columns 1 and 2 (lon and lat) to define a grid for NPP.
Longitude (col1) goes from -179.917 to 179.917 at an interval of 0.167
(2160 points).
Latitude (col2) goes from 89.917 to -89.917 at an interval of 0.167
(1080 points).
The files were extracted from 2160x1080 *.hdf files using SEADAS.
I tried to follow the instructions at Ferret documentation, but it did
not work (are the files too big?) or I did not understand it (most
probable).
Any hints? Thanks a lot for your help!
Best regards
Leticia
--
~> ~> ~> ~> ~> ~> ~> ~> ~> ~> ~>
Ansley Manke, NOAA/PMEL ansley.b.manke@xxxxxxxx
7600 Sand Point Way NE, Seattle WA
Phone 206-526-6246, FAX 206-526-6744
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Privacy Policy | Disclaimer | Accessibility Statement