Giter Site home page Giter Site logo

astropy / ccdproc Goto Github PK

View Code? Open in Web Editor NEW
87.0 17.0 85.0 2.9 MB

Astropy affiliated package for reducing optical/IR CCD data

Home Page: https://ccdproc.readthedocs.io

License: BSD 3-Clause "New" or "Revised" License

Python 97.93% Jupyter Notebook 2.07%
python astropy-affiliated ccd astronomy

ccdproc's Introduction

ccdproc

GitHub Actions CI Status

image

image

Ccdproc is is an affiliated package for the AstroPy package for basic data reductions of CCD images. The ccdproc package provides many of the necessary tools for processing of ccd images built on a framework to provide error propagation and bad pixel tracking throughout the reduction process.

Ccdproc can currently be installed via pip or from the source code. For installation instructions, see the online documentation or docs/install.rst in this source distribution.

Documentation is at ccdproc.readthedocs.io

An extensive tutorial is currently in development.

Contributing

We have had the first stable release, but there is still plenty to do!

Please open a new issue or new pull request for bugs, feedback, or new features you would like to see. If there is an issue you would like to work on, please leave a comment and we will be happy to assist. New contributions and contributors are very welcome!

New to github or open source projects? If you are unsure about where to start or haven't used github before, please feel free to email @crawfordsm, @mwcraig or @mseifert. We will more than happily help you make your first contribution.

Feedback and feature requests? Is there something missing you would like to see? Please open an issue or send an email to @mwcraig, @crawfordsm or @mseifert. Questions can also be opened on stackoverflow, twitter, or the astropy email list.

Ccdproc follows the Astropy Code of Conduct and strives to provide a welcoming community to all of our users and contributors.

Want more information about how to make a contribution? Take a look at the astropy contributing and developer documentation.

If you are interested in finacially supporting the project, please consider donating to NumFOCUS that provides financial management for the Astropy Project.

Acknowledgements

If you have found ccdproc useful to your research, please considering adding a citation to ccdproc contributors; Craig, M. W.; Crawford, S. M.; Deil, Christoph; Gasdia, Forrest; Gomez, Carlos; Günther, Hans Moritz; Heidt, Nathan; Horton, Anthony; Karr, Jennifer; Nelson, Stefan; Ninan, Joe Phillip; Pattnaik, Punyaslok; Rol, Evert; Schoenell, William; Seifert, Michael; Singh, Sourav; Sipocz, Brigitta; Stotts, Connor; Streicher, Ole; Tollerud, Erik; and Walker, Nathan, 2015, Astrophysics Source Code Library, 1510.007, DOI: 10.5281/zenodo.47652

Thanks to Kyle Barbary (@kbarbary) for designing the ccdproc logo.

ccdproc's People

Contributors

abigalemoen avatar adrn avatar astrofrog avatar bsipocz avatar cdeil avatar crawfordsm avatar embray avatar eteq avatar evertrol avatar hamogu avatar hletrd avatar indiajoe avatar jaalvarado-montes avatar janga1997 avatar joshwalawender avatar jryon avatar larrybradley avatar laserkelvin avatar mdboom avatar mirca avatar mseifert04 avatar mwcraig avatar neutrinoceros avatar pllim avatar stottsco avatar stscicrawford avatar tbowers7 avatar walkerna22 avatar yash-10 avatar ysbach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ccdproc's Issues

extract unit from image header

If units are specified in the image header, the fits_ccddata_reader should be able to extract the units from the header and they should not need to be explicitly stated in the header.

ccdproc.transform

ccdproc tasks for transforming data. This should be able to handle general transformations such as shift, rotation, and magnification.

logging with no add_keywords

Logging does not seem to behave as expected in the api. In the api, we suggest that the if add_keyword is not specified, the task name and parameters should be added to meta, but that does not seem like the case right now.

Make PEP8 fixes

These appear to be mostly minor whitespace fixes (e.g. spaces around = and after ,) but there may be a couple of camelCaseNames that should be converted to names_with_underscores

create_variance makes an uncertainty which is a Quantity

This is a problem because NDDData doesn't function correctly with Quantity arrays. One of the issues this creates is that the unit of the uncertainty can be completely different (and inconsistent with) the unit of the CCDData.data.

sigma_clip should allow clipping along stack only

In some cases (e.g. creating a master dark) there pixels which are, in any individual image or the set of images being combined, several standard deviations from the mean or median. In the case of combining to make a master dark these are hot pixels, and should not be masked in sigma_clip.

The clipping should exclude those pixels which vary by more than a few standard deviations from the mean of that pixel over all images.

ccdproc.distortion_correct

Apply distortion corrections by either updating the WCS or transform the frame. Basic functionality will probably be included in ccdproc.transform and more advance WCS handling will require the WCS class.

rejection algorithms

Should the clipping algorithms be moved out of combiner and into there own class/functions ?

checking size of array before trimming

In ccdproc.trim_image, there is no checking to see if the requested section is within the boundaries of the image. This seems to be the same behaviour as ndarray.

Should we keep this behavior or add some check to make sure that the trimmed area is within the give ccddata object?

Propagate errors when doing scalar op CCDData

Should be able to handle multiplication, division, addition, subtraction of a scalar without an error and a CCDData object, and pass through to the NDData methods .add etc if the other operand is not a numbers.Number.

Fitting models with rejection

Fitting models with rejecting points is a need for the ccdproc package, for example in fitting the overscan region. However, this is probably something that astropy.modeling will eventually take care of, but in the meantime, we should supply something.

weighting in combiner

Add calculating the weighting to combiner or provide other functions for doing it

fringe correction

fringe correction is likely a convenience function (as it is either a flat_image or a scaled subtraction) and so not necessary to implement right away. It is also something that will be telescope dependent.

fits_section doesn't do any bounds checking

At a minimum it should check for a zero index on input and refuse to decrease it to -1. Perhaps it should also check for negative index as the stop and disallow that too.

ccdproc.rebin

Function for rebinning ccddata data. It should handle rebinning mask and uncertainty frames as well.

Writing out mask, flags, uncertainty information

For now any flag, mask and/or unit for ccddata is discarded when writing. If you want all or some of that information preserved you must create the FITS files manually.

It would be good to be able to write out that information as well.

Fix sphinx build warnings

These are generated because automodapi tries to generate docs for things we import -- one fix is to set __all__ to something sensible in each module.

...
/Users/mcraig/Development/astronomy/ccdproc/docs/ccdproc/index.rst:49: WARNING: toctree references unknown document u'api/ccdproc.ccdproc.Quantity'
/Users/mcraig/Development/astronomy/ccdproc/docs/ccdproc/index.rst:49: WARNING: toctree references unknown document u'api/ccdproc.ccdproc.StdDevUncertainty'
...
None:None: WARNING: toctree contains reference to nonexisting document u'api/ccdproc.ccdproc.Quantity'
None:None: WARNING: toctree contains reference to nonexisting document u'api/ccdproc.ccdproc.StdDevUncertainty'
...

basic arithmetic

Having things like

ccd = cccddata + 2 
ccd = ccddata + ccddata

working. At the current time, basic arithmetic with CCDData can be done using .add for example. However, implementing the above, if ever, will require changes to NDData and Quantity.

Add a basic example to the docs

Could you please add a basic example to the docs to show what ccdproc is about and what it can currently do?

I mean something short like the "Introduction" and "Getting Started" sections in photutils.

masked median_combine is excruciatingly slow

This is a known issue, though with no solution in numpy: numpy/numpy#4683

By "excruciating" I mean masked median is roughly 1,000x slower than unmasked median.

Summary of several options (the "reference" time is np.median with no masks):

function masked? time (sec) slowness factor
np.median no 1.07s 1x
np.ma.median yes 838s 783x
loop over pixels yes 254s 237x
scipy.stats.nanmedian yes 232s 216x
bottleneck.nanmedian yes 1.35s 1.26x

notebook with timings is at: http://nbviewer.ipython.org/gist/mwcraig/9711663484d7cc264fa7

The fastest by far is bottleneck but requiring bottleneck adds a dependency.

One way around this is:

def median_combine(self, median_nan_func=None):
"""
...
           Parameters
           ----------
           median_nan_func : function, optional
               Function that calculates median of a ``numpy.ndarray``, ignoring any
               values that are ``NaN``. Default is to use ``np.ma.median`` to
               calculate median.
"""

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.