Skip to content

Commit

Permalink
Restore afw_name as primary name of ExposureInfo::getFilter().
Browse files Browse the repository at this point in the history
Other Stack code assumes Filter.getName() returns the afw_name when
it's needed to disambiguate filters (i.e., HSC-R2 and HSC-I2).
  • Loading branch information
kfindeisen committed Dec 2, 2020
1 parent c289f70 commit 11db32d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/image/ExposureFitsReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,15 @@ std::shared_ptr<FilterLabel> makeFilterLabel(std::string const& name) {
*/
Filter makeFilter(FilterLabel const& label) {
// Filters still have standard aliases, so can use almost any name to define them.
// Prefer band because that's what most code assumes is Filter.getName().
// Prefer afw_name or band because that's what most code assumes is Filter.getName().
for (auto const& keyValue : _AFW_NAMES) {
std::string const& afwName = keyValue.first;
FilterLabel const& afwFilter = keyValue.second;
if (label == afwFilter) {
return Filter(afwName);
}
}

if (label.hasBandLabel()) {
return Filter(label.getBandLabel(), true);
} else {
Expand Down

0 comments on commit 11db32d

Please sign in to comment.