[ncl-talk] Total by class of data

Kiswendsida Hyacinthe GUIGMA karongseba at gmail.com
Fri Dec 15 05:08:45 MST 2017


Hi Dennis!Many thanks for your help. Specially your information about the coordinates sub-scripting is useful because I use largely GPCP data.Concerning my problem, I was already aware of the calculate_segment_values function. It is just that I am using an older version of NCL that allows me not to use it. The idea is actually to do the same as this function but using an older version (as I am working in a desktop on which I am not allowed to update anything). 
So if you have idea this difficulty it will be very well for me.Thank you!
 -----------------------------
GUIGMA 

    On Friday, 15 December 2017, 2:39, Dennis Shea <shea at ucar.edu> wrote:
 

 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 valuesKindest 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





   
______________________________ _________________
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/20171215/aabc1f8d/attachment.html>


More information about the ncl-talk mailing list