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 $(symbol(string("make_dictionary")))()
new_dict = Dict{Symbol,Any}()
println("making new dictionary")
# create new dictionary with each field empty
for sym in ttype_names_final
new_dict[symbol(sym)] = []
end
return new_dict
end
*a = make_dictionary()*
making new dictionary
*Dict{Symbol,Any} with 4 entries:*
* :EW => None[]*
* :LAMBDA => None[]*
* :SIGMA1_RESULT => None[]*
* :SIGMA3_RESULT => None[]*
On Tuesday, February 3, 2015 at 3:07:43 AM UTC+11, alex codoreanu wrote:
>
> 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:
>>
>> 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 happen at
>> https://github.com/JuliaAstro/FITSIO.jl/issues/18
>>
>> --Tim
>>
>> On Sunday, February 01, 2015 12:35:53 AM alex codoreanu wrote:
>> > 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, lambda::[float_array, 5000 elements],
>> > flux::[float_array, 5000 elements]}
>> >
>> > structure = replicate(element, 500)
>> >
>> > where structure inherits the members of element and can be called,
>> >
>> > structure[1].name = the name of element 1
>> > strucutre[1].lambda[1] = the first lambda element of the first
>> structure
>> >
>> >
>> > Thanks !!!
>>
>>