{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/proper-image-subtraction-optimal-transient","title":"Proper image subtraction - optimal transient detection, photometry and hypothesis testing","arxiv_id":"1601.02655","date":"2016-01-11","proceeding":null,"authors":["Barak Zackay","Eran O. Ofek","Avishay Gal-Yam"],"abstract":"Transient detection and flux measurement via image subtraction stand at the base of time domain astronomy. Due to the varying seeing conditions, the image subtraction process is non-trivial, and existing solutions suffer from a variety of problems. Starting from basic statistical principles, we develop the optimal statistic for transient detection, flux measurement and any image-difference hypothesis testing. We derive a closed-form statistic that: (i) Is mathematically proven to be the optimal transient detection statistic in the limit of background-dominated noise; (ii) Is numerically stable; (iii) For accurately registered, adequately sampled images, does not leave subtraction or deconvolution artifacts; (iv) Allows automatic transient detection to the theoretical sensitivity limit by providing credible detection significance; (v) Has uncorrelated white noise; (vi) Is a sufficient statistic for any further statistical test on the difference image, and in particular, allows to distinguish particle hits and other image artifacts from real transients; (vii) Is symmetric to the exchange of the new and reference images; (viii) Is at least an order of magnitude faster to compute than some popular methods; and (ix) Is straightforward to implement. Furthermore, we present extensions of this method that make it resilient to registration errors, color-refraction errors, and any noise source that can be modelled. In addition, we show that the optimal way to prepare a reference image is the proper image coaddition presented in Zackay \\& Ofek (2015b). We demonstrate this method on simulated data and real observations from the Palomar Transient Factory data release 2. We provide an implementation of this algorithm in MATLAB and Python.","url_abs":"http://arxiv.org/abs/1601.02655v2","url_pdf":"http://arxiv.org/pdf/1601.02655v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"proper-image-subtraction-optimal-transient","repo_url":"https://github.com/astro-sean/autophot","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1601.02655","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1601.02655"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/astro-sean/autophot","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":19},"by_repo_kind":{"listed":{"samples":19,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"01f0605451e37fa7","entry":"auto_accept_header_key","repo":"astro-sean/autophot","repo_kind":"listed","path":"check.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/check.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"01f0605451e37fa7"}},{"code_sha256_prefix":"8847301bf3f411ba","entry":"calibrate_source_ids_batched","repo":"astro-sean/autophot","repo_kind":"listed","path":"autophot_gaia_curves/gaia_archive.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/autophot_gaia_curves/gaia_archive.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8847301bf3f411ba"}},{"code_sha256_prefix":"c44146b7e8f3ef56","entry":"cross_match_sources","repo":"astro-sean/autophot","repo_kind":"listed","path":"catalog.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/catalog.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c44146b7e8f3ef56"}},{"code_sha256_prefix":"6bd96f6dc49ca218","entry":"exposure_seconds_from_header","repo":"astro-sean/autophot","repo_kind":"listed","path":"aperture.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/aperture.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6bd96f6dc49ca218"}},{"code_sha256_prefix":"7584df518ae2ed94","entry":"find_variable_sources","repo":"astro-sean/autophot","repo_kind":"listed","path":"autophot.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/autophot.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7584df518ae2ed94"}},{"code_sha256_prefix":"e78f60070e5e32b9","entry":"get_header","repo":"astro-sean/autophot","repo_kind":"listed","path":"check.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/check.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e78f60070e5e32b9"}},{"code_sha256_prefix":"577d77546a4e6c52","entry":"inspect_telescope","repo":"astro-sean/autophot","repo_kind":"listed","path":"autophot.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/autophot.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"577d77546a4e6c52"}},{"code_sha256_prefix":"555baec3b62cc0fd","entry":"launch_gaia_adql_to_pandas","repo":"astro-sean/autophot","repo_kind":"listed","path":"autophot_gaia_curves/gaia_archive.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/autophot_gaia_curves/gaia_archive.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"555baec3b62cc0fd"}},{"code_sha256_prefix":"3f3450606d3b8cc5","entry":"main","repo":"astro-sean/autophot","repo_kind":"listed","path":"batch_main.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/batch_main.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3f3450606d3b8cc5"}},{"code_sha256_prefix":"284d31f3cf840c4f","entry":"normalize_log_message","repo":"astro-sean/autophot","repo_kind":"listed","path":"functions.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/functions.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"284d31f3cf840c4f"}},{"code_sha256_prefix":"378aea3acc200542","entry":"parse_args","repo":"astro-sean/autophot","repo_kind":"listed","path":"batch_main.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/batch_main.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"378aea3acc200542"}},{"code_sha256_prefix":"af04f3a2701970f6","entry":"prepare_template_directory","repo":"astro-sean/autophot","repo_kind":"listed","path":"autophot.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/autophot.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"af04f3a2701970f6"}},{"code_sha256_prefix":"e7a83e900a0ffb2c","entry":"resolve_additional_targets","repo":"astro-sean/autophot","repo_kind":"listed","path":"additional_targets.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/additional_targets.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e7a83e900a0ffb2c"}},{"code_sha256_prefix":"1f079c93bef45fdd","entry":"resolve_exposure_time_seconds","repo":"astro-sean/autophot","repo_kind":"listed","path":"aperture.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/aperture.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1f079c93bef45fdd"}},{"code_sha256_prefix":"689752230cf01e53","entry":"resolve_gain_e_per_adu","repo":"astro-sean/autophot","repo_kind":"listed","path":"aperture.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/aperture.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"689752230cf01e53"}},{"code_sha256_prefix":"a789dac579128f0d","entry":"resolve_verbose_level","repo":"astro-sean/autophot","repo_kind":"listed","path":"functions.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/functions.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a789dac579128f0d"}},{"code_sha256_prefix":"6cb8b14857e29f79","entry":"retry_with_backoff","repo":"astro-sean/autophot","repo_kind":"listed","path":"autophot_gaia_curves/gaia_archive.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/autophot_gaia_curves/gaia_archive.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6cb8b14857e29f79"}},{"code_sha256_prefix":"4391f5e86fc6b397","entry":"sanitize_target_name_for_filename","repo":"astro-sean/autophot","repo_kind":"listed","path":"additional_targets.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/additional_targets.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4391f5e86fc6b397"}},{"code_sha256_prefix":"3378aa98bc04ac90","entry":"strip_subprocess_noise","repo":"astro-sean/autophot","repo_kind":"listed","path":"functions.py","file_url":"https://github.com/astro-sean/autophot/blob/HEAD/functions.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3378aa98bc04ac90"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}