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