[gradsusr] [BULK] Re: opening text file data

Muhammad Rahiz muhammad.rahiz at ouce.ox.ac.uk
Tue Feb 8 10:23:03 EST 2011


I am able to run the script. See results below

lat is -18.38 lon is 21.85 and the city is Shakawe
start is 1
lat is -17.82 lon is 25.15 and the city is Kasane
start is 2
lat is -19.98 lon is 23.42 and the city is Maun
start is 3
lat is -18.55 lon is 25.63 and the city is Pandamatenga
start is 4
lat is -20.52 lon is 26.10 and the city is Sua_Pan
start is 5
lat is -21.42 lon is 25.62 and the city is Letlhakane
start is 6
lat is -21.17 lon is 27.52 and the city is Francistown
start is 7
lat is -21.97 lon is 27.83 and the city is Selibe_Phikwe
start is 8
lat is -23.12 lon is 26.83 and the city is Mahalapye
start is 9
lat is -24.67 lon is 25.92 and the city is SSKA
start is 10
lat is -24.58 lon is 24.80 and the city is Jwaneng
start is 11
lat is -25.47 lon is 25.43 and the city is Good_Hope
start is 12
lat is -26.22 lon is 22.40 and the city is Tsabong
start is 13
lat is -24.02 lon is 21.88 and the city is Tshane
start is 14
lat is -25.27 lon is 23.25 and the city is Werda
start is 15
lat is -21.68 lon is 21.63 and the city is Gantsi
start is 16
lat is -22.38 lon is 26.72 and the city is Serowe
start is 17
lat is -24.38 lon is 25.50 and the city is Molepolole
start is 18
lat is -25.75 lon is 28.20 and the city is Pretoria
start is 19
lat is -33.92 lon is 18.45 and the city is Cape_Town
start is 20
lat is -22.57 lon is 17.10 and the city is Windhoek
start is 21
lat is -17.83 lon is 31.05 and the city is Harare
start is 22
lat is -29.32 lon is 27.48 and the city is Maseru
start is 23
lat is -26.33 lon is 31.13 and the city is Manzini
start is 24
lat is -25.97 lon is 32.58 and the city is Maputo
start is 25
last city is 24
No scaling environment

This means x is environment and y is
DRAW error: Syntax is DRAW MARK marktype x y size
Non-numeric args to numeric operation
   Error occurred on line 53
   In file city_plot.gs


-- 
Muhammad Rahiz
Researcher & DPhil Candidate (Climate Systems & Policy)
School of Geography & the Environment
University of Oxford

On Tue, 8 Feb 2011, Galebonwe Ramaphane wrote:

> Muhammad,
>
> I'm also running GrADS on linux. I have gone over the code several times. It's one of those annoying problems. I'll attach the sample script and the text file for your inspection.
>
> Galebonwe Ramaphane
> Department of Meteorological Services
> P.O. BOX 10100
> Gaborone
> Botswana
> Tel: +267 3612200
>  Mobile: +267 74435261
>
>
> -----Original Message-----
> From: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Muhammad Rahiz
> Sent: Tuesday, February 08, 2011 10:36 AM
> To: GrADS Users Forum
> Subject: [BULK] Re: [gradsusr] opening text file data
> Importance: Low
>
> Galebonwe,
>
> I'm using GrADS on linux and as far as I know, if your text file is in the same directory as your script, you don't have to put in the full path.
> I'm not sure if it's different on Windows although I doubt so. I presume you've checked your code?
>
> Muhammad Rahiz
> Researcher & DPhil Candidate (Climate Systems & Policy) School of Geography & the Environment University of Oxford
>
> On Tue, 8 Feb 2011, Galebonwe Ramaphane wrote:
>
>> I have a similar but minor problem. My calling script does not see the text file. I tried putting the text file in the same directory as the calling script. I still failed to read the text file. Do I include the full path of the text file?
>>
>> Galebonwe Ramaphane
>> Department of Meteorological Services
>> P.O. BOX 10100
>> Gaborone
>> Botswana
>> Tel: +267 3612200
>>  Mobile: +267 74435261
>>
>> -----Original Message-----
>> From: gradsusr-bounces at gradsusr.org
>> [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Muhammad Rahiz
>> Sent: Monday, February 07, 2011 6:32 PM
>> To: GrADS Users Forum
>> Subject: Re: [gradsusr] opening text file data
>>
>> James, you can try the following.
>>
>> *****
>>
>> 'sdfopen ifile.nc'
>>
>> * ttot = number of lines in text file
>> ttot = 755
>> tx = 1
>> while(tx<=ttot)
>> fname ='7hA01.out.txt'
>>  rec = read(fname)
>>  IO = sublin(rec,1)
>>   if(IO = 1)
>>    say fname' > File open error'
>>    'quit'
>>   endif
>>  if(IO = 0)
>>    t1 = subwrd(rec,2)
>>    t2 = subwrd(rec,3)
>>   endif
>> say ''t1' 't2''
>>
>> tx = tx +1
>> endwhile
>>
>> *****
>>
>> --
>> Muhammad Rahiz
>> Researcher & DPhil Candidate (Climate Systems & Policy) School of
>> Geography & the Environment University of Oxford
>>
>> On Mon, 7 Feb 2011, James Ciarlo` wrote:
>>
>>> Hi,
>>> I have several text files such as the one I attached and I need to
>>> open them which GrADS but I cannot understand how to do so. Can
>>> someone help me please?
>>>
>>> James
>>>
>>>
>> _______________________________________________
>> 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
>>
>


More information about the gradsusr mailing list