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

Home » Public Forums » archive » Writting intoFile
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
Writting intoFile [message #92755] Thu, 25 February 2016 05:23 Go to next message
Sapna Mishra is currently offline  Sapna Mishra
Messages: 66
Registered: December 2015
Member
Hello all,

I am dealing with an array say: A FLOAT [2094,5]
I want to write this array into a file using IDL how should I do that???

Also In second part I want 2094 rows to be saved into another file as a column.

Can anyone help me in this?

Thanks and regards,
Sapna
Re: Writting intoFile [message #92756 is a reply to message #92755] Thu, 25 February 2016 07:49 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
On 02/25/16 08:23, Sapna Mishra wrote:
> Hello all,
>
> I am dealing with an array say: A FLOAT [2094,5]
> I want to write this array into a file using IDL how should I do that???
>
> Also In second part I want 2094 rows to be saved into another file as a column.
>
> Can anyone help me in this?

Open the file
http://www.harrisgeospatial.com/docs/GET_LUN.html
http://www.harrisgeospatial.com/docs/OPEN.html

Write the data to file
http://www.harrisgeospatial.com/docs/PRINT.html
for ASCII output.

Play around with writing the array directly to file, as well as the
TRANSPOSE of the array to see how that affects the output format:
http://www.harrisgeospatial.com/docs/TRANSPOSE.html

Close the file
http://www.harrisgeospatial.com/docs/FREE_LUN.html
http://www.harrisgeospatial.com/docs/CLOSE.html

cheers,

paulv
Re: Writting intoFile [message #92757 is a reply to message #92755] Thu, 25 February 2016 10:24 Go to previous messageGo to next message
Sapna Mishra is currently offline  Sapna Mishra
Messages: 66
Registered: December 2015
Member
Yes I am doing the same,

IDL> a=mrdfits('2QZJ0234_CHIP1_GRIS_600V_SCIENCE_SKY_SPECTRUM_FOR S1.2007_11_12T05_08_04.084redwave.fits',0,h)
MRDFITS: Image array (2094,5) Type=Real*4
IDL>fname='data1.dat'
IDL> OPENW,1,fname
IDL> PRINTF,a
then i am getting error:
% PRINTF: Expression must be a scalar or 1 element array in this context: A.
% Execution halted at: $MAIN$

I don't know how to solve this error. Any idea??
Re: Writting intoFile [message #92758 is a reply to message #92757] Thu, 25 February 2016 10:31 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Hello,

On 02/25/16 13:24, Sapna Mishra wrote:
> Yes I am doing the same,
>
> IDL> a=mrdfits('2QZJ0234_CHIP1_GRIS_600V_SCIENCE_SKY_SPECTRUM_FOR S1.2007_11_12T05_08_04.084redwave.fits',0,h)
> MRDFITS: Image array (2094,5) Type=Real*4
> IDL>fname='data1.dat'
> IDL> OPENW,1,fname
> IDL> PRINTF,a
> then i am getting error:
> % PRINTF: Expression must be a scalar or 1 element array in this context: A.
> % Execution halted at: $MAIN$
>
> I don't know how to solve this error. Any idea??

Yes. It is a syntax error.

See http://www.harrisgeospatial.com/docs/PRINT.html

cheers,

paulv
Re: Writting intoFile [message #92759 is a reply to message #92755] Thu, 25 February 2016 10:38 Go to previous messageGo to next message
Sapna Mishra is currently offline  Sapna Mishra
Messages: 66
Registered: December 2015
Member
I even tried
PRINTF,a,FORMAT='(F1.5,F1.5,F1.5)' but same error
Re: Writting intoFile [message #92760 is a reply to message #92755] Thu, 25 February 2016 10:43 Go to previous message
Sapna Mishra is currently offline  Sapna Mishra
Messages: 66
Registered: December 2015
Member
Ok I got the point, I should mention the unit.

Thanks....
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Build 2D array from loops
Next Topic: Check for duplicate locations

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

Current Time: Wed Oct 08 07:23:59 PDT 2025

Total time taken to generate the page: 0.00383 seconds