You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ngmix requires variance maps (or inverse variance maps, I can't ever remember which) as input. Theli weights need to be rescaled by the inverse sky variance. Megapipe weights are mysterious, so non-zero pixels are set to 1 then scaled by the inverse background variance. This inverse variance is currently calculated per postage stamp. I think this should be updated to the sextractor value (which should be already present in the psfex run) in the vignet step. Also, we need to find out what the megapipe weights actually contain.
I found this "The values of a weight map pixel is proportional to the inverse of the variance of that pixel in the main image." This documentation is for an older version of megapipe when cfht had 36 ccds. However, the images themselves seem to have pixel values of 1 or zero. Time to email Stephen Gwyn to make sure.
What ngmix needs are inverse variance weights.
Those maps can almost be created for free with the pipeline as it is. The procedure that is used to get the background images can be applied to create an rms map. Basically by just adding BACKGROUND_RMS to the list of CHECKIMAGE_TYPE. Then, just like we do with the background, the pipeline can creates postage stamps with the vignet_maker at galaxy positions. Finally there will be a little bit of work in the ngmix_runner to read those files as input and compute the 1/(BACKGROUND_RMS)^2 which should be very easy to do.
Side note: I just noticed that SExtractor can actually produce a background subtracted image by adding -BACKGROUND to the list of check images. We could consider doing that instead of computing it in the ngmix_runner. Results should be identical though.
Activity
lbaumo commentedon Jan 11, 2023
I found this "The values of a weight map pixel is proportional to the inverse of the variance of that pixel in the main image." This documentation is for an older version of megapipe when cfht had 36 ccds. However, the images themselves seem to have pixel values of 1 or zero. Time to email Stephen Gwyn to make sure.
lbaumo commentedon Jan 11, 2023
from Stephen Gwyn "The weight images for the individual images are, strictly speaking, masks (0 or 1)"
aguinot commentedon Jan 19, 2023
What ngmix needs are inverse variance weights.
Those maps can almost be created for free with the pipeline as it is. The procedure that is used to get the background images can be applied to create an rms map. Basically by just adding
BACKGROUND_RMSto the list of CHECKIMAGE_TYPE. Then, just like we do with the background, the pipeline can creates postage stamps with the vignet_maker at galaxy positions. Finally there will be a little bit of work in the ngmix_runner to read those files as input and compute the1/(BACKGROUND_RMS)^2which should be very easy to do.Side note: I just noticed that SExtractor can actually produce a background subtracted image by adding
-BACKGROUNDto the list of check images. We could consider doing that instead of computing it in the ngmix_runner. Results should be identical though.martinkilbinger commentedon Dec 11, 2023
Would be good to use the THELI weight images.
felt: review-ngmix-v2-pr740 round 3 — Martin responded to 6/11; verif…
felt: review-ngmix-v2-pr740 — workflow results on weights + size (2 d…
felt: draft two work-stream constitutions from the ngmix v2.0 review
fix(ngmix): zero fallback weights for degenerate constant stamps
test(ngmix): pin spatially-varying RMS through the observation chain