{"id":38903930,"url":"https://github.com/cgosmeyer/photutils_plus","last_synced_at":"2026-01-17T15:05:41.730Z","repository":{"id":275072734,"uuid":"95023141","full_name":"cgosmeyer/photutils_plus","owner":"cgosmeyer","description":"Extended functionality on the astropy-associated \"photutils\" photometry package.  ","archived":false,"fork":false,"pushed_at":"2017-06-28T17:11:55.000Z","size":140,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-10T00:31:54.731Z","etag":null,"topics":["apphot","astronomy","daofind","photometry","photutils","source-finding"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cgosmeyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-21T16:16:32.000Z","updated_at":"2022-06-25T19:38:01.000Z","dependencies_parsed_at":"2025-01-31T02:45:32.913Z","dependency_job_id":null,"html_url":"https://github.com/cgosmeyer/photutils_plus","commit_stats":null,"previous_names":["cgosmeyer/photutils_plus"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cgosmeyer/photutils_plus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgosmeyer%2Fphotutils_plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgosmeyer%2Fphotutils_plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgosmeyer%2Fphotutils_plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgosmeyer%2Fphotutils_plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgosmeyer","download_url":"https://codeload.github.com/cgosmeyer/photutils_plus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgosmeyer%2Fphotutils_plus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28510928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apphot","astronomy","daofind","photometry","photutils","source-finding"],"created_at":"2026-01-17T15:05:38.566Z","updated_at":"2026-01-17T15:05:41.705Z","avatar_url":"https://github.com/cgosmeyer.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# photutils_plus\nExtended functionality on the `astropy`-associated `photutils` photometry package.  \n\n## Set Up\n\nClone the repo and run the setup.py.  This will also install `astropy` and `photutils` if you don't have them already in your environment. \n\n```\n\u003e\u003e\u003e python setup.py develop\n```\n\nI recommend \"develop\" rather than \"install\" because you'll probably want to tweak things.  (I'm not the Photometry Expert by a long shot.)  This was originally written in Python 2 and there may be some compatibility issues in Python 3 that I'm not aware of, but do open an issue if you find them!  \n\n## Modules\n\n### apphot\nCan be run on the command line with limited amount of arguments (limited only by the free time of the developer) or be imported with full functionality.  See `apphot`'s doc strings for full details of the options. \n\n`apphot` wraps `photutils.CircularAperture` and `photutils.aperture_photometry` into a single function with parameters similar to those of IRAF's `DAOPHOT` task.  It outputs a photometry file with all the selected parameters saved in the header, including background estimates, similar to IRAF's `.mag` output files (but with a format easier to parse - see example at end of README).  In fact, the files are named as `.mag` by default to aid the transition for those used to their IRAF photometry. \n\nStill missing is the ability to re-centroid sources. To my knowledge, `photutils` has not developed their centroiding functions to make them able to handle images containing more than one source. \n\nHere are some command-line `apphot` examples, using an image named \"id1l02g2q_flt.fits\" and coordinate file named \"id1l02g2q_flt.fits.coo.1\" for aperture radii 5 and 10 pixels:\n\n```\n \u003e\u003e\u003e python apphot --im id1l02g2q_flt.fits --coo id1l02g2q_flt.fits.coo.1 --r 5.0 10.0\n    \n# This will generate two output *mag files in the current working directory named \n    \n    id1l02g2q_flt.fits_5.0.mag\n    id1l02g2q_flt.fits_10.0.mag\n    \n# If you set --sep 0, then there will be only one output *mag file named\n\n    id1l02g2q_flt.fits.mag\n    \n# If the *mag files already exist, they will not be overwritten.\n# Instead, the new *mag files will be appended with a number, i.e.,\n\n    id1l02g2q_flt.fits_5.0.mag.1\n    id1l02g2q_flt.fits_10.0.mag.1\n```\n\n### phot_tools\nA module containing tools for the `apphot` and `sourcefind` modules.  Includes background estimating, masking, and file reading and writing. \n\n### plot_coords\nInclude in your photometry script to plot the coordinates found with `sourcefind` or another function onto a PNG of the FITS image. \n\n### sourcefind\nWraps `photutils.daofind` and more limitedly, `photutils.find_peaks`.  At this time, it cannot be run from the command-line (which would be easy to include if the developer took the initiative!).  \n\n`sourcefind.daofind` outputs coordinate files with with a default naming scheme is like IRAF's: the image name appended with `.coo`.  \n\n## A Scripted Workflow\n\nFor a single image, find the sources with `sourcefind.daofind`. \n\n```\nfrom photutils_plus.sourcefind import daofind\n\nimagename = 'icqu04rgq_flc.fits'\next = 0\ndaofind(imagename, ext=ext, threshold=1050., fwhm=2.5)\n```\n\nThis outputs a coordinate file named, by default, after the input image with \".coo\" appended: \"icqu04rgq_flc.fits.coo\". \n\nNow, if you like, plot the coordinates as open circles onto the image.\n\n```\nfrom photutils_plus.plot_coords import plot_coords\n\nplot_coords('icqu04rgq_flc.fits', 'icqu04rgq_flc.fits.coo', ext=1)\n```\n\nBy default, the output PNG image will be named \"\"icqu04rgq_flc.fits.png\".\n\nFinally, perform photometry using `apphot.apphot`. By selecting \"sep_out=False\", we are confining all the different aperture radii (units of pixels) to a single file rather than a seperate file for each radius.  \n\n```\nfrom photutils_plus.apphot import apphot\n\napphot(imagename='icqu04rgq_flc.fits', ext=1, coofile='icqu04rgq_flc.fits.coo', ap_radii=[5, 10, 12], \\\nsep_out=False)\n```\n\nThe output photometry file will be named, by default, as \"icqu04rgq_flc.fits.mag\". You can also have it return the magnitudes as an `astropy.table.Table` on top of the `.mag` file if you set `apphot` equal to a variable. This goes for `sourcefind.daofind` as well. \n\n## Example Output Photometry File\n\nHere is an example of a `.mag` file from `apphot`, where \"sep_out=False\", so that all the aperture radii are printed in the same file for each source (3 shown in the example below). The header lists all the parameter settings; see the  `apphot` doc strings for more information on available parameters. Tools are available in the `phot_tools` module for writing and parsing these files. For instance, the header can be read into a dictionary. \n\n```\n# PYTHON                 2.7.5           version\n# USER                   cgosmeyer               name\n# HOST                   cgosmeyermac             computer\n# DATE                   2016-08-13              yyyy-mm-dd\n# TIME                   12:43:36                hh:mm:ss\n# FUNCTION               apphot                  name\n#\n# ANNULUS                3.5             0\n# AP_RADII               [3, 5, 10]            1\n# BACKGLOBAL             False           2\n# BACKMETHOD             mean            3\n# COLNAMES               ['extr_xpix', 'extr_ypix']              4\n# COOFILE                icqu04rgq_flc.coo                  5\n# DANNULUS               10.0            6\n# EFFECTIVE_GAIN                 None            7\n# EXT            1               8\n# IMAGENAME              numpy array             9\n# MASK           None            10\n# METHOD                 subpixel                11\n# OUTNAME                icqu04rgq_flc           12\n# PIXELWISE_ERROR                None            13\n# SEP_OUT                False           14\n# SUBPIXELS              5               15\n# VERBOSE                False           16\n#\nID      radius  aperture_sum    xcenter ycenter mean_local_bkgrd        tot_local_bkgrd   \n1       3.0     304.709299699   177.559345818   2038.99871288   5.34541805349   151.138134785   \n1       5.0     441.448582702   177.559345818   2038.99871288   2.35808650071   185.203680679    \n1       10.0    823.806982231   177.559345818   2038.99871288   6.91177559481   2171.39834319   \n2       3.0     253.913460445   213.889087553   2041.26538736   5.64445712521   159.593265342   \n2       5.0     327.771958152   213.889087553   2041.26538736   12.0727819215   948.194074825    \n2       10.0    11394.4246024   213.889087553   2041.26538736   2.13410972259   670.450342644   \n3       3.0     619.62800065    28.2171662015   1995.3848863    5.61276484794   158.697187314   \n3       5.0     795.264226607   28.2171662015   1995.3848863    3.13170050909   245.963182815    \n3       10.0    1877.91108042   28.2171662015   1995.3848863    2.74348838443   861.892295375\n...\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgosmeyer%2Fphotutils_plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgosmeyer%2Fphotutils_plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgosmeyer%2Fphotutils_plus/lists"}