[ncl-talk] Creating histogram based on the number of gridpoints
Lyndz
olagueralyndonmark429 at gmail.com
Mon Sep 9 11:29:34 MDT 2019
Dear Sir Adam,
Thank you for the information.
I apologize for the unclear question.
Is there a way to plot a histogram this way:
x-axis: bin of gridpoints (say in my previous email, there are 300
gridpoints within rain_region. Then I have to bin this by 5)
y-axis: frequency of rainfall occurrence above 0 mm/day.
Thank you so much for the help.
Sincerely,
Lyndz
On Tue, Sep 10, 2019 at 2:11 AM Adam Phillips <asphilli at ucar.edu> wrote:
> Hi Lyndz,
> Perhaps I am not understanding what you are wanting to do, but I think
> gsn_histogram will do exactly what you need, regardless of whether you are
> counting up the number of grid points or values in a timeseries that fall
> in each bin. You would pass ndtooned(rain_region) into gsn_histogram, and
> it doesn't matter whether you pass every time step individually or all
> timesteps at once.
> Adam
>
> On Mon, Sep 9, 2019 at 12:38 AM Lyndz via ncl-talk <ncl-talk at ucar.edu>
> wrote:
>
>> Dear NCL-experts,
>>
>> *[Details]*
>>
>> I am using the aphrodite rainfall data set, which I uploaded in my
>> dropbox folder:
>> https://www.dropbox.com/s/lbkjlqgq9era5c7/APHRO_AMJ_1979-2015.nc?dl=0
>>
>>
>> I would like to count the number of grid points over a specified region
>> with rainfall in the following intervals(mm/day): 0-2,
>> 2-4,4-6,6-8,8-10,10-12,12-14,14-16,16-18,18-20,20-22,22-24,24-26,26-28,28-30.
>> Then, create a histogram.
>>
>> f1 = addfile("APHRO_AMJ_1979-2015.nc","r")
>>
>>
>>
>> * latS = 12.5 latN = 20.0 lonL = 120.0 lonR = 122.5*
>> prec = f1->precip(:,:,:)
>> rain_region=prec(:,{latS:latN},{lonL:lonR}) ;select subregion
>>
>> This is almost similar to this example
>> https://www.ncl.ucar.edu/Applications/Scripts/Katrina_circle_hist.ncl
>> But I am binning the number of grid points.
>>
>> Any suggestions on how to do this in NCL?
>>
>> I'll appreciate any guidance.
>>
>> Sincerely,
>> Lyndz
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> --
> Adam Phillips
> Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
> www.cgd.ucar.edu/staff/asphilli/ 303-497-1726
>
> <http://www.cgd.ucar.edu/staff/asphilli>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190910/9bf29ca9/attachment-0001.html>
More information about the ncl-talk
mailing list