Skip to content

Commit

Permalink
Merge pull request #625 from LSSTDESC/diffsky_v0.1
Browse files Browse the repository at this point in the history
Diffsky v0.1
  • Loading branch information
evevkovacs authored Nov 28, 2023
2 parents e236855 + 2f00fa3 commit b62d833
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
based_on: cosmoDC2_v1.1.4

healpix_pixels: [8787, 8914, 8915, 9042, 9043, 9044, 9170, 9171, 9299]
sky_area: 30.214571

include_in_default_catalog_list: true
32 changes: 32 additions & 0 deletions GCRCatalogs/catalog_configs/roman_rubin_2023_v1.1.1_elais.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Use ^/ to indicate file path relative to GCR root dir

subclass_name: cosmodc2.DiffSkyGalaxyCatalog

catalog_root_dir: ^/xgal/roman-rubin/roman_rubin_2023_v1.1.1
catalog_filename_template: roman_rubin_2023_z_{}_{}_cutout_{}.hdf5

healpix_pixels: [9921, 9922, 9923, 9924, 9925, 10050, 10051, 10052, 10053, 10177, 10178, 10179, 10180, 10181, 10305, 10306, 10307, 10308, 10429, 10430, 10431, 10432, 10549, 10550, 10551, 10552, 10665, 10666, 10667, 10668, 10777, 10778, 10779]

cosmology:
H0: 71.0
Om0: 0.2648
Ob0: 0.0448
sigma8: 0.8
n_s: 0.963

lightcone: true

version: "1.1.1"

check_md5: false
check_size: false
check_cosmology: false
ensure_meta_consistent: false
sky_area: 110.7868

creators: ['Andrew Hearin', 'Eve Kovacs', 'Esteban Rangel', 'Patricia Larsen', 'Katrin Heitmann']

description: |
This is the 110 sq. deg. extra-galactic catalog covering the ELAIS field for the Roman-Rubin image simulations for LSST DESC that has been created with fully forward modeled SEDs
include_in_default_catalog_list: false
39 changes: 23 additions & 16 deletions GCRCatalogs/cosmodc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ def _generate_quantity_modifiers(self):
'stellar_mass': 'totalMassStellar',
'stellar_mass_disk': 'diskMassStellar',
'stellar_mass_bulge': 'spheroidMassStellar',
'size_disk_true': 'morphology/diskMajorAxisArcsec',
'size_bulge_true': 'morphology/spheroidMajorAxisArcsec',
'size_disk_true': 'morphology/diskHalfLightRadiusArcsec',
'size_bulge_true': 'morphology/spheroidHalfLightRadiusArcsec',
'size_minor_disk_true': 'morphology/diskMinorAxisArcsec',
'size_minor_bulge_true': 'morphology/spheroidMinorAxisArcsec',
'position_angle_true_dc2': (_gen_position_angle, 'morphology/positionAngle'),
Expand All @@ -462,19 +462,20 @@ def _generate_quantity_modifiers(self):
'ellipticity_2_bulge_true': (_calc_ellipticity_2, 'morphology/spheroidEllipticity', 'morphology/positionAngle'),
'size_true': (
_calc_weighted_size,
'morphology/diskMajorAxisArcsec',
'morphology/spheroidMajorAxisArcsec',
'morphology/diskHalfLightRadiusArcsec',
'morphology/spheroidHalfLightRadiusArcsec',
'LSST_filters/diskLuminositiesStellar:LSST_r:rest',
'LSST_filters/spheroidLuminositiesStellar:LSST_r:rest',
),
'size_minor_true': (
_calc_weighted_size_minor,
'morphology/diskMajorAxisArcsec',
'morphology/spheroidMajorAxisArcsec',
'morphology/diskHalfLightRadiusArcsec',
'morphology/spheroidHalfLightRadiusArcsec',
'LSST_filters/diskLuminositiesStellar:LSST_r:rest',
'LSST_filters/spheroidLuminositiesStellar:LSST_r:rest',
'morphology/totalEllipticity',
),

'bulge_to_total_ratio_i': (
lambda x, y: x/(x+y),
'SDSS_filters/spheroidLuminositiesStellar:SDSS_i:observed',
Expand Down Expand Up @@ -607,8 +608,7 @@ class DiffSkyGalaxyCatalog(CosmoDC2ParentClass):
DiffSky galaxy catalog reader, inherited from CosmoDC2ParentClass
Class for new generation of catalogs generated with JAX-based
forward modeling techniques.
This reader is used by SkySim v3+ (not SkySim5000) catalogs and the forthcoming
DiffSky series.
This reader is used by the skysim_v3, diffsky and roman_rubin_2023 catalog series
"""

def _get_group_names(self, fh):
Expand All @@ -629,12 +629,13 @@ def _generate_quantity_modifiers(self):
'magnification': (lambda mag: np.where(mag < 0.2, 1.0, mag), 'magnification'),
'halo_id': 'target_halo_id',
'halo_mass': (lambda x: x/self.cosmology.h, 'target_halo_mass'),
'stellar_mass': 'obs_sm',
'size_disk_true': 'diskMajorAxisArcsec',
'size_bulge_true': 'spheroidMajorAxisArcsec',
'size_minor_disk_true': 'diskMinorAxisArcsec',
'size_minor_bulge_true': 'spheroidMinorAxisArcsec',
'position_angle_true': (_gen_position_angle, 'positionAngle'),
'stellar_mass': (lambda x: np.power(10, x), 'logsm_obs'),
'bulge_to_total_ratio': 'bulge_frac',
'size_disk_true': 'diskHalfLightRadiusArcsec',
'size_bulge_true': 'spheroidHalfLightRadiusArcsec',
'position_angle_true_phosim': 'positionAngle',
'position_angle_true': (np.negative, 'positionAngle'),
'ellipticity_true': 'totalEllipticity',
'ellipticity_disk_true': 'diskEllipticity',
'ellipticity_bulge_true': 'spheroidEllipticity',
'position_x': (lambda x: x/self.cosmology.h, 'x'),
Expand All @@ -643,9 +644,15 @@ def _generate_quantity_modifiers(self):
'velocity_x': 'vx',
'velocity_y': 'vy',
'velocity_z': 'vz',
'is_central': (lambda x: x == -1, 'source_galaxy_upid')
}

#check for quantity options to ensure backwards compatibility
hsc_list = [q for q in self._native_quantities if 'hsc' in q]
if 'um_source_galaxy_upid' in self._native_quantities:
quantity_modifiers['is_central'] = (lambda x: x == -1, 'um_source_galaxy_upid')
else:
quantity_modifiers['is_central'] = (lambda x: x == -1, 'source_galaxy_upid')

# add magnitudes
for band in 'ugrizyY':
if band != 'y' and band != 'Y':
Expand All @@ -654,7 +661,7 @@ def _generate_quantity_modifiers(self):
quantity_modifiers['mag_true_{}_sdss'.format(band)] = 'SDSS_obs_{}'.format(band.lower())
quantity_modifiers['Mag_true_{}_sdss_z0'.format(band)] = 'SDSS_rest_{}'.format(band.upper())

if band != 'u' and band != 'Y':
if band != 'u' and band != 'Y' and hsc_list:
quantity_modifiers['mag_{}_hsc'.format(band)] = (_calc_lensed_magnitude, 'HSC_obs_{}'.format(band),
'magnification',)
quantity_modifiers['mag_true_{}_hsc'.format(band)] = 'HSC_obs_{}'.format(band.lower())
Expand Down

0 comments on commit b62d833

Please sign in to comment.