I am working with ascii grid format data, meaning the first
6 rows of the file is header info, then the grid of data
represents the model output at each grid cell (example
attached):
ncols 347
nrows 979
xllcorner 588970.54128361004
yllcorner 4864497.1359059000
cellsize 100.00000
NODATA_value -9999.0000
0.79 0.79 0.79 0.81 0.81 0.82
....1,ncols
0.79 0.79 0.79 0.81 0.81 0.82 ....
0.79 0.79 0.79 0.81 0.81 0.82 ....
0.79 0.79 0.79 0.81 0.81 0.82 ....
.
.
.
nrows,1
So, each value (0.79 for example) represents the
precipitation at that 100x100 m grid cell.
I have gone over the ferret documentation 2.5:
Ascii data and there doesn't seem to be information about
reading data in this format. For example I have tried:
yes? define axis/x=1:347:1 longax
yes? define axis/y=1:979:1 latax
yes? define grid/x=longax/y=latax gridd
yes? file/var=ppt/grid=gridd ppt_test.asc
yes? sh data
currently SET data sets:
1> ./ppt_test.asc (default)
name title I
J K L M N
PPT PPT 1:347
1:2 ... ... ... ...
This isn't right.
I have one of these files for each timestep of
the model run. I'd like to read these files into ferret,
then stack all of the files into a netcdf file so I can
arrange model runs by year, where each netcdf file contains
365 ascii files representing each day of the model run.
Does ferret have the ability to read and store
the header info? Would it be better if I changed the write
command in my code to leave out the header info so it just
gives a grid of output?
Thank you in advance! To be clear, my primary
question is how to properly read in the data in the format I
described (example file attached). If possible, help on
converting the batch of files into a netcdf would also be
great.
Matt
--
Matt Cooper
M.S. candidate, Water Resources Science
College of Earth, Ocean and Atmospheric Sciences
Oregon State University