[ncl-talk] pdfxy/pdfxy_bin

Dennis Shea shea at ucar.edu
Fri Apr 5 06:09:46 MDT 2019


Hi Jonathan,

Attached is an NCL script and a  fortran-77 code from Auguat 2014. For some
reason, these never made it into NCL. Likely no completely tested.

Using the NCL function  would likely be quite slow for large arrays. Give
it a try.

%> ncl tst_pdfxyx.ncl

Ypu could invoke the f77 subroutine if needed. I can't find the test for
this. I'll look later today.

%> WRAPIT xyz2pdf77.f

Good luck



On Thu, Apr 4, 2019 at 2:34 AM Jonathan Buzan <jrbuzan at gmail.com> wrote:

> Hello NCL-Talk and Dennis Shea,
>
> Thanks again for the previous help, as I have had much success!
> I am moving on to more advanced subjects. Instead of PDF(x,y), I now need
> to calculate PDF(x,y,z).
>
> In the contributed.ncl file, I believe I can modify the code below by
> adding a 3rd variable into the binning if-then-do statement. Would this be
> along the right track?
> I would need to create a new routine to accept the third variable in
> the pdfxy.  Probably call it pdfxyz…
>
> -Jonathan
>
>
> ; JRB BEGIN
> ;print("Jon Is Here")
> ;  pdf2 = pdfxy_bin(x,y, binxBound,binyBound, popt)
>                           ; all NCL [original code]
>     x1d  = ndtooned(x)  ; requires more memory
>     y1d  = ndtooned(y)
>
>     do nby=0,nbinsy-1
>        iy = ind(y1d.ge.binyBound(nby) .and. y1d.lt.binyBound(nby+1))
>        if (.not.ismissing(iy(0))) then
>            do nbx=0,nbinsx-1
>               pdf2(nby,nbx) = num(x1d(iy).ge.binxBound(nbx) .and. \
>                                   x1d(iy).lt.binxBound(nbx+1)     )
>            end do
>        end if
>        delete(iy)      ; size may change
>     end do
>
>
>
>
>
>
>
>
> On Feb 20, 2019, at 3:30 PM, Dennis Shea <shea at ucar.edu> wrote:
>
> Hi Jonathan,
>
> No. The pdfxy/pdfxy_bin are 'cartesian oriented' (if there is such a
> thing!).
> Hence, x/y rathern tha lat/lon.
>
> D
>
> On Wed, Feb 20, 2019 at 6:40 AM Buzan, Jonathan <jbuzan at purdue.edu> wrote:
>
>> Hello NCL-Talk,
>>
>> Do the pdfxy/pdfxy_bin functions account for lat-lon grid cell size
>> changes? i.e. if there is no accounting for weights, the number of events
>> at >30° are 2x to the number events at <30°, even though there are equal
>> area.
>>
>> -Jonathan
>>
>>
>> _______________________________________________
>> 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/20190405/41fc5583/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst_pdfxyz.ncl
Type: application/octet-stream
Size: 3241 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190405/41fc5583/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PDFXYZ.ncl
Type: application/octet-stream
Size: 6710 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190405/41fc5583/attachment-0001.obj>


More information about the ncl-talk mailing list