[gradsusr] Masked data output to text file

Jeff Duda jeffduda319 at gmail.com
Wed Jun 29 14:56:45 EDT 2016


Justin,
Build up a string variable and write the string to your data file. You'll
have to pull each value after issuing the display command, then add each
piece to the full string variable.

Jeff Duda

On Wed, Jun 29, 2016 at 1:48 PM, Justin Hicks <jhicks2014 at gmail.com> wrote:

> 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
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Post-doctoral research associate
University of Oklahoma School of Meteorology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160629/14a62153/attachment.html 


More information about the gradsusr mailing list