[gradsusr] Standard Deviation with aave

Justin Hicks jhicks2014 at gmail.com
Wed Jun 7 16:26:53 EDT 2017


GrADS users,

I am trying to compute the standard deviation of each time step, from t=1
to t=434...so I want 434 values to output. I am taking the area-averaged
(aave) baseflow data of a shapefile spanning 434 months.

I know that sqrt*[(x1-xbar)**2 + (x2-xbar)**2 + (x3-xbar)**2** +....+
(xN-xbar)**2 ]/(N-1) *
would give me the standard deviation, but I am confused on how to use the
'aave' function along with this formula. In other words, I want the
standard deviation of this 'aave' value. So far, I have:

**************
'reinit'

*opens file

'sdfopen /data2/control/MERRA2_Mon_BaseFlowFlux_1980_2016.rmp.nc'
'set t 1'

it=1

while (it <=436)
'set t 'it

*opens mask file

'open /data2/control/Region13_SAm_mask_MERRA2.nc'

*aave of masked area

'd
aave(maskout(baseflow.1*86400,lterp(mask.2(time=00Z01JAN1980),baseflow.1)),g)'

say result

it=it+1
endwhile

******************

I have tried the following commands to find standard deviation of this
area-averaged mask, but I am not sure if they are correct:

1.
'd
sqrt(ave(pow(maskout(baseflow*86400,lterp(mask.2(time=00Z01JAN1980),baseflow.1)),2),t=1,t=434))'
say result

2.
'define BaseMed = ave(baseflow*86400,t=1,t=434)'
say ''result''
'define BaseStd =
sqrt(pow(maskout(baseflow*86400-BaseMed,lterp(mask.2(time=00Z01JAN1980),baseflow.1)),2)/435)'
'd BaseStd'
say ''result''

3.
'd
sqrt(pow(aave(maskout(baseflow.1*86400,lterp(mask.2(time=00Z01JAN1980),baseflow.1)),g)-baseflow.1,2)))'

Are any of these close to being right? How else could I go about finding
the Std. Deviation of an area-averaged location?

-Justin

-- 
*Justin Hicks*

*UndergraduateAtmospheric Sciences Major*

*GIS MinorUniversity of Maryland-College Park*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20170607/008b2253/attachment.html 


More information about the gradsusr mailing list