[ncl-talk] Total by class of data
Dennis Shea
shea at ucar.edu
Thu Dec 14 19:39:32 MST 2017
To be honest, I'm confused.
---
Attached is a version of 'code.ncl' that includes many *'printVarSummary*'.
It uses a local GPCP 1DDD file.
Please examine the output so you can follow what is happening.
For example look at the printVarSummary(xtemp) before and after the '
*lonFlip*'
A few comments:
[1] GPCP uses longitude coordinates that span 0.5 to 359.5.
Your code has:
f=addfile("GPCP__V1_2dd__PRECIP__1x1__alltimes.nc","r")
y=f->precip
x=y(:,{-0.50:30.5},*{349.5:10.5}*)
NCL's coordinate subscripting can not correctly span these values. It will
return numbers BUT they are not for the region you want.
NCL requires that the grid be 'flipped' so that it spans -179.5 to 179.5.
Then, the following coordinate subscripting could be used:* {-10.5:10.5} *
[2] I do not know what 'classes' mean in you code description.
[3] For illustration, I used NCL 6.4.0's '*calculate_segment_values*' to
calculate *pentad *averages.
https://www.ncl.ucar.edu/Document/Functions/Contributed/calculate_segment_values.shtml
Hopefully, it will help you get what you want.
On Thu, Dec 14, 2017 at 1:32 PM, Kiswendsida Hyacinthe GUIGMA <
karongseba at gmail.com> wrote:
> Hi dear Mary,
> By "it doesn't work" I mean that I can't get the result I want.
> My data come from a pre-processing. Originally, I used GPCP daily data,
> extracted my desired region and averaged zonally. I also averaged it over
> some latitudes to finally have data at 1D (time). Then I replaced the time
> coordinates by other values to take into account the classes. The classes I
> am considering here are pentads: I affected to each day a pentad number
> that includes year. So in that present case, I would like to process the
> totals for each pentad. Attached:
> 1-the code I used
> 2-the time-series of rr obtained
> 3-the coordinate values
> Kindest regards
>
> -----------------------------
> GUIGMA
>
>
> On Thursday, 14 December 2017, 16:29, Mary Haley <haley at ucar.edu> wrote:
>
>
> Dear Guigma,
>
> It helps if you can provide more information beyond "it doesn't work".
>
> That is, how is it not working? Are you getting a error? If so, it helps
> if you can provide the code that is producing the error and the full error.
>
> Thanks,
>
> --Mary
>
>
>
>
> On Thu, Dec 14, 2017 at 3:53 AM, Kiswendsida Hyacinthe GUIGMA <
> karongseba at gmail.com> wrote:
>
> Hi everyone!
> I have a 1D rainfall amounts timeseries. My coordinate is "qualitative",
> which means that they represent categories. I just separated my data
> following many classes of rainfall (rr<1mm, 1<=rr<5, 5<=rr<10 ...) and to
> each category I affect a distinct number (0,1,2,,,...). I would like to
> process the total for each class of data. I tried to use the where
> function but it doesn't work.
> Your help is greatly appreciated.
>
> -----------------------------
> GUIGMA
>
> ______________________________ _________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/ mailman/listinfo/ncl-talk
> <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>
>
>
>
>
> _______________________________________________
> 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/20171214/7904566a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: code.ncl
Type: application/octet-stream
Size: 2296 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171214/7904566a/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: out.code
Type: application/octet-stream
Size: 5197 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171214/7904566a/attachment-0001.obj>
More information about the ncl-talk
mailing list