On Nov 21, 2012, at 3:54 PM, Nadia Dencheva wrote:
>
>
>
> On Wed, Nov 21, 2012 at 7:12 AM, Tom Aldcroft <
aldc...@head.cfa.harvard.edu> wrote:
>
>
>
> On Tue, Nov 20, 2012 at 11:17 PM, Nadia Dencheva <
nadia.d...@gmail.com> wrote:
> Hi Tom,
>
> There are two things here: units and constraints.
> It was a deliberate decision not to attach units to parameters and let the software which uses them deal with that. It was felt this would make the software more flexible.
>
> I was mostly thinking about units as an immutable part of the model definition that is mostly ignored by the fitting code itself. If you envision users defining and fitting astrophysical models (e.g. Raymond-Smith plasma emission) then it becomes important to know the units of each parameter and of the model output itself. That *can* just be handled in documentation, but with the powerful units infrastructure in astropy it seems a shame to not have the units be available as code objects that can then be manipulated by users downstream.
>
> The other complication is the distinction between integrated and non-integrated models, which is common with spectral fitting. Often the spectral data are integrated (e.g. summed photons within each wavelength bin) while the physical model is not (photons / angstrom or whatever). Certainly one can put the burden on the user to deal with this, but having some awareness in the fitting package is good.
>
> OK, I see what you mean. I have no strong feelings about units one way or the other. Parameters are objects and it would be relatively simple to add a 'units' attribute.
> Does anyone else see any pros or cons about this?
I can imagine some possible issues where being overly specific about units make it more difficult --
or at least more awkward -- to re-use models for situations the original writer didn't think of.
For example, if I'm fitting a 2D function to a 2D image, I might do this to an image that has units
of counts/pixel and size units of pixels, or counts/sec/pixel and arc seconds, or electrons/sec/pixel
and kpc -- or I might do it to an image from a simulation which has units of arbitrary mass
per pixel and ...
And there are all sorts of situations where one might fit, e.g., one or more Gaussians to a 1-D dataset,
regardless of what the units are.
If the units are a kind of "decoration" -- having no effect on the fitting -- this probably isn't a problem,
just a minor annoyance for the users if they're fitting something other than the "obvious" data. If the
units have *some* influence in the fitting, then it may be a problem.
-- Peter
=============================================================
Peter Erwin Max-Planck-Insitute for Extraterrestrial
er...@mpe.mpg.de Physics, Giessenbachstrasse
tel. +49 (0)176 2481 7713 85748 Garching, Germany
fax
+49 (0)89 30000 3495 http://www.mpe.mpg.de/~erwin