[ncl-talk] Issue with Latitude-Time Plot

Amit Kumar amitkumar.777 at hotmail.com
Mon Aug 27 09:50:51 MDT 2018


Dear Rick,

Actually these 115 time stamps are for each day. I have concatenated to these individual days into one using cdo. I want to plot time at x axis which will vary from 1 to 115 indicating each day, so that the plot can be ploted as latitude vs time  and variation of olr can be seen over latitude and time . It is on the same lines as the example for sst anamoly in latitude vs time section in ncl examples.

Regards
Amit




Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Rick Brownrigg <brownrig at ucar.edu>
Sent: Monday, August 27, 2018 8:47:24 PM
To: Amit Kumar
Subject: Re: [ncl-talk] Issue with Latitude-Time Plot

Hi Amit,

Offhand, given the time variable's coordinate range:

Variable: time
    Type: double
    Total Size: 115 values
                920 bytes
    Number of Dimensions: 1
    Dimensions and sizes:       [ 115 <time | unlimited> ]
    Chunking Info:      [ 524288 <time> ]
    Coordinates:
                time: [9159840..9334080]

I'd the plot looks about what I'd expect. In what way do you think the time values are incorrect?

Rick


On Mon, Aug 27, 2018 at 6:02 AM, Amit Kumar <amitkumar.777 at hotmail.com<mailto:amitkumar.777 at hotmail.com>> wrote:

Dear All,


I'm trying to plot Latitude vs Time Plot. It is working fine when I've 30 time instances, but for greater then that (i.e. 115 time steps) the plot is sowing different values in x-axis (time).


I'm not able to workout why this is happening? I'm attaching the output and my ncl script.


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


  var   = a->OLR_DLY
  dims = dimsizes(var)
print(dims)
lat   =  a->lat
  lon   =  a->lon
  time  =  a->time

 lon100E  = ind(lon.eq.100.)                           ; subscript at 90E
 latS      = -20.
 latN      =  40.
 shov      = var(lon|lon100E:lon100E,{lat|latS:latN},time|:)
 dims      = dimsizes(shov)                   ; shov=3D array=(1,31,127)
 sdemo     = onedtond(ndtooned(shov), (/dims(1),dims(2)/) )
 sdemo!0   = "lat"
 sdemo!1   = "time"
 sdemo&lat = lat({lat|latS:latN})
 sdemo&time= time

 sdemo = smth9 (sdemo,0.5, 0.25, False)               ; 2D smoother

 gtPat = 17                                           ; stiple
 ltPat = 3                                            ; hatch
;*************************
; plotting parameters
;*************************
 wks   = gsn_open_wks ("png", "Monsoon_2017_lat_time_100_1" ) ; send graphics to PNG file
 res                  = True               ; plot mods desired
 res at gsnDraw          = False              ; don't draw yet
 res at gsnFrame         = False              ; don't advance frame yet

 res at tiMainString     = "Daily OLR variation at 100E" ; title

 res at vpXF             = 0.12               ; default is 0.2 change aspect
 res at vpYF             = 0.8                ; default is 0.8 ration
 res at vpHeightF        = 0.4                ; default is 0.6
 res at vpWidthF         = 0.8                ; default is 0.6

 res at cnLevelSelectionMode = "ManualLevels" ; manual levels
 res at cnMinLevelValF       = 150.            ; min level
 res at cnMaxLevelValF       =  330.            ; max level
 res at cnLevelSpacingF      =  10           ; contour spacing

 res at cnFillOn         = True                ; color on
 res at lbLabelStride    = 4                   ; every other label
 res at lbOrientation    = "Horizontal"          ; vertical label bar
 res at pmLabelBarOrthogonalPosF = -0.04       ; move label bar closer to axis
 res at cnLinesOn        = False               ; turn off contour lines
 res at cnFillPalette    = "GMT_wysiwyg"    ; set color map


 plot = gsn_csm_lat_time(wks, sdemo, res )
 ;opt  = True
 ;opt at gsnShadeFillType = "pattern"
 ;opt at gsnShadeLow      = ltPat
 ;opt at gsnShadeHigh     = gtPat
 ;plot = gsn_contour_shade(plot, -0.69, 0.25, opt)
 ;plot = ZeroLineContour (plot)
 draw (plot)                                ; draw the contour object
 frame (wks)                                ; advance frame
end
==================================================================================================
%%%%%%%%%%%%%%%%%%%
################################

dimensions:
    lon = 1400
    lat = 1400
    time        = 115 // unlimited

chunk dimensions:
    lon = 1400

variables:
    Variable: lon
    Type: double
    Total Size: 1400 values
                11200 bytes
    Number of Dimensions: 1
    Dimensions and sizes:       [ 1400 <lon> ]
    Coordinates:
                lon: [40..109.95]
        Number of Attributes:        4
            standard_name       :       longitude
            long_name   :       longitude
            units       :       degrees_east
            axis        :       X

    Variable: lat
    Type: double
    Total Size: 1400 values
                11200 bytes
    Number of Dimensions: 1
    Dimensions and sizes:       [ 1400 <lat> ]
    Coordinates:
                lat: [-20..49.95]
        Number of Attributes:        4
            standard_name       :       latitude
            long_name   :       latitude
            units       :       degrees_north
            axis        :       Y

    Variable: time
    Type: double
    Total Size: 115 values
                920 bytes
    Number of Dimensions: 1
    Dimensions and sizes:       [ 115 <time | unlimited> ]
    Chunking Info:      [ 524288 <time> ]
    Coordinates:
                time: [9159840..9334080]
        Number of Attributes:        4
            standard_name       :       time
            units       :       minutes since 2000-1-1 00:00:00
            calendar    :       standard
            axis        :       T

    Variable: OLR_DLY
    Type: float
    Total Size: 225400000 values
                901600000 bytes
    Number of Dimensions: 3
    Dimensions and sizes:       [ 115 <time | unlimited> x 1400 <lat> x 1400 <lon> ]
    Chunking Info:      [ 1 <time> x 1 <lat> x 1400 <lon> ]
    Coordinates:
                time: [9159840..9334080]
                lat: [-20..49.95]
                lon: [40..109.95]
        Number of Attributes:        5
            standard_name       :       Outgoing Longwave Radiation
            long_name   :       Out Longwave Radiation(Daily)
            units       :       W.m-2
            _FillValue  :       -999
            missing_value       :       -999


########################################

Thanks in advance.

Regards
Amit


_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu<mailto:ncl-talk at ucar.edu>
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180827/65e04556/attachment.html>


More information about the ncl-talk mailing list