[Thread Prev][Thread Next][Index]

Re: Problem in reading ascii files



Hi Estelle,

The source of the problem in the lines of script that you sent is a bug in
the DEFINE AXIS command. For the case where the axis is a single point
defining the axis with the syntax
    "def axis/x/from_data/name=myxaxis xpos"
leads to an invalid axis in V5.22.

The easy work-around is to use the syntax
    def axis/npoints=1/x=`xpos` myxaxis

This problem has been fixed in V5.3.

    - steve

=============

Jonathan Callahan wrote:

> Estelle,
>
> Steve Hankin, the master ferreter, is on vacation for a week and will be
> able to give a more thorough answer.  I see nothing wrong with your
> script and it does fail for me.  But you can get it to work by
> specifying an index value on the X axis.
>
> save/clobber/i=1/file="$1.nc" c14
>
> Once it is saved as a NetCDF file it can be read in and is understood by
> Ferret.
>
> Bonne chance!
>
> -- Jonathan Callahan
>
> Estelle Laurendeau wrote:
> >
> > Hi Ferreters,
> >
> > I am currently dealing with read of ascii files with Ferret
> >
> > The goal is to create a proper netcdf file with a right spatial
> > position for a variable running on time.
> >
> > more example.dat gives:
> > --------------------------------------
> > Year C14
> > 1950.0 -54.0
> > 1952.0 -66.0
> > 1955.0 -54.0
> > 1957.0 -40.0
> > 1958.0 -44.5
> > 1959.0 -20.0
> > 1960.0 -18.0
> > 1961.0 -12.0
> > --------------------------------------
> >
> > more example.pos gives:
> > --------------------------------------
> > Latitude Longitude
> > 16.83 -86.20
> > --------------------------------------
> >
> > and here is my ferret script (read.jnl) to read them and
> > save into a netcdf file:
> >
> > --------------------------------------
> > file/col=2/var=ypos,xpos/skip=1 "$1.pos"
> > def axis/x/from_data/name=myxaxis/units=degrees_east xpos
> > def axis/y/from_data/name=myyaxis/units=degrees_north ypos
> >
> > file/col=2/var=year,c14/skip=1 "$1.dat"
> > def axis/t/from_data/name=mytaxis/units=years year
> >
> > def grid/x=myxaxis/y=myyaxis/t=mytaxis mygrid
> >
> > file/col=2/var=year,c14/grid=mygrid/skip=1 "$1.dat"
> >
> > save/clobber/file="$1.nc" c14
> > --------------------------------------
> >
> > Try:
> >
> > go read example
> >
> > and please tell me what is wrong in this script
> >
> > Thanks in advance
> > Regards
> >
> > Estelle Laurendeau
> >
> > Laboratoire des Sciences du Climat et de l'Environnement
> > Unite mixte de recherche CNRS-CEA
> > L'Orme des Merisiers - Bat.701 - CEA/Saclay
> > 91191 GIF sur YVETTE cedex - FRANCE

--
Steve Hankin
NOAA/PMEL, 7600 Sand Point Way NE, Seattle, WA 98115-0070
ph. (206) 526-6080 -- FAX (206) 526-6744




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement