[gradsusr] Median for ensembles.

Mike NOAA imap michael.fiorino at noaa.gov
Tue May 8 14:25:30 EDT 2012


hi Dave, I implemented a user-defined function 'grhist' that would 
calculate the 'cut points' or percentiles.  the 50th percentile would be 
your median... the problem is inputting a grid with some dimension 
environment but returning a different one.  I've thought about 
reimplementing in opengrads, but these days would probably do the 
problem in pygrads, i.e., use the python interface to pull the grid from 
grads into python, use numpy to find the median, and then return the 
median as a grid for display in grads.  recommend you get started with 
opengrads.org and the enthought python distribution that has numpy 
(plus  a lot of other modules)  built in...

Best Regards, Mike

"Well Mike, it just goes to show ya, it's always something--if it ain't 
one thing, it's another"
-- Roseanne Roseannadanna

Dr. Michael Fiorino, Commander, US Navy (retired)
Assimilation and Modeling Branch
GSD/ESRL/NOAA
325 Broadway
R/GSD1
Boulder, CO 80305

michael.fiorino at noaa.gov (work)
mfiorino at gmail.com (home)

+1 303-497-6379 (work)
+1 720-204-0876 (mobile)

GSD/ESRL/NOAA is the
Global Systems Division/
Earth Systems Research Laboratory/
National Oceanic and Atmospheric Administration

On 2012-05-07 18:39 , Ryglicki, David CIV FNMOC wrote:
> Hello, everyone.
>
> The frame for this question is plotting a median line (as opposed to a mean) for a box-whisker plot. The logic surrounding the plot, I get, but my question is specifically about the middle of my script.
>
> The way I have it now, I set lat/lon/height, loop the ensemble members in a while loop, and store the value at that point for each ensemble in a dummy variable (emem.ee). I then run that through a bubble sort, figure out if there's an odd or even number of ensemble members, do the math, and boom, we have a median - med.tt, with tt being the time index.
>
> My question is how do I get the variables in med.tt into a displayable grads variable - say, "median" - so that when I'm finally getting ready to plot, I can just type in "d median?" Is this even possible via some combination of tloop and define? Should I remove this process from GrADS entirely and compute it in a Fortran program?
>
> Additionally, if anyone out there in gradsusr land has a script for computing and plotting median in a line graph, I would not say no to that. I couldn't find one in several attempted Google searches.
>
> David Ryglicki, Ph.D.
> N3 Models
> Fleet Numerical Meteorology and Oceanography Center
> Bldg 702, Rm 146
> Office: 831|656|4519
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20120508/292781b3/attachment-0003.html 


More information about the gradsusr mailing list