302.3 Derived Stellar Properties

I’ve been working through RSP Notebook Tutorial 302.3 and I have suggestions and a question about this very nice tutorial.
The color transformations from ComCam to SDSS are based on RTN-099 (this document has many, many other transformations in it as well). I think the boundary conditions should be included with the transformations so, instead of:

ug = objtab["u_psfMag0"] - objtab["g_psfMag0"]
gr = objtab["g_psfMag0"] - objtab["r_psfMag0"]
gi = objtab["g_psfMag0"] - objtab["i_psfMag0"]
ri = objtab["r_psfMag0"] - objtab["i_psfMag0"]
iz = objtab["i_psfMag0"] - objtab["z_psfMag0"]

gi_sdss = 1.065*gi + 0.005
gr_sdss = 1.058*gr + 0.058*ri - 0.002
u_sdss = objtab["u_psfMag0"] + 0.587*gi**2 + 1.424*gi + 0.758 where -1.1 < gi_sdss <= -.4
u_sdss = objtab["u_psfMag0"] + 0.063*gi**2 - 0.192*gi + 0.263 where -0.4 < gi_sdss <= 0.8
u_sdss = objtab["u_psfMag0"] - 0.0003*gi**2 + 0.174*gi + 0.059 where 0.8 < gi_sdss <= 3.9

may I suggest:

ug = objtab["u_psfMag0"] - objtab["g_psfMag0"]
gr = objtab["g_psfMag0"] - objtab["r_psfMag0"]
gi = objtab["g_psfMag0"] - objtab["i_psfMag0"]
ri = objtab["r_psfMag0"] - objtab["i_psfMag0"]
iz = objtab["i_psfMag0"] - objtab["z_psfMag0"]

gi_conditions = [(gi > 0.2) & (gi <= 3.1)]
gi_outputs = [(1.065*gi + 0.005)]
gi_sdss = np.select(gi_conditions, gi_outputs, default=np.nan)

gr_outputs = [(1.058*gi + 0.058*ri -0.0020)]
gr_sdss = np.select(gi_conditions, gr_outputs, default=np.nan)

# Set the conditions for gi_sdss
u_conditions = [
    (gi_sdss > -1.1) & (gi_sdss <= -0.4),
    (gi_sdss > -0.4) & (gi_sdss <= 0.8),
    (gi_sdss > 0.8) & (gi_sdss <= 3.9)
]

# Define the outputs based on those conditions
u_outputs = [
    objtab["u_psfMag0"] + 0.587 * gi_sdss ** 2 + 1.424 * gi_sdss + 0.758,
    objtab["u_psfMag0"] + 0.063 * gi_sdss ** 2 - 0.192 * gi_sdss + 0.263,
    objtab["u_psfMag0"] - 0.0003 * gi_sdss ** 2 + 0.174 * gi_sdss + 0.059
]

# Apply the conditions
objtab['u_sdss'] = np.select(u_conditions, u_outputs, default=np.nan)

Also, I used 16.5 ≤ m ≤ 23.5 instead of the SDSS range of 14 < m < 19.5. The results for all these changes produce little change in the temperature and metallicity plots, other than to add more data points.

Do those modifications make sense?

My last question is about the transformation of g-r from ComCam to SDSS:

gr_sdss = 1.058*gr + 0.058*ri - 0.002

The relation is not explicitly given in RTN-099 (did I mention what a great document that is?) and I haven’t been able to replicate it. I’ve tried g_sdss - r_sdss and (g-i)_sdss - r_sdss + i_sdss. Could my math be bad?
Thank you again for all these tutorials : )

Thank you, @babel for your suggestions and questions! We’ve created an internal ticket to implement your suggestion to the tutorial.

Regarding the question about modifying the SDSS magnitude range, while I haven’t tested this specific scenario personally, I would recommend caution. Applying these relationships to stars outside the calibrated range may require additional validation to ensure accuracy.

Thank you, @babel, for alerting this to us!

Regarding your questions:

  1. Color limits: yes, the color limits found in RTN-099 should be used. A given transformation relation might not work well for objects much bluer or much redder than the relation’s color limits. (This is particularly true for the higher-order transformation equations.) Ideally, consult the QA plots given for each transformation relation in RTN-099 to check the color range for a given transformation.
  2. Magnitude limits: the magnitude limits are less of a concern than the color limits – the transformations should apply for objects that are brighter or fainter than the data set used, but, as @galaxyumi331 noted, some caution is recommended. In a future update of RTN-099, a brightness effect can be checked for in these relations.
  3. Comcam → SDSS g-r: the relation
gr_sdss = 1.058*gr + 0.058*ri - 0.002

can be derived directly from the ComCam <–> SDSS transformation equations in RTN-099:
First, start from the ComCam–>SDSS relations for g and r:

g_sdss - g_ComCam = +0.066(g-i)_ComCam - 0.006
r_sdss - r_ComCam = +0.007(g-i)_ComCam - 0.005

becomes:

g_sdss = g_ComCam + 0.066(g-i)_ComCam - 0.006
r_sdss = r_ComCam + 0.007(g-i)_ComCam - 0.005

Second, subtracting r_sdss from g_sdss results in:

(g-r)_sdss = (g-r)_ComCam + 0.059(g-i)ComCam - 0.001

Third, introduce ComCam colors:

(g-i)_ComCam = (g-r)_ComCam  + (r-i)_ComCam

Fourth, substitute the ComCam colors into the equation for (g-r)_sdss above:

(g-r)_sdss = (g-r)_ComCam + 0.059((g-r)_ComCam + (r-i)_ComCam) - 0.001

which, after simplying, becomes:

(g-r)_sdss = 1.059(g-r)_ComCam + 0.059(r-i)_ComCam - 0.001

The equation,

gr_sdss = 1.058*gr + 0.058*ri - 0.002

was taken straight from Equation 3 of the preprint version of Palaversa, Donev, Ivezić, et al. (2025). It is very slightly different from the equation we derived here, and the version in that paper might have been based on relations from an earlier version of RTN-099. (The differences are pretty insignificant – only at the 0.001 level.)

For the notebook, we probably should use the newer version:

(g-r)_sdss = 1.059(g-r)_ComCam + 0.059(r-i)_ComCam - 0.001

(Note: it is too late in the day for me to do algebra properly, so I had CoPilot-GPT5 derive the above (g-r)_sdss equation from the equations in RTN-099! :slight_smile: )

I hope this helps!

Best regards,
Douglas

PS: One needs to be wary of u-band transformations. For stars, they tend to have a few percent (few 0.01-mag) dependence on Galactic latitude. That has not been included in the ComCam <–> SDSS u-band transformations in RTN-099 at this time. Still, they are better than nothing. Without a Galactic Latitude correction, I would still probably trust them to about 0.05-mag from Galactic Pole to Galactic Equator.)

1 Like

That’s VERY helpful Douglas! Thank you, I don’t think I’d have ever figured that out. It seems like it would be worthwhile to add a link to this forum thread to the tutorial regarding the derivation of gr_sdss. I’ll adjust my gr_sdss equation as you suggested.
I couldn’t really tell the difference in the temperature and metallicity color-color plots when I included the boundary conditions, but the 16.5 ≤ m ≤ 23.5 magnitude range change is noticeable. One issue is that many objects in the brighter part of the 14 < m < 19 SDSS range should be saturated in the dp01 dataset. Here are the cc temp. and metallicity plots for the tutorial and my modifications:




Thanks again, Douglas!