[ncl-talk] ncl-talk Digest, Vol 141, Issue 26

Madhu Singh singhmadhu673 at gmail.com
Sun Aug 16 14:00:30 MDT 2015


Dear all, I am unable to increase the unit of colour bar (colour code), any
help in this regard will be appreciated.
On Aug 16, 2015 11:30 PM, <ncl-talk-request at ucar.edu> wrote:

> Send ncl-talk mailing list submissions to
>         ncl-talk at ucar.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> or, via email, send a message with subject or body 'help' to
>         ncl-talk-request at ucar.edu
>
> You can reach the person managing the list at
>         ncl-talk-owner at ucar.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ncl-talk digest..."
>
>
> Today's Topics:
>
>    1. how to plot xy2 plot with 1D data ( grace )
>    2. Reading 3G68 TRMM (Ipsita Putatunda)
>    3. Re: Reading 3G68 TRMM (Dennis Shea)
>    4. Re: Reading 3G68 TRMM (Ipsita Putatunda)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 16 Aug 2015 09:07:06 +0800
> From: " grace " <313695096 at qq.com>
> Subject: [ncl-talk] how to plot xy2 plot with 1D data
> To: " ncl-talk " <ncl-talk at ucar.edu>
> Message-ID: <tencent_5E9341E166F1E2D5446E797C at qq.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,all:    I am wondering how to plot xy2 plot with 1D data?
>    I want to compare wrfout data with observed data in a xy2 plot with
> time as the X axis,
> but the observed data are 1D without time  demension in a .txt file, a
> data per hour .
>     I have  extract the wrfout data as 1D data in a .txt file :
> ;;;;;;;;;;;;;;;;;;;;;
> ascii_file = "temp.txt"
> str = new(ntimes, "string")
>   do it =0, ntimes-1,1        ; TIME LOOP
>
> t2= wrf_user_getvar(a,"T2",it)
>       t2= t2-273.15
>       t2 at units = "c"
>         tt2=t2(it,98, 98)
>     end if
>    str(it) = sprintf("%12.8f", tt2)
> end do
>
>    asciiwrite(ascii_file, str)
> ;;;;;;;;;;;;;;;;;;;;;;;
>
>
> How can I plot the xyplot with time as the X axis while data do not have
> time demension with the "plot = gsn_csm_xy2(wks,time,t2,tob,resL,resR)"
>
>
>    Or do you guys have some advice?
>     any information will be appreciated
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150816/56bfc6ba/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Sun, 16 Aug 2015 11:45:26 +0530
> From: Ipsita Putatunda <ipsita.putatunda at gmail.com>
> Subject: [ncl-talk] Reading 3G68 TRMM
> To: "ncl-talk at ucar.edu Talk" <ncl-talk at ucar.edu>
> Message-ID:
>         <CA+WpEXstEmD4UARiN2kJkeiqBo6a+wFFk+PF=
> KoCa2m6O-z2MA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear all,
>    I need to get a two dimensional variable Var(lat,lon) from TRMM 3G68
>  dataset which is in ascii form. I am able to read the data using
> asciiread, and then by using str_get_field function, but how to convert it
> into a 2 dimensional variable whose coordinate will be lat and lon. Any
> help in this issue will be appreciated.
>
> Thanks in advance,
> Ipsita
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150816/0a3155e4/attachment-0001.html
>
> ------------------------------
>
> Message: 3
> Date: Sun, 16 Aug 2015 07:35:34 -0600
> From: Dennis Shea <shea at ucar.edu>
> Subject: Re: [ncl-talk] Reading 3G68 TRMM
> To: Ipsita Putatunda <ipsita.putatunda at gmail.com>
> Cc: "ncl-talk at ucar.edu Talk" <ncl-talk at ucar.edu>
> Message-ID:
>         <
> CAOF1d_6+HDC7CgZ59535oB5hxTf4_-Sjnx_02w6_OgzOUZBd4w at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Please read:
>   https://www.ncl.ucar.edu/Document/Functions/Built-in/onedtond.shtml
>
> =================
> You must look at your data.  There are different resolutions (0.25,
> 0.50, ..). A 0.5 light have
>
> 3G68 7.1 NONE NONE NASA/JAXA/NICT 2011-08-14T21:16UTC
> 360 720 -90 -180 0.5 20100901
> -40 40 -180 180
> Grid_First_Row=0 Grid_Center_Latitude=-89.75 Grid_First_Column=0
> Grid_Center_Longitude=-179.75 Grid_Cell_Resolution=0.5 Duration=Day
>
> So, in the function below,
>    latStrt  = -89.75
>    latLast = abs(latStrt)
>    lonStrt = -179.75
>    lonLast = abs(latStrt)
>    nlat  = 360
>    mlon = 729
>
> =====
>
>
> undef("3G68_txt2latlon")
> function 3G68_txt2latlon(x[*], nlat[1]:integer, mlon[1]:integer \
>                                        ,latStrt[1]:numeric, latLast[1]
>      \
>
>  ,lonStrt[1]:numeric,lonLast[1]:numeric)
> begin
>     data = onedtooned(x, (/nlat,mlon/) )
>
>     lat     = fspan(latStrt,latLast,nlat)
>     lat!0  = "lat"
>     lat at units = "degrees_north"
>     lon    = fspan(lonStrt,latLast,mlon)
>     lon!0 ="lon"
>     lon at units = "degrees_east"
>
>     data!0 = "lat"
>     data!1 = "lon"
>     data&lat = lat
>     data&lon = lon
>     data at long_name = "..."
>     data at units = "..."
>
>     return(data)
> end
>
>
>
> On Sun, Aug 16, 2015 at 12:15 AM, Ipsita Putatunda
> <ipsita.putatunda at gmail.com> wrote:
> > Dear all,
> >    I need to get a two dimensional variable Var(lat,lon) from TRMM 3G68
> > dataset which is in ascii form. I am able to read the data using
> asciiread,
> > and then by using str_get_field function, but how to convert it into a 2
> > dimensional variable whose coordinate will be lat and lon. Any help in
> this
> > issue will be appreciated.
> >
> > Thanks in advance,
> > Ipsita
> >
> > _______________________________________________
> > ncl-talk mailing list
> > ncl-talk at ucar.edu
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
>
>
> ------------------------------
>
> Message: 4
> Date: Sun, 16 Aug 2015 22:04:19 +0530
> From: Ipsita Putatunda <ipsita.putatunda at gmail.com>
> Subject: Re: [ncl-talk] Reading 3G68 TRMM
> To: Dennis Shea <shea at ucar.edu>
> Cc: "ncl-talk at ucar.edu Talk" <ncl-talk at ucar.edu>
> Message-ID:
>         <CA+WpEXtZtSZSZzBm=17z=yZUdPQ8+hmELRULidetA9z+Lxg=
> bw at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Thank you for your help. I got the 2D variable as per your suggestions. But
> it is giving one warning message as mentioned below, as the size of x and
> PR differs. Is their any way to make it correct. Why is it coming like
> that? There are also some grids for the variable where there is no data,
> and may be that is why converting PR from string to float is preventing.
> How can I convert the data from string to float? Any help will be
> appreciated.
> My script is attached here with.
>
> Variable: x
> Type: string
> Total Size: 802264 bytes
>             200566 values
> Number of Dimensions: 1
> Dimensions and sizes:   [200566]
> Coordinates:
> warning:onedtond : output dimension sizes not even multiples of input,
> check output
>
>
> Variable: PR
> Type: string
> Total Size: 1036800 bytes
>             259200 values
> Number of Dimensions: 2
> Dimensions and sizes:   [lat | 360] x [lon | 720]
> Coordinates:
>             lat: [-89.75..89.75]
>             lon: [-179.75..89.75]
> Number Of Attributes: 2
>   long_name :   PR_rain
>   units :       mm/hour
> (0,0)
> (0,1)
> (0,2)
> (0,3)
> (0,4)
> (0,5)
> (0,6)
> (0,7)
> (0,8)
> (0,9)
> (0,10)
> (0,11)
>
>
> Thanks,
> Ipsita
>
> On Sun, Aug 16, 2015 at 7:05 PM, Dennis Shea <shea at ucar.edu> wrote:
>
> > Please read:
> >   https://www.ncl.ucar.edu/Document/Functions/Built-in/onedtond.shtml
> >
> > =================
> > You must look at your data.  There are different resolutions (0.25,
> > 0.50, ..). A 0.5 light have
> >
> > 3G68 7.1 NONE NONE NASA/JAXA/NICT 2011-08-14T21:16UTC
> > 360 720 -90 -180 0.5 20100901
> > -40 40 -180 180
> > Grid_First_Row=0 Grid_Center_Latitude=-89.75 Grid_First_Column=0
> > Grid_Center_Longitude=-179.75 Grid_Cell_Resolution=0.5 Duration=Day
> >
> > So, in the function below,
> >    latStrt  = -89.75
> >    latLast = abs(latStrt)
> >    lonStrt = -179.75
> >    lonLast = abs(latStrt)
> >    nlat  = 360
> >    mlon = 729
> >
> > =====
> >
> >
> > undef("3G68_txt2latlon")
> > function 3G68_txt2latlon(x[*], nlat[1]:integer, mlon[1]:integer \
> >                                        ,latStrt[1]:numeric, latLast[1]
> >      \
> >
> >  ,lonStrt[1]:numeric,lonLast[1]:numeric)
> > begin
> >     data = onedtooned(x, (/nlat,mlon/) )
> >
> >     lat     = fspan(latStrt,latLast,nlat)
> >     lat!0  = "lat"
> >     lat at units = "degrees_north"
> >     lon    = fspan(lonStrt,latLast,mlon)
> >     lon!0 ="lon"
> >     lon at units = "degrees_east"
> >
> >     data!0 = "lat"
> >     data!1 = "lon"
> >     data&lat = lat
> >     data&lon = lon
> >     data at long_name = "..."
> >     data at units = "..."
> >
> >     return(data)
> > end
> >
> >
> >
> > On Sun, Aug 16, 2015 at 12:15 AM, Ipsita Putatunda
> > <ipsita.putatunda at gmail.com> wrote:
> > > Dear all,
> > >    I need to get a two dimensional variable Var(lat,lon) from TRMM 3G68
> > > dataset which is in ascii form. I am able to read the data using
> > asciiread,
> > > and then by using str_get_field function, but how to convert it into a
> 2
> > > dimensional variable whose coordinate will be lat and lon. Any help in
> > this
> > > issue will be appreciated.
> > >
> > > Thanks in advance,
> > > Ipsita
> > >
> > > _______________________________________________
> > > ncl-talk mailing list
> > > 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/20150816/302dc9a6/attachment-0001.html
> -------------- next part --------------
> ;====================================================================
>  load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>  load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>  load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>  ;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> ;====================================================================
>  ;begin
>   netCDF=True
>   fn="3G68.20131201.7.txt"
>   x1 = asciiread(fn ,-1 , "string")
>   delim=" "
> ;====================================================================
>   x= str_get_field(x1(5:),11,delim)
>   printVarSummary(x)
> ;====================================================================
>   latStrt  = -89.75
>   latLast = abs(latStrt)
>   lonStrt = -179.75
>   lonLast = abs(latStrt)
>   nlat  = 360
>   mlon = 720
> ;=====================================================
>    undef("txt2latlon")
> function txt2latlon(x[*], nlat[1]:integer, mlon[1]:integer \
>                                        ,latStrt[1]:numeric, latLast[1]
>      \
>
>  ,lonStrt[1]:numeric,lonLast[1]:numeric)
> ;=====================================================
>   local data
>   begin
>     data = onedtond(x, (/nlat,mlon/) )
>     lat     = fspan(latStrt,latLast,nlat)
>     lat!0  = "lat"
>     lat at units = "degrees_north"
>     lon    = fspan(lonStrt,latLast,mlon)
>     lon!0 ="lon"
>     lon at units = "degrees_east"
>     data!0 = "lat"
>     data!1 = "lon"
>     data&lat = lat
>     data&lon = lon
>     data at long_name = "PR_rain"
>     data at units = "mm/hour"
>
>     return(data)
>    end
>    begin
>     PR=txt2latlon(x, nlat, mlon \
>                                        ,latStrt,latLast\
>                                        ,lonStrt,lonLast)
>     print(PR)
>    end
>
>
> ------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> End of ncl-talk Digest, Vol 141, Issue 26
> *****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150817/ad526853/attachment.html 


More information about the ncl-talk mailing list