Re: Writing float array to file [message #91428 is a reply to message #91426] |
Tue, 14 July 2015 03:22  |
Nikola
Messages: 53 Registered: November 2009
|
Member |
|
|
It means that you're missing the unit in the call of PRINTF
b1=foldername[f]+'\b1.csv'
OPENW, 1, b1
PRINTF, 1, variables[0]
CLOSE, 1
Anyway, it likely won't do what you want as variables[0] is just the first element of your matrix.
b1 = foldername[f]+'\b1.csv'
OPENW, un, b1, /get_lun
PRINTF, un, variables
FREE_LUN, un
In any case what you'll get is not really a csv (comma separated values) file. If that's what you want, then try to google how to write csv from IDL. If you plan to use the data for further analysis in IDL, csv is not very smart choice - one would rather go for plain ascii table, binary or the native IDL .sav format.
On Tuesday, July 14, 2015 at 9:56:16 AM UTC+1, Kai Heckel wrote:
> Hey there!
>
> I have a quite simple problem but I didn't find a solution yet.
>
> Given a float array with the dimensions 2048*5492 ("variables[0]"), I want to put these files in a .csv-file...
>
> This is what I have:
>
> b1=foldername[f]+'\b1.csv'
> OPENW,1,b1
> PRINTF,variables[0]
> CLOSE,1
>
> The error I get is:
>
> PRINTF: Expression must be a scalar or 1 element array in this context: <FLOAT Array[2048, 5492]>.
>
> What does it mean?
>
> Thanks
|
|
|