jiwoncpark / baobab

Generates the training data for hierarchical inference of strongly-lensed systems with Bayesian neural networks
MIT License
11 stars 2 forks source link

Sample populations using SkyPy #17

Open jiwoncpark opened 5 years ago

jiwoncpark commented 5 years ago

Class KCorrector accepts the SED, dust, and input/output filter throughputs and numerically integrates to get the K-corrected apparent magnitude

jiwoncpark commented 3 years ago

This module, along with an SED library, is necessary to adapt a real galaxy catalog, e.g. COSMOS, to the desired target bandwidth.

sibirrer commented 3 years ago

Hi @jiwoncpark Will the skypy libraries work for you? https://github.com/skypyproject/skypy/tree/master/skypy/galaxy Here is a notebook that uses the skypy distributions (mag-size of galaxies with galaxy templates and k-corrections): https://github.com/sibirrer/lenstronomy_extensions/blob/master/lenstronomy_extensions/Notebooks/skypy_lenstronomy.ipynb

Having it integrated/compatible with skypy might be good in the long run as there is heavy development and wide use of this case in the project.

jiwoncpark commented 3 years ago

Hi @sibirrer, awesome, thanks! I do want to maximize the use of well-validated modules from SkyPy and GalSim. This is a good early point to refactor Baobab to wrap more heavily around SkyPy. The workflow could then be:

  1. Start with a more flexible Baobab config, phrased in terms of a ML training set
  2. SkyPy config generated for population functions
  3. SkyPy Pipeline catalog
  4. GalSim generates the image of associated real/realistic galaxy
  5. Read into Lenstronomy Interpol, for cosmographic computations
  6. Baobab combines and logs all metadata in expected formats

Prescription for how to do the K-correction (source/target redshifts/bands, luminosity) would be propagated from 1 onto 2 and 3.

sibirrer commented 3 years ago

This sounds excellent! What SkyPy really already managed is to produce realistic (and matched with data!) magnitude, size and color distributions (by design when taking these distributions from the literature, but highly non-trivial to make it work in an end-to-end pipeline!). With SkyPy there are also the options to 'just' use the template settings that have shown to match imaging surveys (and spectroscopic surveys to come). For point 3-4, @swagnercarena @JelleAalbers and Elise are also working on HST images and nearby galaxies and are very successful in doing so (not matching specific mag-size-color distribution but 'randomly' choosing them from the galaxy catalogue and shrinking them to a higher redshift). So there is super cool potential to integrate these modules all together! We should talk early next year about those things and I am also very happy if part of this can directly be integrated or accessed in SkyPy itself. The SkyPy team is super cool and this could also be a great opportunity to benefit from each other. I also reference @ntessore who provided the skypy settings to be used by lenstronomy in the notebook I referenced (and who is a key contributor to skypy.

jiwoncpark commented 3 years ago

Agreed that all these efforts can complement one another and converge at some point! I'm looking forward to chatting soon. Referencing Issue #56, which corresponds to Step 4. As mentioned there, my intermediate goal is to (1) describe LSST-like populations at the mag/size/color level, and (2) generate the corresponding images AND/OR query real images and adapt them to LSST specs (similar to the work by @swagnercarena @JelleAalbers and Elise).