On Jul 2, 2009, at 3:20 AM, Tom Marsh wrote:
> Dear Tim,
>
> a message from Malcolm drew my attention to this message of yours
> from last
> year (!)
> which I missed entirely: sorry, it must have seemed very rude of me.
> No
> doubt it is buried in my inbox somewhere:
>
> On Fri, 23 May 2008 09:28:45 -1000, Tim Jenness <[log in to unmask]
> >
> wrote:
>
>> If I gave you subversion access would you mind committing your python
>> interface to the repository so that others could benefit?
>
> In short yes, but before doing so, you earlier made a suggestion
> when I
> first mooted a python interface to NDF to the effect:
>
>> Also make sure that you treat the "NDF identifier" as the object (I
>> didn't
> do that in the
>> perl interface and I regret it now).
>
> I had hoped that by the time I had got somewhere with it, I would
> understand
> what you meant, but I am still not sure that I do. I would prefer to
> release
> any such interface when I am reasonably sure that it is stable so I
> don't
> get locked in to a sub-optimal way to go about it, without taking
> forever
> about it. The code is sufficiently short that I would be happy to
> change
> things. The way I have it at the moment, one can read in an ndf with
> a line
> like:
>
> ndf = Ndf('image')
>
> then ndf.data contains the data (in the Python equivalent of a PDL
> array,
> i.e. a 'numpy' array)
>
> Is that enough for you to tell that I am not doing as you suggest?
> Also, at
> the moment the interface contains many equivalents to fairly
> elementary NDF
> and DAT functions such as
> ndf_anorm, dat_struc etc. Do you have views on whether I should be
> keeping
> these out of sight or not?
>
> I should also say that although I rapidly got to the point where I
> could
> read NDFs into Python, it is only recently that my student has added
> stuff
> to write them. We need to merge our versions to get something of more
> general usefulness.
I suppose the question I have is what does your "ndf" object contain?
Is it a copy of all the metadata from the file is it still attached to
the file (it's the equivalent of asking whether this is like the
PDL::IO::NDF perl module that reads everything in to memory and closes
the file, compared to the perl NDF interface that returns back the NDF
identifier (ie the NDF object in reality) and lets you do methods on
the open file just like you would be using the C or fortran interface.
Your example above implies a PDL blob rather than an interface to the
NDF library calls on the open file.
--
Tim Jenness
Joint Astronomy Centre
|