LSSTDESC / gcr-catalogs

A Python module that provides a unified interface to access mock galaxy catalogs and more for the LSST DESC
https://github.com/LSSTDESC/gcr-catalogs
BSD 3-Clause "New" or "Revised" License
25 stars 20 forks source link

Add MW extinction to `dc2_object_*` catalogs. #261

Closed wmwv closed 4 years ago

wmwv commented 5 years ago

Add MW extinction to dc2_object_* catalogs.

  1. [ ] Determine extinction model.
  2. [ ] Double-check what was used in the image simulations.
  3. [ ] Download a dust extinction map with a Python API.
  4. [ ] Provide a function look-up within GCR.
  5. [ ] Consider mixin/composite.
    • @yymao you had a plan for this. I've forgotten it.
  6. [ ] Consider performance of having the function.
  7. [ ] Get into next GCR release
wmwv commented 5 years ago

Dust Extinction package Dust map packages I found after some brief search:

https://github.com/gregreen/dustmaps

rmandelb commented 5 years ago

May require two external utilities: 1 = get E(B-V) from dust map using some utility (like one of the ones mentioned above), and 2 = get A_lambda given E(B-V) and R_v for a given dust law. e.g., https://github.com/jmeyers314/ImageSimulationRecipes/blob/master/python/utensils/extinction.py has a few dust laws. I thought CatSim uses the CCM dust law with R_v=3.1 for the Milky Way, but obviously we need to confirm.

wmwv commented 5 years ago

@danielsf What's the dust map infrastructure within lsst_sims?

We should probably just use the same here, more for simplicity of software support than correctness (we don't know truth for the Universe).

danielsf commented 5 years ago

The sims used the dust map from Schlegel, Finkbeiner, and Davis with the Cardelli, Clayton, and Mathis extinction law applied.

There is a (somewhat clunky) utility in lsst_sims to get E(B-V) from the SFD maps. It works something like

from lsst.sims.catUtils.dust import EBVbase

ebv_gen = EBVbase()

ebv = ebv_gen.calculateEbv(equatorialCoordinates=(my_ra, my_dec))
wmwv commented 5 years ago

What did you use to implement CCM?

yymao commented 5 years ago

If the computation time is low, we can just add Ebv as quantity modifiers (i.e. modifying ra and dec). If the computation time is high, we can store them on disk and provide it as composite catalog.

sschmidt23 commented 5 years ago

@wmwv @yymao Has there been any decision on this? Photo-z will need galaxies dereddened of MW dust in order to compute photo-z's. In my opinion, it seems like a composite catalog with quantites dereddened would be a good idea, as almost everyone in DESC, I assume, will be using those rather than "raw" magnitudes, so this dereddening would be done on almost all queries for galaxy samples. Plus, if left to the user there is a possibility of mistakes if they use the wrong dust law (Calzetti vs Cardelli, Clayton, Mathis, for example) or the wrong Rv values.

danielsf commented 5 years ago

Sorry I didn't see Michael's last question (from four months ago...)

We implemented CCM ourselves here

https://github.com/lsst/sims_photUtils/blob/master/python/lsst/sims/photUtils/Sed.py#L921

the addDust method in that same file actually applies the dust extinction to an SED.

yymao commented 4 years ago

@wmwv @rmandelb @sschmidt23 This MW extinction thing had high priority once upon a time, but we seem to lose the momentum. I'm assigning it with a medium priority but I wonder if it is still a desired feature in gcr-catalogs?

sschmidt23 commented 4 years ago

I think it would still be useful to have for the run[x].[y] catalogs, you do need it compute correct color cuts, photo-z's, etc... A few months ago I put together a demo notebook on how to deredden in the DC2-analysis repo by reverse engineering what Scott did to add the reddening, though I don't think I ever merged it: https://github.com/LSSTDESC/DC2-analysis/blob/u/sschmidt23/mwdust/contributed/Deredden_MW_dust.ipynb (I'll create a PR and ask someone to review the notebook there). But, maybe this notebook would be helpful in figuring out how to best expose some dereddening functionality to users?

yymao commented 4 years ago

Thanks @sschmidt23 --- I think then the question is whether this notebook is enough to serve those who need dereddening, or if we still need this functionality in GCR. (cc @JoanneBogart)

johannct commented 4 years ago

I'll be happy to be assigned and brainstorm on the question of where it goes and in what form.

yymao commented 4 years ago

It seems like we will not be adding MW extinction via GCR (users can calculate them following the tutorial notebook @sschmidt23 made).

Closing this now unless people feel strongly that we should add MW extinction via GCR.