Skip to content

[NEW FEATURE] Weight Handling #604

Closed

Description

@lbaumo

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.

Activity

  1. added
    enhancement
    on Jan 11, 2023
  2. lbaumo commented on Jan 11, 2023

    @lbaumo
    ContributorAuthor

    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.

  3. lbaumo commented on Jan 11, 2023

    @lbaumo
    ContributorAuthor

    from Stephen Gwyn "The weight images for the individual images are, strictly speaking, masks (0 or 1)"

  4. aguinot commented on Jan 19, 2023

    @aguinot
    Contributor

    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.

  5. added this to the Re-run 2023 milestone on Apr 5, 2023
  6. martinkilbinger commented on Dec 11, 2023

    @martinkilbinger
    Contributor

    Would be good to use the THELI weight images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions