[gradsusr] extract station data

Walter Arnoldo Bardales Espinoza bardaleswa at gmail.com
Mon Aug 13 14:58:50 EDT 2018


I share this example, I hope it serves you, I use it to extract the
forecast data of rain and temperatures.


'open wrf_00z.ctl'

* imports a file with the location data of the stations
input='/home/meteorology/Documents/scripts/stations_pptmaxmin.txt'

'set t 2'
'query time'
say result
cdate=subwrd(result,3)
date=substr(cdate,4,12)

cont=1
while(cont<=3)
rec=read(input)
plat=subwrd(rec,3)
plon=subwrd(rec,2)
name_est=subwrd(rec,4)

'set lat 'plat
'set lon 'plon

'd apcpsfc(t=37)-apcpsfc(t=13)'
respuesta=result
lluvias=sublin(respuesta,1)
dpp1=subwrd(lluvias,4)

'd max(tmax2m-273.15,t=14,t=37)'
respuesta=result
tmaxs=sublin(respuesta,2)
tmax1=subwrd(tmaxs,4)

'd min(tmin2m-273.15,t=14,t=37)'
respuesta=result
tmins=sublin(respuesta,2)
tmin1=subwrd(tmins,4)

* Write a file
res=write('/home/meteorology/Documents/data/data_'date'.txt', plon-360'
'plat' 'name_est' 'dpp1' 'tmax1' 'tmin1)

cont=cont+1
endwhile



format of file stations



2018-08-13 12:22 GMT-06:00 Charles Langton Vanya <dolesibeni at gmail.com>:

> Dear,
> I believe you are meaning extracting data from netcdf file.
> The best way I do is to average data from a grid box of the area.
>  The reason for doing this is to make sure that your data is a
> representation of the area you are interested inother than just
>  a single a single point.
> This can be in so many ways. But the simolest I can remember is like this:
>
> *****THIS SCRIPT EXTRACT SEA SURFACE TEMPERATURES FOR GRID BOX
> **LONG 129E to 131E and LAT 20.0N to 24.0N
>
> 'reinit'
> 'sdfopen C:\fortran\sst\2018sst.nc'
> 'set x 1'
> 'set y 1'
> ** set your area1 here..If your data has high resoultion you can set your
> area too closer
> lon1 =129.0
> lon2 =131.0
> lat1 =20.0
> lat2 =24.0
>
> ** Keep time fixed as below.. Here time is taken as starting from value 1
> to 703
> ** you can also set your time by exactly setting 'set t hhddmmyy'
>
> 'set t 1 703'
> ** Here we are finding areal average of the grid.
>
> 'define ssst = aave(sst,lon = 'lon1',lon = 'lon2', lat =
> 'lat1',lat='lat2')'
>
> ** set file name to pring oout... Here we are saving data as 12 month data
> table
> 'fprintf ssst C:\fortran\SST_EXTRACT\DJF\REG2\REG2\R2DJF_SJPAN.txt %g 12
> 1'
>
> The data is save as a text file and in a single column. If you you want
> the data to be extracted as monthly then you use 1 12 instead of 1 1
> meaning
> that you will have 12 columns representing months of the year.
> Hope this helps.
> Thank
> Regards,
> Charles Vanya
>
> On Mon, 13 Aug 2018 at 15:12, Davide Sacchetti <
> davide.sacchetti at arpal.gov.it> wrote:
>
>> is file in station data format? if yes use gxout print
>>
>>
>> * From: * E Mobarak <mobarak_e at yahoo.com>
>> * To: * <gradsusr at gradsusr.org>
>> * Sent: * 8/11/2018 6:09 PM
>> * Subject: * [gradsusr] extract station data
>>
>> Hi
>> how i can extract data for some station with different latitude and
>> longitude, by loop or function in scripts
>> thanks
>>
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>
>
> --
> Meteorological Services
> P.O.Box 1808,
> Blantyre,
> Malawi
> Cell:+265-888-980 545
>  00265111939610
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Atte.
Walter Arnoldo Bardales Espinoza
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20180813/7a325c04/attachment.html>
-------------- next part --------------
270.1336111	16.91472222	Flores_aeropuerto__Flores__Petén
269.5611111	16.06666667	San_Agustín_Chixoy__Chisec__Alta_Verapaz
269.1955556	16.80111111	Bethel__La_Libertdad__Petén


More information about the gradsusr mailing list