comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDL Error GCPC data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
IDL Error GCPC data [message #69259] Wed, 23 December 2009 23:27 Go to next message
sampton is currently offline  sampton
Messages: 8
Registered: December 2009
Junior Member
Good day Evrybody,
I'm trying to retreive data from binary file using this idl procedure
but can't make it to run properly under idl71, any help can be
appreciated, the file is located at:
http://www1.ncdc.noaa.gov/pub/data/gpcp/gpcp-v2.1/software/r ead_v2.1_file.pro
and it's the procedure to get GCPC data.
Thanks again for you help.
S.S.
Re: IDL Error GCPC data [message #69319 is a reply to message #69259] Wed, 06 January 2010 10:55 Go to previous message
jeanh is currently offline  jeanh
Messages: 79
Registered: November 2009
Member
sampton wrote:
> Hi,
> I tried this code but got a santax error for .[j] when removing the
> dot (.) I got an error about 'j':

> PrintF, lun, fields[j], ': ', struct.[j]
>
> with .j Error:
> IDL> PrintF, lun, fields[j], ': ', STRUC1979.[j]
>
> PrintF, lun, fields[j], ': ', STRUC1979.[j]
> ^
> % Syntax error.

hi,
use () instead of [] STRUC1979.(j)

Jean
Re: IDL Error GCPC data [message #69320 is a reply to message #69259] Wed, 06 January 2010 10:42 Go to previous message
sampton is currently offline  sampton
Messages: 8
Registered: December 2009
Junior Member
Hi,
I tried this code but got a santax error for .[j] when removing the
dot (.) I got an error about 'j':

fields = Tag_Names(struct)
OpenW, lun, 'C:\cgcp\data.txt', /Get_Lun
FOR j=0,N_Elements(fields)-1 DO $
PrintF, lun, fields[j], ': ', struct.[j]
Free_Lun, lun

Error:

IDL> PrintF, lun, fields[j], ': ', struc1979[j]
% Attempt to subscript STRUC1979 with J is out of range.
% Execution halted at: $MAIN$


with .j Error:
IDL> PrintF, lun, fields[j], ': ', STRUC1979.[j]

PrintF, lun, fields[j], ': ', STRUC1979.[j]
^
% Syntax error.




On 4 jan, 21:17, David Fanning <n...@dfanning.com> wrote:
> sampton writes:
>> Thanks again for your help,
>> I'm just wondering how I can save struct to data.txt after executing
>> the command under IDL:
>> IDL> read_v2_1, 'gpcp_v2.1_psg.1979', struct
>> I want to save struct to data.txt to be oppened with text editor under
>> windows (so data.txt wil be located under a spedcific folder say: c:
>> \cgcp\data.txt).
>
> I'd try something like this:
>
>    fields = Tag_Names(struct)
>    OpenW, lun, 'C:\cgcp\data.txt', /Get_Lun
>    FOR j=0,N_Elements(fields)-1 DO $
>        PrintF, lun, fields[j], ': ', struct.[j]
>    Free_Lun, lun
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: IDL Error GCPC data [message #69344 is a reply to message #69259] Mon, 04 January 2010 18:17 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
sampton writes:

> Thanks again for your help,
> I'm just wondering how I can save struct to data.txt after executing
> the command under IDL:
> IDL> read_v2_1, 'gpcp_v2.1_psg.1979', struct
> I want to save struct to data.txt to be oppened with text editor under
> windows (so data.txt wil be located under a spedcific folder say: c:
> \cgcp\data.txt).

I'd try something like this:

fields = Tag_Names(struct)
OpenW, lun, 'C:\cgcp\data.txt', /Get_Lun
FOR j=0,N_Elements(fields)-1 DO $
PrintF, lun, fields[j], ': ', struct.[j]
Free_Lun, lun

Cheers,

David




--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ITT VIS at the 90th AMS Annual Meeting
Next Topic: Mosaic_doit in IDL gives a different result that the ENVI mosaic tool

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:44:41 PDT 2025

Total time taken to generate the page: 0.00511 seconds