Add band-dependent Double-sersic/Catalog-Source color gradients - #438
Add band-dependent Double-sersic/Catalog-Source color gradients#438FerroYx wants to merge 11 commits into
Conversation
|
Still in progress; currently revising the HST section and adding a fallback option to Double Service in case there is no match in the HST source. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #438 +/- ##
==========================================
+ Coverage 98.61% 98.64% +0.03%
==========================================
Files 114 115 +1
Lines 8819 9018 +199
==========================================
+ Hits 8697 8896 +199
Misses 122 122
🚀 New features to boost your workflow:
|
6e065ba to
4f4eca3
Compare
|
@FerroYx I am in the process of refactoring the Deflector() class to have access to all the Source() class features. So might not all be needed here for the deflectors. |
|
@sibirrer No problem, I'll wait till you update that part and make necessary modification.
|
|
@FerroYx we have merged a major PR for deflector re-factoring. So now, you only need the Source() classes to be updated to have this enabled. Let me know in case there are any issues with the merge conflict |
…organize some methods to Util
4f4eca3 to
3e144e3
Compare
sibirrer
left a comment
There was a problem hiding this comment.
Thank you very much! I give here a first batch of comments
| if "e1" in kwargs_source and "e2" in kwargs_source: | ||
| e1_light, e2_light = kwargs_source["e1"], kwargs_source["e2"] | ||
| else: | ||
| e1_light, e2_light = ( |
There was a problem hiding this comment.
this is a bit tricky. I would have liked the total effective ellipticity to be used to connect mass and light, and not just one component (which might not be the dominating one)
| bands = _OBSERVATORY_REGISTRY[obs_name]["bands"] | ||
| if len(bands) == 1: | ||
| return 0.0 | ||
| return float(bands.index(band)) / float(len(bands) - 1) |
There was a problem hiding this comment.
I don't know what is happening here. I would have assumed that you use the weighted wavelength dependent transmission
| LSST_BAND_LIST = ["u", "g", "r", "i", "z", "y"] | ||
| EUCLID_BAND_LIST = ["VIS", "Y", "J", "H"] | ||
|
|
||
| _DEFAULT_BAND_CENTRAL_WAVELENGTH_MICRON = { |
There was a problem hiding this comment.
this is a bit dangerous as the naming convention for the bands are not handled here.
There should be a more central part where the band configurations are handled by. Tagging here @timedilatesme that might also give you a direction
|
|
||
|
|
||
| def get_band_normalized_position(band, reference_band=None): | ||
| """Return a normalized wavelength position for a registered band. |
There was a problem hiding this comment.
I don't know what "position" here means.
I don't know what this definition should achieve
| raise ValueError( | ||
| "semi-major and semi-minor axis are missing for the first light" | ||
| " profile in galaxy_list columns %s" % colnames | ||
| "semi-major and semi-minor axis or angular_size are missing " |
There was a problem hiding this comment.
this is a less specific error message. Make it clear what the issue is, not and/or
| if catalog_type != "HST_COSMOS": | ||
| raise ValueError( | ||
| "band_dependent_color_gradient is currently supported only " | ||
| "for HST_COSMOS." |
There was a problem hiding this comment.
make sure this is for catalog_type "HST_COSMOS". You can also print the actual catalog type used for better readability
| ) | ||
| if not isinstance(self._color_gradient, dict): | ||
| raise ValueError( | ||
| "color_gradient must be a dictionary when " |
There was a problem hiding this comment.
add in error message what color_gradient actually is at input
Intro
Based on MegaMorph we know that galaxy structural parameters and flux distribution can vary smoothly with wavelength.
And On the shear estimation bias induced by the spatial variation of
colour across galaxy profiles displays that Spatial color gradients cause differences in the effective morphology across different bands and affect chromatic PSF and shear measurements.
So far,
Slsim's color gradient is a simple model fixed for any band. And it's similar for Catalog Source (HST), which only offer single band images.To achieve color gradients that more closely reflect reality, I will update the Double Sersic and Catalog Source modules to provide band-dependent color gradients.
Model
For a reference-band component weight
w0, the first-component weight in bandbis defined as[
w_0(b) =
\mathrm{sigmoid}\left[
\mathrm{logit}(w_0) +
s \left(p(b) - p(b_{\rm ref})\right)
\right],
]
where
p(b)is the normalized position of the band in wavelength space andsiscolor_gradient["strength"]. The second-component weight isw1(b) = 1 - w0(b).This form was chosen as a phenomenological parameterization because it:
w0andw1in the reference band;relatively redder (
strength > 0) or bluer (strength < 0);central wavelengths.
This is not intended to be a physical component-SED model or a direct fit to
a particular observed colour-gradient relation. It provides a controlled
first-order model for multi-band simulation and sensitivity tests.