GithubHelp home page GithubHelp logo

gabriel-p / photpy Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 0.0 9.33 MB

Python CCD photometry

Home Page: http://photpy.rtfd.io/

License: GNU General Public License v3.0

Python 23.54% C 26.06% Common Lisp 1.01% Cool 2.45% Fortran 46.91% Makefile 0.02%
photometry iraf iraf-replacement photutils astropy

photpy's Introduction

photpy's People

Contributors

gabriel-p avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

photpy's Issues

Road to v1.0

List of issues to close before 1.0 can be published:

  • Get rid of psfmeasure in fitstats script #17
  • Extract the crop process from align_crop and deprecate the alignment #20
  • Extract a more general pymatch process from id_standard #19
  • Add flip support to pymatch script #6
  • Limit the number of stars used in pymatch script #8
  • Solve transformation equations #7
  • Assign errors to aperture photometry values #16
  • Perform linear regression taking errors in x,y into account in fit_standards script #10
  • Finish psf_phot script #18
  • Duplicate DAOMASTER's main functions #12

Two good resources (source):

The 2017 and 2018 versions of my lecture notes are here:
2017: https://ysbach.github.io/AO_2017/
2018: https://ysbach.github.io/AO_LectureNotes/

Store coords found by get_data

The coords of "good" stars found by get_data should be stored in a .coo file.

These coords can later be used by the align_crop script, and save the time it takes to obtain them.

How is 'sigma' obtained by fitparams??

The photcal/fitparams IRAF task shows a sigma column when :vshow is used, with values for each star used in the fit. These values are used to obtain the reduced chi, and others statistical parameters.

How are these sigma values obtained? The code seems to write to that column a 1/sqrt(X) and the description of :results (in inlfit, see below) states that this is a weight.


fitparams uses INLFIT ("The interactive non-linear least squares fitting package") which uses the standard Levenberg-Marquardt non-linear least squares algorithm to fit the data.

Detailed descriptions of the algorithm can be found in the following two references.

  1. Bevington, P.R., 1969, Data Reduction and Error Analysis for the Physical Sciences, Chapter 11, page 235.
  2. Press, W.H. et al., 1986, Numerical Recipes: The Art of Scientific Computing, Chapter 14, page 523.

Related data:

Rename and re-factor id_standard

Make this script more general so that it can act as as replacement to the (DAO)MATCH code.

  1. Change name (pymatch?, photmatch?)
  2. Accept any number of frames, not just a standard frame. Align these to a given reference frame.
  3. Output transformation values to file (to be used by match_transf as done by DAOMASTER to refine the matching)

Extract a more general 'match' process from id_standard

This script should act as as replacement to the (DAO)MATCH code.

  • Add flip support #6
  • Limit the number of stars used #8
  • Solve transformation equations #7
  • Accept any number of frames, not just a standard frame. Align these to a given reference frame.
  • Output transformation values to file (to be used by match_transf as done by DAOMASTER to refine the matching)

Aperture photometry error for standards

Properly assign error to the magnitudes obtained for the standard stars.

Photutils example: https://photutils.readthedocs.io/en/stable/aperture.html#error-estimation

How is the value returned with the method shown above related to the merr value given by IRAF's phot task?

Perform linear regression taking errors in x,y into account (fit_standard)

--> How to fit a model to data, Hogg (2010) <--

(Is this the code used to perform the Bayesian, outlier model, 2D uncertainties fit?)




OLD (below)


Explore linear fitting methods for replicating fitparams

Examples

  1. Calculate uncertainty of linear regression slope based on data uncertainty
  2. Fitting a Model to Data (emcee)
  3. Line of Best Fit (Jake VanderPlas), emcee

StackOverflow

  1. Standard deviation for fitted parameters with scipy.ODR, when data contains error
  2. Linear fitting in python with uncertainty in both x and y coordinates
  3. Linear fit including all errors with NumPy/SciPy
  4. How to do linear regression, taking errorbars into account?
  5. Python linear fitting with multiple error bars

Vary reference frame until all images are properly aligned

Currently the align_crop script will use as a reference frame (if none is given) the one with the most stars found.

This frame is not always the best one to use. If one or more frames are detected as possible bad alignments, the reference frame should be switched and the process applied again.

Do this until all frames are aligned, or until no more frames are left. In the latter case, use the run where the most frames were properly aligned.

Solve transformation equations

  1. Find all stars in common between both frames

  2. Use those stars to solve for the parameters of the general six-parameter transformation:

    x_1 = A + C*x_n + D*y_n
    y_1 = B + E*x_n + F*y_n
    
  3. Output transformation values to file (to be used by match_transf as done by DAOMASTER to refine the matching)

This way we are reproducing the tasks carried out by MATCH.

Run DAOStarFinder in id_standard

Currently the id_standard script uses a .coo file from fitstats to fins the scaling, rotation, and translation for the observed standard frame to match the standard stars image.

This is nor correct since after the align_crop script, the coordinates will change. The script needs to run DAOStarFinder to generate its own set of coordinates from an already aligned frame.

Replace psfmeasure task in fitstats

Currently the fitstats script uses the psfmeasure task to isolate bright stars and estimate the frame's FWHM.

This single task makes the package depend on PyRAF (and IRAF), which is not good.

Find (or create) a replacement built on Python.

Duplicate DAOMASTER's main functions

  1. The techniques of least squares and stellar photometry with CCDs, Peter B. Stetson (1989)
    Lecture by P Stetson himself. Lots of details about how MATCH and MASTER work at the end.

  2. Modern Observational Techniques: Fall 2015, Mike Bolte

    1. Lecture on aperture photometry and PSF-fitting photometry, photometric calibration.
      Mentions some interesting facts about DAOMATCH & DAOMASTER (not many details). Explains the process of photometric calibration (to a standard system) and aperture correction.
    2. DAOMASTER and DAOMATCH help file
      Describes in some detail how both these codes work.
  3. Algorithms for CCD Stellar Photometry, Kenneth J. Mighell (1999).
    Basic techniques of aperture and PSF-fitting CCD stellar photometry are discussed in detail. Describes the process of finding stars as peaks and centering them, transforming from raw signal to instrumental magnitudes (and errors), aperture correction, PSF fitting (lots of math).

  4. After Fitting the PSF
    Basic tutorial that gives a description of the DAOMATCH & DAOMASTER processes.

  5. How to make Color-Magnitude Diagrams of Star Clusters, Chomiuk (2006)
    Small tutorial, not much information.


CCD photometry docs:

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.