[gradsusr] Masked data output to text file

Justin Hicks jhicks2014 at gmail.com
Wed Jun 29 14:48:49 EDT 2016


GrADS users,

I want to output data to a text file; I have a variety of masks that I am
using to get data from specific regions. I am running an area average of
monthly data from 1980-2016 using the 'maskout' function.

I want my data to output into 5 columns: 'Region'   'Month/Year(Date)'
'Precip(Data)'   'Max Value'   'Min Value'. I want these all to be in the
same row with their results underneath. So far, I only have part of a
script:

'reinit'
'open Region00_WLD_mask_TEST.nc'
'set t 13 last'
'set dfile 1'
'set lon -179.5 179.5'
'set lat -89.5 89.5'
'open /data2/control/MERRA2_PRECIP
'set dfile 2'
'set lon -179.5 179.5'
'set lat -89.5 89.5'
'set time 00Z01JAN1980 00Z01APR2016'
'set dfile 1'
'd
aave(maskout(VAR.2,mask.1(time=00Z01JAN1980)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)'
'set gxout print'
'set prnopts %6.2f 1 1'
write('MERRA2_MASK_DATA.txt', 'WLD   Mon/Yr   Precip   Max    Min')


I assume that there is no way to display the region unless you put it in
lat/lon coordinates, but how could I go about outputting the date, the
precipitation data, and the max/min data for each month? Also, this text
file will be added to with other masked variables, and I know I must use
the command 'apprend' somewhere.

-Justin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160629/12655291/attachment-0001.html 


More information about the gradsusr mailing list