[gradsusr] Station data

itesh dash itesh at rimes.int
Thu Feb 18 09:34:51 EST 2016


Hi Davies,

You can user the cookbook recipe:005 . I found it very useful.

http://cookbooks.opengrads.org/index.php?title=Recipe-005:_Creating_GrADS_binary_station_data_from_ASCII

just copy the stngrads.cpp file and the station.h file to local directory
and compile with g++ or any c++ compiler

like g++ stationgrads.cpp -o stngrads

this will generate the executable stngrads

then use it as

./stngrads stationfile.txt station.bin L/U ( L for lat/long and U for UTM)

Attached are both files and the executable also.

Thanks to the original developer. It was very useful for me.

PS: make sure your Lat Lon column are in the correct order. Thats may be a
reason stations being plotted at wrong location.

Afterwards, you can use the oacres function to interpolate and view the
data to model grid if thats something you want to do.

Hope this is helpful.

Regards,
itesh


On Thu, Feb 18, 2016 at 7:01 PM, Thomas Davies <tsd.davies at gmail.com> wrote:

> I just tried to run station2modelgrid.c on the above text file, however
> when I plot in GrADS there are only 2 values in the wrong place
>
>
>>
> On Thu, Feb 18, 2016 at 11:56 AM, Thomas Davies <tsd.davies at gmail.com>
> wrote:
>
>> Do you mean like the attached file?
>>
>> On Thu, Feb 18, 2016 at 2:15 AM, Jayakrishnan P.R <
>> prjayakrishnan at gmail.com> wrote:
>>
>>> I think the problem is with the exact reading of the text file and
>>> writing as binary file due to formatting. Could you send me the unformatted
>>> text file may be like this. I have done this without formatting as your
>>> case.
>>> *2016 02 17 22 station1 60.749 -0.854 1005 *
>>> *2016 02 17 22 station2 60.139 -1.183 1006 *
>>> *2016 02 17 22 **station3 60.447 -1.277 950  *
>>>
>>> On Thu, Feb 18, 2016 at 7:04 AM, Thomas Davies <tsd.davies at gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I am trying to plot station data recieved from UKMO datapoint. I have
>>>> written the data to a text file like this (Following the tutorial here:
>>>> http://cookbooks.opengrads.org/index.php?title=Recipe-013:_Gridding_and_Plotting_Station_Data
>>>> ):
>>>>
>>>>
>>>> *2016 02 17 22 station1 60.749 -0.854 1005 2016 02 17 22 station2
>>>> 60.139 -1.183 1006 2016 02 17 22 station3 60.447 -1.277 950 2016 02 17 22
>>>> station4 60.111 -2.063 1004 2016 02 17 22 station5 58.954 -2.9 1006 2016 02
>>>> 17 22 station6 58.214 -6.325 1004 2016 02 17 22 station7 57.725 -4.896 1007
>>>> 2016 02 17 22 station8 57.859 -5.636 1006 2016 02 17 22 station9 57.257
>>>> -5.809 1007 2016 02 17 22 station10 57.4175 -5.689 950 2016 02 17 22
>>>> station11 58.288 -4.442 1006 2016 02 17 22 station12 56.867 -4.708 1009
>>>> 2016 02 17 22 station13 57.819 -3.966 1007 2016 02 17 22 station14 57.206
>>>> -3.827 1008 2016 02 17 22 station15 57.116 -3.642 950 2016 02 17 22
>>>> station16 57.6494 -3.5606 1007 2016 02 17 22 station17 57.712 -3.322 1007
>>>> 2016 02 17 22 station18 58.454 -3.089 1006 2016 02 17 22 station19 57.077
>>>> -2.836 1009 2016 02 17 22 station20 57.206 -2.202 1008 2016 02 17 22
>>>> station21 56.497 -6.887 1007 2016 02 17 22 station22 55.681 -6.256 1009
>>>> 2016 02 17 22 station23 55.441 -5.699 1009 2016 02 17 22 station24 54.859
>>>> -4.936 1011 2016 02 17 22 station25 55.907 -4.533 1010 2016 02 17 22
>>>> station26 55.515 -4.585 1010 2016 02 17 22 station27 56.326 -3.729 1009
>>>> 2016 02 17 22 station28 56.423 -4.32 950 2016 02 17 22 station29 54.803
>>>> -4.008 1010 2016 02 17 22 station30 55.627 -3.735 1010 2016 02 17 22
>>>> station31 55.709 -2.383 1009 2016 02 17 22 station32 55.928 -3.343 1009
>>>> 2016 02 17 22 station33 56.377 -2.862 1009 2016 02 17 22 station34 54.0849
>>>> -4.6321 1011 2016 02 17 22 station35 54.5181 -3.615 1011 2016 02 17 22
>>>> station36 54.614 -3.157 1011 2016 02 17 22 station37 54.125 -3.257 1010
>>>> 2016 02 17 22 station38 54.933 -2.963 1010 2016 02 17 22 station39 55.05
>>>> -2.553 1010 2016 02 17 22 station40 54.501 -2.684 1011 2016 02 17 22
>>>> station41 54.572 -2.413 1010 2016 02 17 22 station42 54.684 -2.45 950 2016
>>>> 02 17 22 station43 55.285 -2.279 1010 2016 02 17 22 station44 55.02 -1.88
>>>> 1009 2016 02 17 22 station45 55.421 -1.6 1009 2016 02 17 22 station46
>>>> 54.204 -1.39 1010 2016 02 17 22 station47 54.563 -0.863 1009 2016 02 17 22
>>>> station48 54.362 -0.673 950 2016 02 17 22 station49 54.094 -0.174 1008 2016
>>>> 02 17 22 station50 53.252 -4.537 1011 *
>>>>
>>>> I wrote it in the exact same format as the link above and ran
>>>> station2modelgrid.c (using TCC compiler for windows), as well as stnmap
>>>> with this descriptor file:
>>>>
>>>> *DSET ^station.dat*
>>>> *DTYPE station*
>>>> *STNMAP ^station.map*
>>>> *UNDEF -999.0*
>>>> *TITLE station data test*
>>>> *TDEF 1 linear 22Z17FEB2016 1mo*
>>>> *VARS 1*
>>>> *slp  0  99  SLP*
>>>> *ENDVARS*
>>>>
>>>> However when I open station.ctl in GrADS and plot the slp variable no
>>>> values are displayed. I have tried changing the format of the text
>>>> file/C-script however nothing has worked for me.
>>>>
>>>> If anybody can spot a problem or provide an alternative C script with
>>>> notes about the text file formatting (I don't know any C or Fortran)
>>>>
>>>> Thanks in advance.
>>>>
>>>> _______________________________________________
>>>> gradsusr mailing list
>>>> gradsusr at gradsusr.org
>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>>
>>>>
>>>
>>>
>>> --
>>> Sincerely
>>>
>>> **************************************************
>>> Dr. Jayakrishnan P.R
>>> Post Doctoral Research Fellow
>>> C308, Institute of Ocean and Earth Sciences (IOES)
>>> University of Malaya
>>> 50603, Kuala Lumpur
>>> Tel: (+603) 7967 4640 / 6995
>>> Mobile: 012-3526094
>>>
>>> ****************************************************
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160218/286b2fd1/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stn.png
Type: image/png
Size: 264391 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20160218/286b2fd1/attachment-0001.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: station.h
Type: text/x-chdr
Size: 2825 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20160218/286b2fd1/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stngrads
Type: application/octet-stream
Size: 55092 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20160218/286b2fd1/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stngrads.cpp
Type: text/x-c++src
Size: 7906 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20160218/286b2fd1/attachment-0003.bin 


More information about the gradsusr mailing list