# Support per-mapper default filter name

XMLWordPrintable

## Details

• Type: Story
• Status: Invalid
• Resolution: Done
• Fix Version/s: None
• Component/s: None
• Labels:
None
• Story Points:
0.25
• Sprint:
Science Pipelines DM-W16-6, DRP W16-7
• Team:
Data Release Production

## Description

A CameraMapper subclass should be able to specify a default filter name to be used when the filter is not found in self.filters. This will allow processing images with filter names that have not been previously anticipated, as might be desired for onsite analysis.

This is a port of work performed on HSC-987.

## Activity

Hide
John Swinbank added a comment -

The patch from HSC is simple and applies directly.

However... I end up confused by the intention of the whole "filter translation table" concept. Since the filters already have aliases, I am not sure why we pass the filter names through the self.filters dictionary in the CameraMapper to transform the names rather than simply relying on the aliases.

For example, one could imagine replacing the business logic in CameraMapper._setFilter() with something like:

 filterName = mapping.need(['filter'], dataId)['filter'] try:  filter = afwImage.Filter(filterName) except pexExcept.NotFoundError:  filter = afwImage.Filter(self.defaultFilterName) item.setFilter(filter) 

Paul Price – it looks as though the translation table was added by you back in 2011, but I'm not entirely sure I understand the logic (despite reading your commit message). Does this effectively boil down to specifying a per-camera subset of applicable filters, rather than assuming that all of those known to afw would be applicable?

Show
John Swinbank added a comment - The patch from HSC is simple and applies directly. However... I end up confused by the intention of the whole "filter translation table" concept. Since the filters already have aliases, I am not sure why we pass the filter names through the self.filters dictionary in the CameraMapper to transform the names rather than simply relying on the aliases. For example, one could imagine replacing the business logic in CameraMapper._setFilter() with something like: filterName = mapping.need([ 'filter' ], dataId)[ 'filter' ] try : filter = afwImage. Filter (filterName) except pexExcept.NotFoundError: filter = afwImage. Filter ( self .defaultFilterName) item.setFilter( filter ) Paul Price – it looks as though the translation table was added by you back in 2011, but I'm not entirely sure I understand the logic (despite reading your commit message). Does this effectively boil down to specifying a per-camera subset of applicable filters, rather than assuming that all of those known to afw would be applicable?
Hide
Paul Price added a comment -

Probably. I think including the filters in the mappers predates me.

Show
Paul Price added a comment - Probably. I think including the filters in the mappers predates me.
Hide
Paul Price added a comment -

I think this is included in DM-5283 and DM-5289.

Show
Paul Price added a comment - I think this is included in DM-5283 and DM-5289 .
Hide
Paul Price added a comment -

Closing as duplicate.

Show
Paul Price added a comment - Closing as duplicate.

## People

• Assignee:
John Swinbank
Reporter:
John Swinbank
Watchers:
John Swinbank, Paul Price