[ncl-talk] same data but different spatial pattern

Toni Klemm toni-klemm at tamu.edu
Wed Feb 13 06:19:27 MST 2019


Hi Jalal,

You mean you want to create a plot for each of your 2444 loops (since your data is hourly and you want hourly plots)? In that case you should use your original first attempt and include code to create a plot within the loop. You should include “i” in the output file name to get a different file name for each loop, so that your plot doesn’t get overwritten each time.

As a thought, 2444 files in one folder can be slow to access I noticed from my own work. You might want to think about some kind of file organization, like include a loop to create a new folder every time “i” is divisible by 100 or so, thereby limiting the number of files to 100 per folder.

Good luck,
Toni


Toni Klemm, Ph.D.
Postdoctoral Research Associate
Department of Ecosystem Science and Management
College of Agriculture and Life Sciences
Texas A&M University, College Station, TX
Contributor to the Early Career Climate Forum
www.toni-klemm.de | @toniklemm


> On Feb 13, 2019, at 2:14 AM, Md. Jalal Uddin <dmjalal90 at gmail.com> wrote:
> 
> My data is hourly. I want to plot hourly data without dimension average. Could you tell me where I need to change from my loop? I want to take whole time 2444.
> 
> f = addfile("bob_dd.nc","r")
> do i =0,2443
>   TRMM = f->pcp(i,{0:30},{65:110})        
>  end do
> 
> Best Regards,
> Jalal
> 
>> On Wed, Feb 13, 2019 at 12:46 PM Toni Klemm <toni-klemm at tamu.edu> wrote:
>> Hi Jamal,
>> 
>> It looks like your do loop in your first attempt does not average. You’re simply replacing the first dimension in TRMM with the next dataset every time you repeat the loop. That’s why your first and second plot look so different. 
>> 
>> In your second attempt you're copying the entire first dimension and then average, that’s why it looks different. If you mean to do that (average the first dimension), your second attempt seems fine.
>> 
>> I hope that makes sense.
>> 
>> Toni
>> 
>> 
>> Toni Klemm, Ph.D.
>> Postdoctoral Research Associate
>> Department of Ecosystem Science and Management
>> College of Agriculture and Life Sciences
>> Texas A&M University, College Station, TX
>> Contributor to the Early Career Climate Forum
>> www.toni-klemm.de | @toniklemm
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> On Feb 12, 2019, at 2:20 PM, Md. Jalal Uddin <dmjalal90 at gmail.com> wrote:
>>> 
>>>  Hi all, 
>>> When I did loop over time, I got a spatial figure that I did not expect (dd_loop figure). 
>>> f = addfile("bob_dd.nc","r")
>>> do i =0,2443
>>>   TRMM = f->pcp(i,{0:30},{65:110})        
>>>  end do
>>> 
>>> I got the right spatial pattern when I did dimension average (dd_avg figure). 
>>> f = addfile("bob_dd.nc","r")
>>> TRMM = f->pcp(:,{0:30},{65:110})          
>>>  dd_ave = dim_avg_n_Wrap(TRMM,0)
>>> 
>>> How can I get similar spatial pattern? What is the difference between time loop and dimension average? Could you explain, please? 
>>> 
>>> Jalal
>>> -- 
>>> Md. Jalal Uddin
>>> MSc in Applied Meteorology (English Language)
>>> Nanjing University of Information, Science and Technology, China
>>> B.Sc. in Disaster Management (Hons.) 
>>> Patuakhali Science and Technology University, Bangladesh.
>>> Cell: +8613260859092, +8801792052662
>>> Web: www.dmjalal90.weebly.com  
>>> Facebook: jalal.hossen.39  
>>> LinkedIn: https://bd.linkedin.com/in/md-jalal-uddin-80a026b0   
>>> Twitter: dmjalal90  
>>> Skype: dmjalal90
>>> <dd_loop.png><dd_avg.png>_______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>> 
> 
> 
> -- 
> Md. Jalal Uddin
> MSc in Applied Meteorology (English Language)
> Nanjing University of Information, Science and Technology, China
> B.Sc. in Disaster Management (Hons.) 
> Patuakhali Science and Technology University, Bangladesh.
> Cell: +8613260859092, +8801792052662
> Web: www.dmjalal90.weebly.com  
> Facebook: jalal.hossen.39  
> LinkedIn: https://bd.linkedin.com/in/md-jalal-uddin-80a026b0   
> Twitter: dmjalal90  
> Skype: dmjalal90
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190213/35fdcb1c/attachment.html>


More information about the ncl-talk mailing list