Skip to content

Commit

Permalink
make sure best aperture is propagated, allow turning off photometry u…
Browse files Browse the repository at this point in the history
…sing annulus for centroids
  • Loading branch information
guynir42 committed Jun 13, 2024
1 parent 7af03e9 commit aa16da5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion default_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ cutting:
measuring:
annulus_radii: [10, 15]
annulus_units: pixels
chosen_aperture: 0
use_annulus_for_centroids: true
analytical_cuts: ['negatives', 'bad pixels', 'offsets', 'filter bank']
outlier_sigma: 3.0
bad_pixel_radius: 3.0
Expand Down
16 changes: 7 additions & 9 deletions pipeline/measuring.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,11 @@ def __init__(self, **kwargs):
'adjust the annulus size for each image based on the PSF width. '
)

# TODO: should we choose the "best aperture" using the config, or should each Image have its own aperture?
self.chosen_aperture = self.add_par(
'chosen_aperture',
0,
[str, int],
'The aperture radius that is used for photometry. '
'Choose either the index in the aperture_radii list, '
'the string "psf", or the string "auto" to choose '
'the best aperture in each image separately. '
self.use_annulus_for_centroids = self.add_par(
'use_annulus_for_centroids',
True,
bool,
'Use the local background measurements via an annulus to adjust the centroids and second moments. '
)

self.analytical_cuts = self.add_par(
Expand Down Expand Up @@ -217,6 +213,7 @@ def run(self, *args, **kwargs):
# make sure to remember which cutout belongs to this measurement,
# before either of them is in the DB and then use the cutouts_id instead
m._cutouts_list_index = i
m.best_aperture = c.sources.best_aper_num

m.aper_radii = c.sources.image.new_image.zp.aper_cor_radii # zero point corrected aperture radii

Expand All @@ -239,6 +236,7 @@ def run(self, *args, **kwargs):
flags,
radii=m.aper_radii,
annulus=annulus_radii_pixels,
local_bg=self.pars.use_annulus_for_centroids,
)

m.flux_apertures = output['fluxes']
Expand Down

0 comments on commit aa16da5

Please sign in to comment.