[Thread Prev][Thread Next][Index]

Re: [ferret_users] Problem with Longitude too

Hi Siang and Han,
                   The point is that, while defining an X-axis with 
"E"/"W" with the numerical values or explicit units like /units=longitudes
or /units=degrees, Ferret will issue a modulo attribute BY DEFAULT ONLY IF

     the difference between first x-point and last x-point is DELTA_X

here is an example :

     define axis/x=0E:360E:1.875 xlon    ! first point = last point
     show axis xlon

   name       axis              # pts   start                end
    XLON      LONGITUDE          193 r   0E                   0E(360)
   Axis span (to cell edges) = 361.875

  here "193 r" --indicates the axis is not modulo, since we have violated
above rule.


     define axis/x=0E:358.125E:1.875 xlon
     show axis xlon

   name       axis              # pts   start                end
   XLON      LONGITUDE          192mr   0E                   1.875W
   Axis span (to cell edges) = 360 (modulo length = axis span)
it is modulo by default (indicated by "192mr"), 
    since (take 0E=360E) 360-358.125  = 1.875    

A similar exercise will show you that the X-axis you have defined was
not modulo by default. Now, you can force the modulo behaviour by
adding a /modulo attribute to the 'define axis' command. A similar
step with a NetCDF file will be 
         yes? set axis/modulo  `variable_name,return=xaxis`

Please note that you have to use GRAVE ACCENTS instead of DOUBLE QUOTES
(this was the mistake with your attempt).
However, forcing a modulo nature will not make sense if your axis is not 
wrapping around with respect you x_start, x_end and x_delta. You may see 
unexpected results if the above mentioned condition is not satisfied.

If you still have questions, please mail back with the following details
  1.  Precise values of X_start, X_end and X_delta
  2.  Same for Y-axis too.
  3.  How is your ascii file oriented --> howmany rows and columns?

Then i will be able to offer a better help.



On Fri, 29 Jun 2007 nguyen@xxxxxxxxxx wrote:

> Hi Siang Chye
> when define your lat and lon axes, add the qualifier /unit=degrees like that:
> DEF AXIS/y=87.9S:87.9N/npoints=64/unit=degrees y1
> DEF AXIS/x=0E:2.8W/npoints=128/unit=degrees x1
> your xaxis will inherently "modulo", indicating that the axis wraps
> around?the first point immediately following the last
> Or you can also specify your xaxis with the qualifier /modulo
> cheers
> Hanh
> > Dear all,
> >
> > I am trying to plot a graph of Europe i.e from 31.7W to 33.7E, but the
> > longitude
> > stops at greenwich. I had read the data from an ascii file and I am not
> > sure if
> > this might be the problem as I do not have a problem plotting Europe with
> > a
> > netCDF file I obtained from MeteoFrance.
> >
> > The Ferret commands I had used to read from the ascii file are as follows:
> >
> > DEF AXIS/y=87.9S:87.9N/npoints=64 y1
> > DEF AXIS/x=0E:2.8W/npoints=128 x1
> > DEF GRID/x=x1/y=y1 g1
> > FILE/VAR="alpha"/GRID=g1 alpha.dat
> >
> > I also tried converting the ascii file to a netCDF file using the
> > following
> > command:
> >
> > SAVE/FILE="alpha.nc" alpha
> >
> > but I still had problems with the longitudes. When I typed
> >
> > SET AXIS/modulo "alpha,return=xaxis",
> >
> > a solution I found from one of the archived mails, I was returned the
> > following
> > error message:
> >
> > invalid command: unknown axis: alpha,return=xaxis
> >
> > I would greatly appreciate if someone could advice me how to overcome the
> > problem. Thank you.
> >
> > Best Regards,
> > Siang Chye
> >

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement