[ncl-talk] plotting station rainfall

Geeta Geeta geetag54 at yahoo.com
Sun Sep 20 03:58:58 MDT 2015


thanks karin. 
I tried a few things  ;1. changed the string variables to float.  But The markers were not plotted. 
Got the following warning message. 

Copyright (C) 1995-2014 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.2.1
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.

Variable: tStr
Type: string
Total Size: 20 bytes
            5 values
Number of Dimensions: 1
Dimensions and sizes:    [5]
Coordinates: 
Number Of Attributes: 1
  _FillValue :    missing


Variable: temptStr
Type: string
Total Size: 20 bytes
            5 values
Number of Dimensions: 1
Dimensions and sizes:    [5]
Coordinates: 
Number Of Attributes: 1
  _FillValue :    missing
(0)    missing
(1)    missing
(2)    missing
(3)    missing
(4)    missing
warning:stringtofloat: a bad value was passed; input strings must contain numeric digits, replacing with missing value
warning:stringtofloat: a bad value was passed; input strings must contain numeric digits, replacing with missing value
warning:stringtofloat: a bad value was passed; input strings must contain numeric digits, replacing with missing value
warning:stringtofloat: a bad value was passed; input strings must contain numeric digits, replacing with missing value


Variable: lat
Type: string
Total Size: 20 bytes
            5 values
Number of Dimensions: 1
Dimensions and sizes:    [5]
Coordinates: 
Number Of Attributes: 1
  _FillValue :    
(0)    lat  
(1)    12.57
(2)    12.3 
(3)    13.06
(4)    13.06


Variable: lon
Type: string
Total Size: 20 bytes
            5 values
Number of Dimensions: 1
Dimensions and sizes:    [5]
Coordinates: 
Number Of Attributes: 1
  _FillValue :    
(0)    lon  
(1)    77.38
(2)    78.18
(3)    77.24
(4)    77.24


Variable: hgt
Type: string
Total Size: 20 bytes
            5 values
Number of Dimensions: 1
Dimensions and sizes:    [5]
Coordinates: 
Number Of Attributes: 1
  _FillValue :    
(0)       hgt   
(1)       919.6 
(2)       882.2 
(3)       900   
(4)       900   


Variable: rf
Type: string
Total Size: 20 bytes
            5 values
Number of Dimensions: 1
Dimensions and sizes:    [5]
Coordinates: 
Number Of Attributes: 1
  _FillValue :    
(0)    rf
(1)    5.6
(2)    67.
(3)    0.1
(4)    0.1


Variable: lat_fl
Type: float
Total Size: 20 bytes
http://www.ncl.ucar.edu/

2.  Seeing this error, I changed my data file (input_new.txt) attached  in which I removed the top string
but still the the dots/markers are not plotted. 

3. Sending the script and the input files. 

pls suggest. 
thanks Geeta. 


     On Sunday, 20 September 2015 1:35 AM, Karin Meier-Fleischer <meier-fleischer at dkrz.de> wrote:
   

 Hi Geeta,
the error message is telling you what is wrong - type mismatch in gsn_add_polymarker. 
Take a look at the gsn_add_polymarker function page:http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_add_polymarker.shtml
gsn_add_polymarker wants to have a numeric type for x and y (in your case lon and lat).
function gsn_add_polymarker (
		wks  [1] : graphic,  
		plot [1] : graphic,  
		x    [*] : numeric,  
		y    [*] : numeric,  
		res  [1] : logical   
	)

	return_val [1] :  graphicIn your script the lat and lon arrays are defined as strings but gsn_add_polymarker expects a numeric type. Use tofloat() function for lat and lon conversion.
Bye,Karin

Am 19.09.2015 um 21:02 schrieb Geeta Geeta <geetag54 at yahoo.com>:
dear users. I am trying to plot station data and taking help of the some available scripts. (station_4.ncl)

I am getting this errorfatal:Argument type mismatch on argument (2) of (gsn_add_polymarker) can not coerce
fatal:["Execute.c":8578]:Execute: Error occurred at or near line 62 in file stn-v2.ncl

I am attaching my script. 
Kindly suggest what s the problem. 

when I execute this I get following......(4)    77.24


Variable: hgt
Type: string
Total Size: 20 bytes
            5 values
Number of Dimensions: 1
Dimensions and sizes:    [5]
Coordinates: 
Number Of Attributes: 1
  _FillValue :    
(0)       hgt   
(1)       919.6 
(2)       882.2 
(3)       900   
(4)       900   


Variable: rf
Type: string
Total Size: 20 bytes
            5 values
Number of Dimensions: 1
Dimensions and sizes:    [5]
Coordinates: 
Number Of Attributes: 1
  _FillValue :    
(0)    rf
(1)    5.6
(2)    67.
(3)    0.1
(4)    0.1
fatal:Argument type mismatch on argument (2) of (gsn_add_polymarker) can not coerce
fatal:["Execute.c":8578]:Execute: Error occurred at or near line 62 in file stn-v2.ncl

 
I am attaching my input file and the script.  Geeta.<stn-v2.ncl><input1.txt>_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk





  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150920/29c4fc45/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stn-v2.ncl
Type: application/octet-stream
Size: 2735 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150920/29c4fc45/attachment.obj 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: input1.txt
Url: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150920/29c4fc45/attachment.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: input_new.txt
Url: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150920/29c4fc45/attachment-0001.txt 


More information about the ncl-talk mailing list