On 4/13/2010 10:43 AM, David Mertens wrote: > > PDLs have the hdr() function that returns a plain ol' Perl hash. It's > supposed to be for FITS headers, but it's good for anything. I've used > it for all kinds of things as a way to teach PDL how to do new tricks > (and remember associated data) and I've been thinking about writing up > guidelines for general OO machinations using PDL and in particular > storing extra data in the hdr hash, just as you would store a normal > Perl object's data in a (blessed) hash. I don't think that you need to > subclass PDL to do that, you can simply extend it.
Yes, but there might be problems with namespace collisions. For example, what if one had a key that matched on of the default FITS keys, then one could get erroneous results because of the conflict in usage. > As for storage, a first cut could be to use Data::Dumper and put that > directly into the header files for the data. You could then simply eval > that part of the header file and put the resulting hash into the hdr of > the piddle you're loading. > > I have no idea what kind of metadata you need to store, but I would be > surprised if using the built-in hdr wouldn't be adequate. I think that the built-in header might have an advantage in performance. --Chris _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
