You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some code that relies on IRAF (e.g. median, imcombine, blkrep, ...). I'm planning on rewriting it to be pure python. I looked through astropy and the affiliated packages to see if python versions of the IRAF commands already existed and didn't find anything. Since this package seemed to be the place where IRAF functions would most likely be recreated I thought I'd double check here.
If indeed these functions don't exist, would it be something to include in the ccdproc package? For example, I was thinking of writing a wrapper for the scipy.signal.medfilt to have it work more like the IRAF task median (I did see that there is a cosmicray_median function in this package, maybe some functionality could be reused?).
I'm not very familiar with IRAF (which is why I want to change the code to use python instead) so I'm not sure if the reason these functions don't exist in astropy/the affiliated packages is because people don't like them for some reason. Please let me know if that's the case.
It would be great for you to contribute whatever you have and would be wonderful to include it. The reason some of the functionality may not exist is typically because we have not had time to implement it and so if there is stuff you would like to see in ccdproc, please let us know. So it's not at all that we do not like them, but either we haven't needed them or just have not implemented them yet. So having your help and contributes would be a big help.
My suggestion for how best to proceed is to open an issue for each feature that you would like to see but can't find in ccdproc. Somethings do exists in other forms and just are currently not wrapped in ccdproc and so those might be quite easy to include (like the median example you give--it would be great to include that as a function in ccdproc). We also might be able to suggest some other places that things do show up or where there is overlap or the best way to proceed (which in some cases might be implementing the code and in others it might be better or more visible documentation).
Nonetheless, it would be great to have your contributions and thank you for your interest!
@pllim Yes, I added block_replicate and block_reduce to astropy. block_reduce is flexible in that it can apply any user-input function to the data. The default is func=np.sum, which is equivalent to blkrep block summing. The equivalent of blkavg would be to input func=np.mean (or e.g. np.ma.mean).
Hi @AlexaVillaume,
This is super related to a project we're working on right now at STScI to replace needed IRAF tasks and functionality. Can I ask what part of the IRAF functionality you want that's not part of scipy.signal.medfilt ? This could easily be something that goes on our to-do list...
My thought was to make a wrapper to the scipy functionality so that one could just pass a name of a fits file, like in IRAF. Then also to work properly over MEFs, which I don't think the IRAF version does. Is this the same project that @pllim brought up?
Activity
crawfordsm commentedon Jul 7, 2016
It would be great for you to contribute whatever you have and would be wonderful to include it. The reason some of the functionality may not exist is typically because we have not had time to implement it and so if there is stuff you would like to see in ccdproc, please let us know. So it's not at all that we do not like them, but either we haven't needed them or just have not implemented them yet. So having your help and contributes would be a big help.
My suggestion for how best to proceed is to open an issue for each feature that you would like to see but can't find in ccdproc. Somethings do exists in other forms and just are currently not wrapped in ccdproc and so those might be quite easy to include (like the median example you give--it would be great to include that as a function in ccdproc). We also might be able to suggest some other places that things do show up or where there is overlap or the best way to proceed (which in some cases might be implementing the code and in others it might be better or more visible documentation).
Nonetheless, it would be great to have your contributions and thank you for your interest!
pllim commentedon Sep 8, 2016
For
imcombine, STScI has some kind of Python implementation already. See https://github.com/spacetelescope/stsci.image/blob/master/stsci/image/numcombine.py . We do plan to consolidate such implementations currently scattered across the board somewhere easier to find. c/c @saraogaz, @justincelyI was pretty sure we also re-implemented
blkrepin Python before but I can't find it now... @larrybradley , was it absorbed intostatsorphotutils?pllim commentedon Sep 8, 2016
EDIT: Okay, we didn't re-implement
blkrepbut ratherblkavg. Not sure if that one made it into official STScI distribution, but I have a copy at https://github.com/pllim/playpen/blob/master/blkavg_rewrite.py (still need some work to optimize it but I think it works)MSeifert04 commentedon Sep 8, 2016
@pllim blkrep could be
astropy.nddata.utils.block_replicateandastropy.nddata.utils.block_reduceorccdproc.rebin(this might be subject to change because it doesn't do what people expect #388).larrybradley commentedon Sep 8, 2016
@pllim Yes, I added
block_replicateandblock_reducetoastropy.block_reduceis flexible in that it can apply any user-input function to the data. The default isfunc=np.sum, which is equivalent toblock summing. The equivalent ofblkrepblkavgwould be to inputfunc=np.mean(or e.g.np.ma.mean).larrybradley commentedon Sep 8, 2016
Sorry,
blk_repisblock_replicatenotblock_reduce.....MSeifert04 commentedon Sep 8, 2016
Also
imcombineis probably already implemented inccdproc: low-level interfaceCombinerand high-levelcombineSaOgaz commentedon Oct 19, 2016
Hi @AlexaVillaume,
This is super related to a project we're working on right now at STScI to replace needed IRAF tasks and functionality. Can I ask what part of the IRAF functionality you want that's not part of
scipy.signal.medfilt? This could easily be something that goes on our to-do list...AlexaVillaume commentedon Oct 20, 2016
Hi @SaraOgaz,
My thought was to make a wrapper to the scipy functionality so that one could just pass a name of a fits file, like in IRAF. Then also to work properly over MEFs, which I don't think the IRAF version does. Is this the same project that @pllim brought up?
pllim commentedon Oct 20, 2016
@AlexaVillaume , yes, the very same project.
crawfordsm commentedon Dec 7, 2018
What might also be of help is the following project:
https://stak-notebooks.readthedocs.io/en/latest/
We are going to close this issue for right now, but please open individual issues if there is a specific functionality to implement.