Skip to content

Commit

Permalink
Add (gen3) physical filter names to config overrides.
Browse files Browse the repository at this point in the history
This duplicates some data, but it's still cleaner than trying to
programmatically rewrite filter names, especially when you consider
the fact that we'll eventually just remove half of these lines.
  • Loading branch information
TallJimbo committed Aug 26, 2019
1 parent 44f5b3f commit 251f583
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 10 deletions.
61 changes: 51 additions & 10 deletions config/hsc/colorterms.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@

config.data = {
"hsc*": ColortermDict(data={
# Names used by Exposure.getFilter() in Gen2.
'g': Colorterm(primary="g", secondary="g"),
'r': Colorterm(primary="r", secondary="r"),
'i': Colorterm(primary="i", secondary="i"),
'z': Colorterm(primary="z", secondary="z"),
'y': Colorterm(primary="y", secondary="y"),
# Names used by data IDs in both Gen2 and Gen3, and
# Exposure.getFilter() in Gen3 (data is the same).
'HSC-G': Colorterm(primary="g", secondary="g"),
'HSC-R': Colorterm(primary="r", secondary="r"),
'HSC-I': Colorterm(primary="i", secondary="i"),
'HSC-Z': Colorterm(primary="z", secondary="z"),
'HSC-Y': Colorterm(primary="y", secondary="y"),
}),
"sdss*": ColortermDict(data={
# Names used by Exposure.getFilter() in Gen2.
'g': Colorterm(primary="g", secondary="r", c0=-0.00816446, c1=-0.08366937, c2=-0.00726883),
'r': Colorterm(primary="r", secondary="i", c0=0.00231810, c1=0.01284177, c2=-0.03068248),
'r2': Colorterm(primary="r", secondary="i", c0=0.00074087, c1=-0.00830543, c2=-0.02848420),
Expand All @@ -20,25 +29,57 @@
'y': Colorterm(primary="z", secondary="i", c0=0.01739708, c1=0.35652971, c2=0.00574408),
'N816': Colorterm(primary="i", secondary="z", c0=0.00927133, c1=-0.63558358, c2=-0.05474862),
'N921': Colorterm(primary="z", secondary="i", c0=0.00752972, c1=0.09863530, c2=-0.05451118),
# Names used by data IDs in both Gen2 and Gen3, and
# Exposure.getFilter() in Gen3 (data is the same).
'HSC-G': Colorterm(primary="g", secondary="r", c0=-0.00816446, c1=-0.08366937, c2=-0.00726883),
'HSC-R': Colorterm(primary="r", secondary="i", c0=0.00231810, c1=0.01284177, c2=-0.03068248),
'HSC-R2': Colorterm(primary="r", secondary="i", c0=0.00074087, c1=-0.00830543, c2=-0.02848420),
'HSC-I': Colorterm(primary="i", secondary="z", c0=0.00130204, c1=-0.16922042, c2=-0.01374245),
'HSC-I2': Colorterm(primary="i", secondary="z", c0=0.00124676, c1=-0.20739606, c2=-0.01067212),
'HSC-Z': Colorterm(primary="z", secondary="i", c0=-0.00680620, c1=0.01353969, c2=0.01479369),
'HSC-Y': Colorterm(primary="z", secondary="i", c0=0.01739708, c1=0.35652971, c2=0.00574408),
'NB0816': Colorterm(primary="i", secondary="z", c0=0.00927133, c1=-0.63558358, c2=-0.05474862),
'NB0921': Colorterm(primary="z", secondary="i", c0=0.00752972, c1=0.09863530, c2=-0.05451118),
}),
"ps1*": ColortermDict(data={
# Names used by Exposure.getFilter() in Gen2.
'g': Colorterm(primary="g", secondary="r", c0=0.005905, c1=0.063651, c2=-0.000716),
'r': Colorterm(primary="r", secondary="i", c0=-0.000294, c1=-0.005458, c2=-0.009451),
'r2': Colorterm(primary="r", secondary="i", c0=0.000118, c1=-0.002790, c2=-0.014363),
'i': Colorterm(primary="i", secondary="z", c0=0.000979, c1=-0.154608, c2=-0.010429),
'i2': Colorterm(primary="i", secondary="z", c0=0.001653, c1=-0.206313, c2=-0.016085),
'z': Colorterm(primary="z", secondary="y", c0=-0.005585, c1=-0.220704, c2=-0.298211),
'y': Colorterm(primary="y", secondary="z", c0=-0.001952, c1=0.199570, c2=0.216821),
'I945': Colorterm(primary="y", secondary="z", c0=0.005275, c1=-0.194285, c2=-0.125424),
'N387': Colorterm(primary="g", secondary="r", c0=0.427879, c1=1.869068, c2=0.540580),
'N468': Colorterm(primary="g", secondary="r", c0=-0.042240, c1=0.121756, c2=0.027599),
'N515': Colorterm(primary="g", secondary="r", c0=-0.021913, c1=-0.253159, c2=0.151553),
'N527': Colorterm(primary="g", secondary="r", c0=-0.020641, c1=-0.366167, c2=0.038497),
'N656': Colorterm(primary="r", secondary="i", c0=0.035658, c1=-0.512071, c2=0.042824),
'N718': Colorterm(primary="i", secondary="r", c0=-0.016294, c1=-0.233139, c2=0.252505),
'N816': Colorterm(primary="i", secondary="z", c0=0.013806, c1=-0.717681, c2=0.049289),
'N921': Colorterm(primary="z", secondary="y", c0=0.002039, c1=-0.477412, c2=-0.492151),
'N973': Colorterm(primary="y", secondary="z", c0=-0.007775, c1=-0.050972, c2=-0.197278),
'I0945': Colorterm(primary="y", secondary="z", c0=0.005275, c1=-0.194285, c2=-0.125424),
'N0387': Colorterm(primary="g", secondary="r", c0=0.427879, c1=1.869068, c2=0.540580),
'N0468': Colorterm(primary="g", secondary="r", c0=-0.042240, c1=0.121756, c2=0.027599),
'N0515': Colorterm(primary="g", secondary="r", c0=-0.021913, c1=-0.253159, c2=0.151553),
'N0527': Colorterm(primary="g", secondary="r", c0=-0.020641, c1=-0.366167, c2=0.038497),
'N0656': Colorterm(primary="r", secondary="i", c0=0.035658, c1=-0.512071, c2=0.042824),
'N0718': Colorterm(primary="i", secondary="r", c0=-0.016294, c1=-0.233139, c2=0.252505),
'N0816': Colorterm(primary="i", secondary="z", c0=0.013806, c1=-0.717681, c2=0.049289),
'N0921': Colorterm(primary="z", secondary="y", c0=0.002039, c1=-0.477412, c2=-0.492151),
'N0973': Colorterm(primary="y", secondary="z", c0=-0.007775, c1=-0.050972, c2=-0.197278),
'N1010': Colorterm(primary="y", secondary="z", c0=0.003607, c1=0.865366, c2=1.271817),
# Names used by data IDs in both Gen2 and Gen3, and
# Exposure.getFilter() in Gen3 (data is the same).
'HSC-G': Colorterm(primary="g", secondary="r", c0=0.005905, c1=0.063651, c2=-0.000716),
'HSC-R': Colorterm(primary="r", secondary="i", c0=-0.000294, c1=-0.005458, c2=-0.009451),
'HSC-R2': Colorterm(primary="r", secondary="i", c0=0.000118, c1=-0.002790, c2=-0.014363),
'HSC-I': Colorterm(primary="i", secondary="z", c0=0.000979, c1=-0.154608, c2=-0.010429),
'HSC-I2': Colorterm(primary="i", secondary="z", c0=0.001653, c1=-0.206313, c2=-0.016085),
'HSC-Z': Colorterm(primary="z", secondary="y", c0=-0.005585, c1=-0.220704, c2=-0.298211),
'HSC-Y': Colorterm(primary="y", secondary="z", c0=-0.001952, c1=0.199570, c2=0.216821),
'IB0945': Colorterm(primary="y", secondary="z", c0=0.005275, c1=-0.194285, c2=-0.125424),
'NB0387': Colorterm(primary="g", secondary="r", c0=0.427879, c1=1.869068, c2=0.540580),
'NB0468': Colorterm(primary="g", secondary="r", c0=-0.042240, c1=0.121756, c2=0.027599),
'NB0515': Colorterm(primary="g", secondary="r", c0=-0.021913, c1=-0.253159, c2=0.151553),
'NB0527': Colorterm(primary="g", secondary="r", c0=-0.020641, c1=-0.366167, c2=0.038497),
'NB0656': Colorterm(primary="r", secondary="i", c0=0.035658, c1=-0.512071, c2=0.042824),
'NB0718': Colorterm(primary="i", secondary="r", c0=-0.016294, c1=-0.233139, c2=0.252505),
'NB0816': Colorterm(primary="i", secondary="z", c0=0.013806, c1=-0.717681, c2=0.049289),
'NB0921': Colorterm(primary="z", secondary="y", c0=0.002039, c1=-0.477412, c2=-0.492151),
'NB0973': Colorterm(primary="y", secondary="z", c0=-0.007775, c1=-0.050972, c2=-0.197278),
'NB1010': Colorterm(primary="y", secondary="z", c0=0.003607, c1=0.865366, c2=1.271817),
}),
}
26 changes: 26 additions & 0 deletions config/hsc/filterMap.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
for source, target in [
# Names used by Exposure.getFilter() in Gen2.
# Wide bands
("r2", "r"),
("i2", "i"),
Expand All @@ -16,5 +17,30 @@
('N1010', 'y'),
# Intermediate bands
('I945', 'z'),

# Names used by data IDs in both Gen2 and Gen3, and
# Exposure.getFilter() in Gen3 (mappings are the same).
# Wide bands
("HSC-G", "g"),
("HSC-R", "r"),
("HSC-R2", "r"),
("HSC-I", "i"),
("HSC-I2", "i"),
("HSC-Z", "z"),
("HSC-Y", "y"),
# Narrow bands
('NB0387', 'g'),
('NB0468', 'g'),
('NB0515', 'g'),
('NB0527', 'g'),
('NB0656', 'r'),
('NB0718', 'i'),
('NB0816', 'i'),
('NB0921', 'z'),
('NB0926', 'z'),
('NB0973', 'y'),
('NB1010', 'y'),
# Intermediate bands
('IB0945', 'z'),
]:
config.filterMap[source] = target

0 comments on commit 251f583

Please sign in to comment.