[ncl-talk] PDFX bin width

Sri nandini bax8609 at uni-hamburg.de
Mon Apr 19 08:13:39 MDT 2021


Hello dear ncl-users,

Can someone help me understand why my 3 PDFs (over different periods) 
(see attached plot) are not as smooth? I have tried a different 
combination of specifying bin spacing and bin numbers, an example of the 
script and the output is below:

    minint =   -8.6         ;minimum from all 3 periods
    maxint =    32.3        ;maximum from all 3 periods
    dt=0.8
    nbins1 = floattointeger(((maxint - minint)/dt)+1)
    print(nbins1) ===>52

    pdf1 = pdfx(hist_anom, nbins1, opt)
    printVarSummary(pdf1)
    pdf2 = pdfx(rcp45_anom, nbins1, opt)
    printVarSummary(pdf2)
    pdf3 = pdfx(rcp85_anom,nbins1, opt)
    printVarSummary(pdf3)
   nVar    = 3
   nBin    = pdf1 at nbins          ; retrieve the number of bins

   xx      = new ( (/nVar, nBin/), typeof(pdf1))
   ;cannot exactly specify the bin-centers in pdfx
   xx(0,:) = pdf1 at bin_center     ; tbins ("x" axis values)
   xx(1,:) = pdf2 at bin_center
   xx(2,:) = pdf3 at bin_center

   yy      = new ( (/nVar, nBin/), typeof(pdf1))
   yy(0,:) = (/ pdf1 /) * 0.01 ;; convert % to absolut
   yy(1,:) = (/ pdf2 /) * 0.01
   yy(2,:) = (/ pdf3 /) * 0.01
   plot = gsn_csm_xy (wks, xx, yy, res)

Variable: pdf1
Type: double
Total Size: 416 bytes
             52 values
Number of Dimensions: 1
Dimensions and sizes:    [x | 52]
Coordinates:
             x: [-8.343202444223257..15.06793388953576]
Number Of Attributes: 11
   _FillValue :    -9.969209968386869e+36
   bin_center :    <ARRAY of 52 elements>
   bin_bounds :    <ARRAY of 53 elements>
   bin_bound_min :    -8.572723388671875
   bin_bound_max :    15.29745483398438
   bin_spacing :    0.4590418888972356
   nbins :    52
   nMax :    24000
   nUse :    24000
   long_name :    PDF: Sea surface elevation
   units :    %

Variable: pdf2
Type: double
Total Size: 416 bytes
             52 values
Number of Dimensions: 1
Dimensions and sizes:    [x | 52]
Coordinates:
             x: [-4.397309816800631..20.69787744375375]
Number Of Attributes: 11
   _FillValue :    -9.969209968386869e+36
   bin_center :    <ARRAY of 52 elements>
   bin_bounds :    <ARRAY of 53 elements>
   bin_bound_min :    -4.643341064453125
   bin_bound_max :    20.94390869140625
   bin_spacing :    0.492062495304988
   nbins :    52
   nMax :    24000
   nUse :    24000
   long_name :    PDF: Sea surface elevation
   units :    %

Variable: pdf3
Type: double
Total Size: 416 bytes
             52 values
Number of Dimensions: 1
Dimensions and sizes:    [x | 52]
Coordinates:
             x: [0.4419617286095253..31.9627318749061]
Number Of Attributes: 11
   _FillValue :    -9.969209968386869e+36
   bin_center :    <ARRAY of 52 elements>
   bin_bounds :    <ARRAY of 53 elements>
   bin_bound_min :    0.1329345703125
   bin_bound_max :    32.27175903320312
   bin_spacing :    0.6180543165940505
   nbins :    52
   nMax :    24000
   nUse :    24000
   long_name :    PDF: Sea surface elevation
   units :    %

How can i ensure or compute that the area under the graph- (the bin 
spaces) are the same for all 3 PDFs?



-- 
Dr. Sri, Nandini-Weiss
Research Associate

Universität Hamburg
Center for Earth System Research and Sustainability (CEN)
Cluster of Excellence 'Climate, Climatic Change, and Society' (CLICCS)

Bundesstrasse 53, 20146 Hamburg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PDF_eNA_Hist_RCPs_SSH.png
Type: image/png
Size: 68553 bytes
Desc: not available
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210419/6278fae9/attachment.png>


More information about the ncl-talk mailing list