Le samedi 21 novembre 2015 à 11:05 -0800, digxx a écrit :
> Though this is not a big issue since I can convert the strings to
> double as I want IDL still tells me the following
OK, so this is actually an issue in the interaction between Julia
-produced CSV and how IDL interprets it. Note that CSV files do not
have any notion of variable types, this is all a matter of parsing
conventions.

It seems that IDL doesn't like the fact that Julia writes floating
point values that happen to be integers without printing the decimal
point. Could you try editing the CSV file by hand and add '.' at the
end of all numbers that don't have it? If IDL reads it correctly as
doubles, we might want to do this by default.


(BTW, you never need to write 1:end: xx_s[1,1:end] can be written
 xx_s[1, :], and x[1:end] is simply x.)


Regards

> IDL>corr=read_csv(dir+'writecsv_test.csv')
> IDL> help,corr
> ** Structure <a683f30>, 4 tags, length=1176, data length=1176,
> refs=1:
>    FIELD1          DOUBLE    Array[21]
>    FIELD2          STRING    Array[21]
>    FIELD3          STRING    Array[21]
>    FIELD4          STRING    Array[21]
> 
> with the file generated by:
> a=collect(1:10);
> b=collect(0:0.1:2);
> c=zeros(1,1,10);
> c[1,1,:]=a;
> xx=b;
> xx_s=broadcast(+,a,b');
> eps=broadcast(-,a,b');
> omga=broadcast(*,xx_s,c);
> writedlm(dirname(@__FILE__)*"\\writecsv_test.csv",zip(xx_s[1,1:end],x
> x[1:end],eps[1,1:end],omega[10,1:end,1]),',')

Reply via email to