<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
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...<br>
<br>
Best Regards, Mike<br>
<br>
"Well Mike, it just goes to show ya, it's always something--if it
ain't one thing, it's another"<br>
-- Roseanne Roseannadanna<br>
<br>
Dr. Michael Fiorino, Commander, US Navy (retired)<br>
Assimilation and Modeling Branch<br>
GSD/ESRL/NOAA<br>
325 Broadway<br>
R/GSD1<br>
Boulder, CO 80305<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:michael.fiorino@noaa.gov">michael.fiorino@noaa.gov</a> (work)<br>
<a class="moz-txt-link-abbreviated" href="mailto:mfiorino@gmail.com">mfiorino@gmail.com</a> (home)<br>
<br>
+1 303-497-6379 (work)<br>
+1 720-204-0876 (mobile)<br>
<br>
GSD/ESRL/NOAA is the<br>
Global Systems Division/<br>
Earth Systems Research Laboratory/<br>
National Oceanic and Atmospheric Administration<br>
<br>
On 2012-05-07 18:39 , Ryglicki, David CIV FNMOC wrote:
<blockquote
cite="mid:5FD3A20F00B77242AC1B82ED75DD45D983103C@nawemuguez03v.nadsuswe.nads.navy.mil"
type="cite">
<pre wrap="">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
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
gradsusr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>
<a class="moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre>
</blockquote>
</body>
</html>