diff --git a/config/calibrate.py b/config/calibrate.py index c1833486..cf4cfbfd 100644 --- a/config/calibrate.py +++ b/config/calibrate.py @@ -30,4 +30,16 @@ # See Slack: https://lsstc.slack.com/archives/C2B6X08LS/p1586468459084600 config.astrometry.wcsFitter.order = 4 +# Photometric calibration: use color terms +config.photoCal.applyColorTerms = True +colors = config.photoCal.match.referenceSelection.colorLimits +# The following two color limits are adopted from obs_subaru for HSC SSP survey. +colors["g-r"] = ColorLimit(primary="g_flux", secondary="r_flux", minimum=0.0) +colors["r-i"] = ColorLimit(primary="r_flux", secondary="i_flux", maximum=0.5) +# The following magnitude limit is also adopted from obs_subaru for HSC SSP survey. +config.photoCal.match.referenceSelection.doMagLimit = True +config.photoCal.match.referenceSelection.magLimit.fluxField = "i_flux" +config.photoCal.match.referenceSelection.magLimit.maximum = 22.0 +config.photoCal.colorterms.load(os.path.join(obsConfigDir, 'colorterms.py')) + config.measurement.load(os.path.join(obsConfigDir, "hsm.py")) diff --git a/config/colorAnalysis.py b/config/colorAnalysis.py new file mode 100644 index 00000000..028f5a09 --- /dev/null +++ b/config/colorAnalysis.py @@ -0,0 +1,5 @@ +import os.path + +config.load(os.path.join(os.path.dirname(__file__), "extinctionCoeffs.py")) +from lsst.obs.decam.decamFilters import DECAM_FILTER_DEFINITIONS +config.physicalToBandFilterMap = DECAM_FILTER_DEFINITIONS.physical_to_band \ No newline at end of file diff --git a/config/colorterms.py b/config/colorterms.py new file mode 100644 index 00000000..0dea1e79 --- /dev/null +++ b/config/colorterms.py @@ -0,0 +1,51 @@ +from lsst.pipe.tasks.colorterms import Colorterm, ColortermDict + +# Average color terms for the DECam filters are calculated using the Pickles stellar spectra atlas. +# The following values are provided by Song Huang (Tsinghua University; dr.guangtou@gmail.com) +# Color terms for u, Y, N964, and N419 bands are not available now. + +# The values for DECam g, r, & z-band are calculated independently and are different with the values from: https://www.legacysurvey.org/dr9/description/ +# A Jupyter notebook is available at https://github.com/MerianSurvey/caterpillar/blob/main/notebook/photocal/merian_filter_color_terms.ipynb +# to reproduce these values. + +# In obs_subaru, colorterms.py is also used in: +# - config/jointcal.py +# - config/skyAnalysis.py +# - config/compareCoaddAnalysis.py +# - config/coaddAnalysis.py +# - config/visitAnalysis.py +# - config/fgcmBuildStarsTable.py and config/fgcmBuildStars.py +# These files are not available for obs_decam yet. + +config.data = { + "decam*": ColortermDict(data={ + 'g': Colorterm(primary="g", secondary="g"), + 'r': Colorterm(primary="r", secondary="r"), + 'i': Colorterm(primary="i", secondary="i"), + 'z': Colorterm(primary="z", secondary="z"), + }), + "sdss*": ColortermDict(data={ + 'g': Colorterm(primary="g", secondary="r", c0=-0.008015, c1=-0.089869, c2=-0.018398), # For -1.0 < g-r < 1.8 + 'r': Colorterm(primary="r", secondary="i", c0=-0.0077434, c1=-0.202615, c2=0.016042), # For -1.0 < r-i < 2.2 + 'i': Colorterm(primary="i", secondary="z", c0=0.00018887, c1=-0.2748281, c2=-0.029417), # For -1.0 < i-z < 1.2 + 'z': Colorterm(primary="z", secondary="i", c0=-0.0059858, c1=0.1131192, c2=0.0156471), # For -1.0 < z-i < 0.5 + 'N708': Colorterm(primary="r", secondary="i", c0=-0.01428724, c1=-0.71755905, c2=0.08959316), # For -1.0 < r-i < 2.0 + 'N540': Colorterm(primary="g", secondary="r", c0=-0.03359776, c1=-0.57665033, c2=-0.01510509), # For -1.0 < g-r < 1.5 + }), + "hsc*": ColortermDict(data={ + 'g': Colorterm(primary="g", secondary="r", c0=0.0000509, c1=-0.0152487, c2=-0.0029937), # For -1.0 < g-r < 1.4 + 'r': Colorterm(primary="r", secondary="i", c0=-0.0078995, c1=-0.1695323, c2=0.0251978), # For -1.0 < r-i < 2.2 + 'i': Colorterm(primary="i", secondary="z", c0=0.0010196, c1=-0.1314031, c2=0.0054605), # For -1.0 < i-z < 1.0 + 'z': Colorterm(primary="z", secondary="y", c0=-0.0013244, c1=-0.2846684, c2=-0.1229817), # For -1.0 < z-y < 0.5 + 'N708': Colorterm(primary="r", secondary="i", c0=-0.01978413, c1=-0.64368838, c2=0.09132738), # For -1.0 < r-i < 2.0 + 'N540': Colorterm(primary="g", secondary="r", c0=-0.03015158, c1=-0.53715834, c2=-0.00202415), # For -1.0 < g-r < 1.5 + }), + "ps1*": ColortermDict(data={ + 'g': Colorterm(primary="g", secondary="r", c0=0.006388, c1=0.045875, c2=-0.004484), # For -1.0 < g-r < 1.2 + 'r': Colorterm(primary="r", secondary="i", c0=-0.006775, c1=-0.187304, c2=0.018928), # For -1.0 < r-i < 2.2 + 'i': Colorterm(primary="i", secondary="z", c0=0.0012204, c1=-0.282956, c2=-0.011321), # For -1.0 < i-z < 1.4 + 'z': Colorterm(primary="z", secondary="y", c0=-0.0087868, c1=-0.5204795, c2=-0.057955), # For -1.0 < z-y < 1.0 + 'N708': Colorterm(primary="r", secondary="i", c0=-0.01508987, c1=-0.69377675, c2=0.09079348), # For -1.0 < r-i < 2.0 + 'N540': Colorterm(primary="g", secondary="r", c0=-0.02635164, c1=-0.50968428, c2=-0.00958104), # For -1.0 < g-r < 1.5 + }), +} \ No newline at end of file diff --git a/config/extinctionCoeffs.py b/config/extinctionCoeffs.py new file mode 100644 index 00000000..8fbb6465 --- /dev/null +++ b/config/extinctionCoeffs.py @@ -0,0 +1,15 @@ +# Extinction coefficients for DECam filters for conversion from E(B-V) to extinction, A_filter. +# Numbers provided by Song Huang (NAOJ). +# +# Band, A_filter/E(B-V) +# Values for N964 and N149 filters are not available at this point. +config.extinctionCoeffs = { + "u": 3.994, + "g": 3.212, + "r": 2.164, + "i": 1.591, + "z": 1.211, + "y": 1.063, + "N708": 1.847, + "N540": 2.753 +} \ No newline at end of file