Re: Beginning Longitude

From: Yi Wang (wang AT wang29@wisc.edu)
Date: Mon Nov 07 2005 - 13:05:27 MST

  • Next message: Yi Wang: "function lonFlip."

  • Hi Prince,

    Glad to know you are starting to use NCL. In my transition from GrADs to
    NCL, I also faced such problems. The archives of the user forum
    are a valuable resource to find solutions to most problems for the
    new NCL user.

    Your particular problem of zooming on a domain of interest may recur. So
    it may be expedient to write a customized procedure (see procedure
    mymap(res,opt) below for an example). I write such small procedures,
    primarily to avoid typing a lot of res@xxxx, res@yyyy... etc.

    ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    procedure mymap(res:logical,opt:logical)
    begin
             if (opt.and.isatt(opt,"latlon")) then
             res@gsnAddCyclic = False
             res@mpMinLatF = opt@latlon(0)
             res@mpMaxLatF = opt@latlon(1)
             res@mpMinLonF = opt@latlon(2)
             res@mpMaxLonF = opt@latlon(3)
             res@mpCenterLonF = (res@mpMinLonF+res@mpMaxLonF)/2.
             end if
    end
    ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    You can save such definitions in a file, for example $HOME/mymodules.ncl
    Load this file at the top of your NCL code when you need to use it, with

    load "$HOME/mymodules.ncl"

    Before calling the procedure set:
             res=True
             opt=True
             opt@latlon=(/-60.0,60.0,20.0,300.0/)

    Then call the procedure mymap:
             mymap(res,opt)
              plot = gsn_csm_contour_map_ce(wks_1,sst(190,:,{20:300}),res)

    Best wishes,

    saji

    Saji N. Hameed
    Assistant Researcher
    International Pacific Research Center,
    2525 Correa Road, Honolulu, HI 96822

    On Sun, 6 Nov 2005, Prince K. Xavier wrote:

    > Hello,
    >
    > The longitude values of my data are 0, 1, 2, ....360. But when I plot it, the
    > beginning longitude is 180E (central Pacific) and reaches 180W. Even when I
    > plot a region using
    >
    > res@mpMinLatF = -60
    > res@mpMaxLatF = 60
    > res@mpMinLonF = 20
    > res@mpMaxLonF = 300
    >
    > plot = gsn_csm_contour_map_ce(wks_1,sst(190,:,{20:300}),res)
    >
    > it gives contours from 180E-300E longitudes on the left, then leaves a blank
    > and then plots from 20E-180E. How can I have a continuous map of values from
    > 20E-300E ?
    >
    > Another question:
    >
    > Can I assign time coordinates to a variable as calendar dates? For example,
    > can I have a time axis as jan1982, feb1982, mar1982....?
    >
    > Thanks in advance
    >
    > Prince
    >
    > --
    > Prince K XAVIER
    > Centre for Atmospheric and Oceanic Sciences Indian Institute of Science
    > Bangalore - 560 012 INDIA http://caos.iisc.ernet.in/hpg/students/prince.html
    > __________________________________________________ Phone No. +91 80 2293 2505
    > (Extn:201)
    > +91 98808 19172 (Mobile)
    > _______________________________________________
    > ncl-talk mailing list
    > ncl-talk@ucar.edu
    > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    >
    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Mon Nov 07 2005 - 17:52:13 MST