[Thread Prev][Thread Next][Index]

Re: [ferret_users] Converting ASCII data to netCDF file

First, The Ferret users-list page is here:

And the search  within the Archives is here:

Are you able to see those pages? By the way, the search simply sets up a Google search, where you send Google the search terms.  So you can do the same thing. Say to search for the string "ASCII time", you could go to Google and enter this:

          ASCII time site:http://www.pmel.noaa.gov/maillists/tmap/ferret_users/

About your data. In the file are dates 6 Jan 1983; 16-Jan-1983; 26-Jan-1983; 6-Feb-1983; 16-Feb-1983; 25-Feb-1983; ..

This is not a regularly-spaced axis. If you want to treat it as a regularly spaced axis, you might do better to specify a 360-day calendar.  Also if the data are at 6-Jan, 16-Jan, 26-Jan, then I don't think you want to use /EDGES.  What that does is say that the data is at days 10, 20, ... and the edges of the grid cells defining time are at 6-Jan, 26-Jan, ...

Have a look at the result if you define the time axis as:

    DEFINE AXIS/T=06-JAN-1983:26-DEC-1987:10/UNITS=days/cal=d360 taxis

Another alternative is to define the time axis using the dates listed in the dataset. You'd need to define variables that correspond to the year, month, and day of the unique times in the input data,, with months expressed as a number rather than a string; and then use the ideas in the FAQ about defining a time axis from year,month, day data:



On 8/4/2014 3:52 AM, Hussen Seid wrote:
Dear ferret users,

I'm not sure if this question is already asked and answered by ferret users. I couldn't access the ferret mailing list. It redirects to ferret manual.

I have regularly-spaced text data and want to convert it to netcdf file. The data is decadal (average of 10 days) so each month consisting of three time steps.
I wrote the following script and it worked fine, but the time axis is not correct.
let ntime = 180
let Variables = "Lon,Lat,Time,pr"
DEFINE AXIS/X=33.75:40.25:0.1/UNITS=degrees_east xaxis
DEFINE AXIS/Y=7.25:14.95:0.1/UNITS=degrees_north yaxis
DEFINE AXIS/EDGEDS/T=06-JAN-1983:26-DEC-1987:10/UNITS=days taxis
DEFINE GRID/X=xaxis/Y=yaxis/T=taxis xytgrid
FILE/FORMAT=delim/skip=1/VAR=`Variables`/GRID=xytgrid Rain83-87.txt
save/file=Test-gridded-1983-1987.nc pr[g=xytgrid@asn]

use Test-gridded-1983-1987.nc
sh d

list pr[i=1,j=1,l=1:180]
11-JAN-1983 00 /   1:    0.0
 21-JAN-1983 00 /   2:    0.0
 31-JAN-1983 00 /   3:    1.0
 10-FEB-1983 00 /   4:   12.0
 20-FEB-1983 00 /   5:    0.0
 02-MAR-1983 00 /   6:    0.0
 12-MAR-1983 00 /   7:    1.0
 22-MAR-1983 00 /   8:    5.0
 01-APR-1983 00 /   9:   16.0
 11-APR-1983 00 /  10:   19.0
 21-APR-1983 00 /  11:   11.0
As you can see "Feb" consists two time steps instead of three. Could someone help me in creating the correct time axis? I also would like to compute the monthly mean from a decadal data.
Please see attached. The structure of the data is [lon, lat, time, var].


Hussen Seid Endris
PhD Student
Climate System Analysis Group
Department of Environmental and Geographical Science
University of Cape Town
Private Bag Rondebosch, 7701, Cape Town, South Africa
Tel:(+27) (0)74 222 4357

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement