{"id":21375585,"url":"https://github.com/lsst/meas_extensions_convolved","last_synced_at":"2025-07-13T09:33:26.264Z","repository":{"id":38429527,"uuid":"68046770","full_name":"lsst/meas_extensions_convolved","owner":"lsst","description":"Aperture measurements of convolved images","archived":false,"fork":false,"pushed_at":"2023-07-10T00:19:17.000Z","size":92,"stargazers_count":2,"open_issues_count":0,"forks_count":5,"subscribers_count":14,"default_branch":"main","last_synced_at":"2023-07-10T01:23:13.728Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lsst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-12T20:53:10.000Z","updated_at":"2021-11-26T19:27:30.000Z","dependencies_parsed_at":"2023-02-14T15:55:27.113Z","dependency_job_id":null,"html_url":"https://github.com/lsst/meas_extensions_convolved","commit_stats":null,"previous_names":[],"tags_count":395,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsst%2Fmeas_extensions_convolved","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsst%2Fmeas_extensions_convolved/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsst%2Fmeas_extensions_convolved/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsst%2Fmeas_extensions_convolved/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lsst","download_url":"https://codeload.github.com/lsst/meas_extensions_convolved/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225871094,"owners_count":17537173,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-22T09:11:37.713Z","updated_at":"2024-11-22T09:11:38.306Z","avatar_url":"https://github.com/lsst.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# meas_extensions_convolved\n\nThis is a measurement plugin for the LSST stack that convolves images before measuring aperture fluxes.\nThe convolution provides a rough match to the PSF in other observations, and so aperture measurements on the convolved image are useful for:\n\n1. Measuring the flux that would be obtained with a fiber spectrograph, by using an aperture equal to the size of the spectrograph fiber and measuring with multiple target seeings to allow interpolation of the flux at the seeing of the spectroscopic observation.\n2. Measuring the color of galaxies in variable seeing, by using a common aperture and target seeing in each band.\n\nThis is similar to the usual degrade-to-a-common-seeing-then-measure (PSF-matched coadds) technique, except that the matching is done for each individual source, rather than over the entire image at once.\n\nIn the interests of simplicity and speed, we assume that all the PSFs are Gaussian and explicitly do not allow for deconvolution.\nThis does not provide a precise match to the desired target PSF, but should be close enough for most purposes.\n\nThe aperture measurements that are made are:\n\n1. Multiple pre-defined circular apertures.\n2. Elliptical Kron aperture, where the shape and Kron radius are provided from the catalog.\n\n\n## Key configuration parameters\n\n* `seeing`: a list of target FWHM seeings, in pixels.\n* `aperture.radii`: a list of aperture radii, in pixels.\n* `maxSincRadius` and `aperture.maxSincRadius`: maximum radius for which to use the 'sinc' aperture measurement algorithm ([Bickerton \u0026 Luption, 2013](2013MNRAS.431.1275B)), which provides greater precision in the fluxes for small radii apertures on properly-sampled images.\n* `kronRadiusName`: column name with the Kron radius.\n* `kronRadiusForFlux`: number of Kron radii to use for the Kron aperture.\n\n\n## Output columns\n\n* `\u003calgName\u003e_flag`: general failure flag; if `True`, the measurement algorithm failed catastrophically (e.g., an unexpected exception was thrown).\n* `\u003calgName\u003e_seeing`: PSF determinant radius at source position, in pixels.\n* `\u003calgName\u003e_\u003cseeingIndex\u003e_deconv`: deconvolution flag; if `True`, the PSF at the position is wider than the target seeing, so PSF matching would require deconvolution. No aperture measurements will have been made with this target seeing.\n* `\u003calgName\u003e_\u003cseeingIndex\u003e_\u003caperName\u003e_flux`: flux within circular aperture after convolution to target seeing.\n* `\u003calgName\u003e_\u003cseeingIndex\u003e_\u003caperName\u003e_fluxErr`: estimated error for circular aperture flux measurement after convolution to target seeing. See [this note](#errors) for a warning about their reliability.\n* `\u003calgName\u003e_\u003cseeingIndex\u003e_\u003caperName\u003e_flag`: aperture flux flag; if `True`, the corresponding aperture flux measurement is unreliable. This may be set, e.g., if the aperture extends off the edge of the image.\n* `\u003calgName\u003e_\u003cseeingIndex\u003e_kron_flux`: flux within Kron aperture after convolution to target seeing.\n* `\u003calgName\u003e_\u003cseeingIndex\u003e_kron_fluxErr`: estimated error for Kron flux measurement after convolution to target seeing. See [this note](#errors) for a warning about their reliability.\n* `\u003calgName\u003e_\u003cseeingIndex\u003e_kron_flag`: Kron flux flag; if `True`, the Kron flux measurement is unreliable. This may be set, e.g., if the Kron aperture extends off the edge of the image.\n\nIn the above list of output columns:\n\n* `\u003calgName\u003e` stands for the algorithm name, typically `\"ext_convolved_ConvolvedFlux\"`.\n* `\u003cseeingIndex\u003e` stands for the index of the target seeing of interest (starting from `0`).\n* `\u003caperName\u003e` stands for the aperture name, which is the radius in pixels to one decimal precision and the decimal point replaced by an underscore (e.g., for a radius of 1.2 pixels, this would be `1_2`).\n\nThere are some useful methods on `ConvolvedFluxConfig` that help put the column names together.  Note that these require that the configuration (especially the seeing values) is set correctly.\n\n* `getBaseNameForSeeing(seeing)`: base name for measurement, given seeing (i.e., `\u003calgName\u003e_\u003cseeingIndex\u003e`).\n* `getApertureResultName(seeing, radius)`: name for aperture measurement result (i.e., `\u003calgName\u003e_\u003cseeingIndex\u003e_aperName\u003e`).\n* `getKronResultName(seeing)`: name for Kron measurement result (i.e., `\u003calgName\u003e_\u003cseeingIndex\u003e_kron`).\n* `getAllApertureResultNames()`: list of all aperture result names (the results of `getApertureResultName` called for all seeings and aperture radii).\n* `getAllKronResultNames()`: list of all Kron result names (the results of `getKronResultName` called for all seeings).\n* `getAllResultNames()`: list of all aperture and Kron result names (the results of `getAllApertureResultNames` and `getAllKronResultNames`).\n\n\n## Errors\n\u003ca name=\"errors\"\u003e\u003c/a\u003e\n\nNote that no effort is made to account for covariance when estimating errors, and hence the reported errors are likely underestimated.  This is especially true for coadds and other images that already have covariance.\n\n\n## Configuration for use with `SingleFrameMeasurementTask`\n\nThis is a plugin, so all you need to do is load, activate and configure the plugin, and the `SingleFrameMeasurementTask` will run it.\nTo do so, use something like the following in a configuration file:\n\n    # Load plugin\n    import lsst.meas.extensions.convolved\n    # Activate plugin\n    config.plugins.names.add(\"ext_convolved_ConvolvedFlux\")\n    # Configure plugin\n    config.algorithms[\"ext_convolved_ConvolvedFlux\"].seeing = [2.5, 4.0, 6.0]\n    config.algorithms[\"ext_convolved_ConvolvedFlux\"].aperture.radii = [3.0, 5.0, 7.0]\n    \nIf you haven't done so elsewhere, you will also need to load and activate the Kron measurement plugin in order to get Kron radii for the convolved measurement:\n\n    # Load and activate Kron\n    import lsst.meas.extensions.photometryKron\n    config.plugins.names.add(\"ext_photometryKron_KronFlux\")\n    \nIn the above snippets, `config` is a `SingleFrameMeasurementConfig`.  I recommend putting the above configuration in a new file (e.g., `/path/to/convolvedConfig.py`) and loading that file from a top-level task configuration file.  For example, with `processCcd.py`:\n\n    config.charImage.measurement.load(\"/path/to/convolvedConfig.py\")  # to calculate aperture corrections\n    config.calibrate.measurement.load(\"/path/to/convolvedConfig.py\")\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsst%2Fmeas_extensions_convolved","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flsst%2Fmeas_extensions_convolved","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsst%2Fmeas_extensions_convolved/lists"}