[AstroPy] Linearity correction by polynomial fitting
James Turner
jturner at gemini.edu
Thu Apr 18 15:03:39 EDT 2013
Good.
Tim Pickering also said that "something like scipy.optimize.fmin_powell"
will handle vectors of coefficients so you can vectorize the whole thing
but I think he forgot to copy you...
James.
On 18/04/13 15:00, Joe Philip Ninan wrote:
> Hi James,
> I think i shall try to keep the code as much pure python as possible. Installing
> iraf on the controller machine just for one routine will probably be an over kill.
> Nadia sent me link to pull request of astropy which can do fitting on 2d array.
> So i only have to flatten by 3d to a 2d, with time along the column. (
> https://github.com/astropy/astropy/pull/493 ).
> This isn't merged to astropy yet, but i was told it will be merged soon.
> Thanks for the suggestions,
> -cheers
> joe
>
>
> On 18 April 2013 22:49, James Turner <jturner at gemini.edu
> <mailto:jturner at gemini.edu>> wrote:
>
> > But I couldn't find anything for fitting a polynomial for every pixel
> along an
> > axis of an ndarray.
> > Is there a tool to do this? Without implementing a python loop to loop
> through
> > each pixel and calculate coefficients?
>
> I'm not sure if there is anything yet (could tell you how to do
> it in IRAF), as I think fitting has been a bit of a missing area
> in Python until some recent work-in-progress. But wouldn't it
> help to use Cython? I was also wondering whether a Python loop
> will really be that slow if you're doing something relatively
> non-trivial like a fit, but it probably will be since the axis
> you're fitting will be much shorter than the image size...
>
> Cheers,
>
> James.
>
>
> > Worst case scenario, i think i will have to write a C routine to do
> polynomial
> > fit and call it from python. But i would really love if a pure python
> > alternative exists.
> >
> > Thanks
> > -cheers
> > joe
> >
> >
> >
> >
> >
> > --
> > /---------------------------------------------------------------
> > "GNU/Linux: because a PC is a terrible thing to waste" - GNU Generation
> >
> > ************************************************
> > Joe Philip Ninan http://sites.google.com/site/jpninan/
> > Research Scholar /________________\
> > DAA, | Vadakeparambil |
> > TIFR, | Pullad P.O. |
> > Mumbai-05, India. | Kerala, India |
> > Ph: +917738438212 | PIN:689548 |
> > ------------------------------\_______________/--------------
> >
> >
> > _______________________________________________
> > AstroPy mailing list
> > AstroPy at scipy.org <mailto:AstroPy at scipy.org>
> > http://mail.scipy.org/mailman/listinfo/astropy
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org <mailto:AstroPy at scipy.org>
> http://mail.scipy.org/mailman/listinfo/astropy
>
>
>
>
> --
> /---------------------------------------------------------------
> "GNU/Linux: because a PC is a terrible thing to waste" - GNU Generation
>
> ************************************************
> Joe Philip Ninan http://sites.google.com/site/jpninan/
> Research Scholar /________________\
> DAA, | Vadakeparambil |
> TIFR, | Pullad P.O. |
> Mumbai-05, India. | Kerala, India |
> Ph: +917738438212 | PIN:689548 |
> ------------------------------\_______________/--------------
More information about the AstroPy
mailing list