Re: [julia-users] create a multi data type structure in Julia

2015-02-04 Thread alex codoreanu
What I ended up implementing is a dict that can be dynamical created. Here's the code for it but the dict member are blank initialised. # names of parameters to be based to make_dictionary ttype_names_final = { LAMBDA EW SIGMA1_RESULT SIGMA3_RESULT} @eval function

Re: [julia-users] create a multi data type structure in Julia

2015-02-02 Thread alex codoreanu
Hi Tim, I am actually trying to use the low-level functionality provided in FITSIO.jl to write a higher-level function that can deal with fits files with an unknown number of columns and a mix of datatypes. Fingers crossed! On Sunday, February 1, 2015 at 10:33:47 PM UTC+11, Tim Holy wrote:

[julia-users] create a multi data type structure in Julia

2015-02-01 Thread alex codoreanu
Hi all, I'm a new Julia user and I'm starting to write a high-level multi data type fits file reader and writer akin to IDL's mwrfits/mrdfits. I got most of the dynamics figured out by I can't quite make a custom structure. For example, I would like something like: element = {name::string,

Re: [julia-users] create a multi data type structure in Julia

2015-02-01 Thread Tim Holy
Have you seen https://github.com/JuliaAstro/FITSIO.jl Off-topic, but it would be awesome to have FITS integrated into Images.jl. I could help with the integration, but it is pretty well documented: https://github.com/timholy/Images.jl/blob/master/doc/extendingIO.md Further discussion could

Re: [julia-users] create a multi data type structure in Julia

2015-02-01 Thread alex codoreanu
Thanks Milan, I defined Element as you suggested and created *data=(Element, 2)* but *julia **data[1].lambda=[1., 2.0]* *ERROR: type DataType has no field lambda* Now that I have the structure data how do I access the branch members? On Sunday, February 1, 2015 at 8:07:51 PM UTC+11,

Re: [julia-users] create a multi data type structure in Julia

2015-02-01 Thread Milan Bouchet-Valat
Le dimanche 01 février 2015 à 01:24 -0800, alex codoreanu a écrit : Thanks Milan, I defined Element as you suggested and created data=(Element, 2) What is this line supposed to do? All it does now is assign a tuple containing the Element type, and the integer value 2. If you want to

Re: [julia-users] create a multi data type structure in Julia

2015-02-01 Thread alex codoreanu
That worked but I had to use: data = Array(Element, 2) Thanks for the info! On Sunday, February 1, 2015 at 8:57:23 PM UTC+11, Milan Bouchet-Valat wrote: Le dimanche 01 février 2015 à 01:24 -0800, alex codoreanu a écrit : Thanks Milan, I defined Element as you suggested and

Re: [julia-users] create a multi data type structure in Julia

2015-02-01 Thread Milan Bouchet-Valat
Le dimanche 01 février 2015 à 00:35 -0800, alex codoreanu a écrit : Hi all, I'm a new Julia user and I'm starting to write a high-level multi data type fits file reader and writer akin to IDL's mwrfits/mrdfits. I got most of the dynamics figured out by I can't quite make a custom