def setUp(self): self.filters1 = FilterDefinitionCollection( FilterDefinition(physical_filter='abc', lambdaEff=123), FilterDefinition(physical_filter='def', lambdaEff=456)) self.filters2 = FilterDefinitionCollection( FilterDefinition(physical_filter='abc', lambdaEff=321), FilterDefinition(physical_filter='def', lambdaEff=654)) FilterDefinitionCollection.reset()
def setUp(self): self.filters1 = FilterDefinitionCollection( FilterDefinition(physical_filter='abc', lambdaEff=123), FilterDefinition(physical_filter='def', band='d', doc="This is a test filter.", lambdaEff=456)) self.filters2 = FilterDefinitionCollection( FilterDefinition(physical_filter='abc', lambdaEff=321), FilterDefinition(physical_filter='def', band='dd', lambdaEff=654)) FilterDefinitionCollection.reset()
def setUp(self): lsst.afw.image.utils.resetFilters() self.filter_g = FilterDefinition(band="g", physical_filter="HSC-G", lambdaEff=1234, alias={'ABCDEFG'}) self.filter_g2 = FilterDefinition(band="g", physical_filter="HSC-G2", afw_name='g2', lambdaEff=1235, alias={'HIJK'}) self.physical_only = FilterDefinition(physical_filter="physical", lambdaEff=0) self.afw_name = FilterDefinition(physical_filter="afw_name", lambdaEff=5, afw_name="afw only") self.abstract = FilterDefinition(physical_filter="abstract", lambdaEff=42, band="abstract only")
alias=[]) else: assert filter_dict[band]["lambdaEff"] == lambdaEff filter_dict[band]["alias"].append(physical_filter) # The LSST Filters from L. Jones 05/14/2020 - "Edges" = 5% of peak throughput # See https://github.com/rhiannonlynne/notebooks/blob/master/Filter%20Characteristics.ipynb # noqa: W505 # # N.b. DM-26623 requests that these physical names be updated once # the camera team has decided upon the final values (CAP-617) LsstCamFiltersBaseline = FilterDefinitionCollection( FilterDefinition(physical_filter="empty", band="white", lambdaEff=0.0, alias={"no_filter", "open"}), FilterDefinition(physical_filter="u", band="u", lambdaEff=368.48, lambdaMin=320.00, lambdaMax=408.60), FilterDefinition(physical_filter="g", band="g", lambdaEff=480.20, lambdaMin=386.40, lambdaMax=567.00), FilterDefinition(physical_filter="r", band="r", lambdaEff=623.12, lambdaMin=537.00,
physical_filter=physical_filter, band=band, lambdaEff=lambdaEff, alias=[], ) # The LSST Filters from L. Jones 05/14/2020 - "Edges" = 5% of peak throughput # See https://github.com/rhiannonlynne/notebooks/blob/master/Filter%20Characteristics.ipynb # noqa: W505 # # N.b. DM-26623 requests that these physical names be updated once # the camera team has decided upon the final values (CAP-617) LsstCamFiltersBaseline = FilterDefinitionCollection( FilterDefinition(physical_filter="empty", band="white", lambdaEff=0.0, alias={"no_filter", "open"}), FilterDefinition(physical_filter="u", band="u", lambdaEff=368.48, lambdaMin=320.00, lambdaMax=408.60), FilterDefinition(physical_filter="g", band="g", lambdaEff=480.20, lambdaMin=386.40, lambdaMax=567.00), FilterDefinition(physical_filter="r", band="r", lambdaEff=623.12, lambdaMin=537.00,
class TestFilterDefinition(lsst.utils.tests.TestCase): def setUp(self): lsst.afw.image.utils.resetFilters() self.filter_g = FilterDefinition(band="g", physical_filter="HSC-G", lambdaEff=1234, alias={'ABCDEFG'}) self.filter_g2 = FilterDefinition(band="g", physical_filter="HSC-G2", afw_name='g2', lambdaEff=1235, alias={'HIJK'}) self.physical_only = FilterDefinition(physical_filter="physical", lambdaEff=0) self.afw_name = FilterDefinition(physical_filter="afw_name", lambdaEff=5, afw_name="afw only") self.abstract = FilterDefinition(physical_filter="abstract", lambdaEff=42, band="abstract only") def testDefineFilters(self): """Test that a filter is properly defined in afw.""" # the filter should not exist until we define it with self.assertRaises(lsst.pex.exceptions.NotFoundError): lsst.afw.image.Filter('g') with self.assertRaises(lsst.pex.exceptions.NotFoundError): lsst.afw.image.Filter('g2') with self.assertRaises(lsst.pex.exceptions.NotFoundError): lsst.afw.image.Filter('HSC-G') self.filter_g.defineFilter() filter = lsst.afw.image.Filter('g') filter_alias = lsst.afw.image.Filter('HSC-G') self.assertEqual(filter.getName(), 'g') # afw Filter stores the aliased name as the CannonicalName self.assertEqual(filter_alias.getCanonicalName(), 'g') self.assertEqual(filter, filter_alias) self.assertEqual(['ABCDEFG', 'HSC-G'], sorted(filter.getAliases())) self.filter_g2.defineFilter() filter2 = lsst.afw.image.Filter('g2') filter2_alias = lsst.afw.image.Filter('HSC-G2') self.assertEqual(filter2.getName(), 'g2') self.assertEqual(filter2_alias.getCanonicalName(), 'g2') self.assertEqual(filter2, filter2_alias) self.assertEqual(['HIJK', 'HSC-G2'], sorted(filter2.getAliases())) def test_physical_only(self): """physical_filter is the only name this filter has. """ self.physical_only.defineFilter() filter = lsst.afw.image.Filter('physical') self.assertEqual(filter.getName(), 'physical') self.assertEqual([], sorted(filter.getAliases())) self.assertEqual(self.physical_only.makeFilterLabel(), lsst.afw.image.FilterLabel(physical='physical')) def test_afw_name(self): """afw_name is the Filter name, physical_filter is an alias. """ self.afw_name.defineFilter() filter = lsst.afw.image.Filter('afw only') filter_alias = lsst.afw.image.Filter('afw_name') self.assertEqual(filter.getName(), 'afw only') self.assertEqual(filter_alias.getCanonicalName(), 'afw only') self.assertEqual(['afw_name'], sorted(filter.getAliases())) self.assertEqual(self.afw_name.makeFilterLabel(), lsst.afw.image.FilterLabel(physical='afw_name')) def test_abstract_only(self): """band is the Filter name, physical_filter is an alias. """ self.abstract.defineFilter() filter = lsst.afw.image.Filter('abstract only') filter_alias = lsst.afw.image.Filter('abstract') self.assertEqual(filter.getName(), 'abstract only') self.assertEqual(filter_alias.getCanonicalName(), 'abstract only') self.assertEqual(['abstract'], sorted(filter.getAliases())) self.assertEqual( self.abstract.makeFilterLabel(), lsst.afw.image.FilterLabel(band='abstract only', physical='abstract'))
# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from lsst.obs.base import FilterDefinition, FilterDefinitionCollection # lambdaMin and lambda max are chosen to be where the filter rises above 1% # from http://www.ctio.noao.edu/noao/sites/default/files/DECam/DECam_filters_transmission.txt DECAM_FILTER_DEFINITIONS = FilterDefinitionCollection( FilterDefinition(physical_filter="u DECam c0006 3500.0 1000.0", band="u", lambdaEff=350, lambdaMin=305, lambdaMax=403), FilterDefinition(physical_filter="g DECam SDSS c0001 4720.0 1520.0", band="g", lambdaEff=450, lambdaMin=394, lambdaMax=555), FilterDefinition(physical_filter="r DECam SDSS c0002 6415.0 1480.0", band="r", lambdaEff=600, lambdaMin=562, lambdaMax=725), FilterDefinition( physical_filter="i DECam SDSS c0003 7835.0 1470.0", band="i",
from lsst.obs.base import FilterDefinition, FilterDefinitionCollection # lambdaMin and lambda max are chosen to be where the filter rises above 1% # from HELP/SVO: # https://github.com/H-E-L-P/herschelhelp_python/blob/master/database_builder/filters/ VIRCAM_FILTER_DEFINITIONS = FilterDefinitionCollection( FilterDefinition(band="Clear", physical_filter="NONE", lambdaEff=0, alias=["Clear", "NONE", "None", "Unrecognised", "UNRECOGNISED", "Unrecognized", "UNRECOGNIZED", "NOTSET"]), FilterDefinition(physical_filter="VIRCAM-Z", band='Z', lambdaEff=8762.4437058376E-1, lambdaMin=8156.5423076923E-1, lambdaMax=9400.45E-1), FilterDefinition(physical_filter="VIRCAM-Y", band='Y', lambdaEff=10184.228370757E-1, lambdaMin=9427.060857538E-1, lambdaMax=10976.565495208E-1), FilterDefinition(physical_filter="VIRCAM-J", band='J', lambdaEff=12464.429377059E-1, lambdaMin=11427.444047011E-1, lambdaMax=13759.028571429E-1), FilterDefinition(physical_filter="VIRCAM-H", band='H', lambdaEff=16310.014908445E-1, lambdaMin=14603.599766628E-1, lambdaMax=18422.112893276E-1), FilterDefinition(physical_filter="VIRCAM-Ks", #K Capitalised and without s based on
# You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. __all__ = ("MEGAPRIME_FILTER_DEFINITIONS", ) from lsst.obs.base import FilterDefinition, FilterDefinitionCollection # Filter specification comes from # https://www.cfht.hawaii.edu/Instruments/Filters/megaprimenew.html # With current afwFilter singleton we can not define abstract filters # properly since we are only allowed one u alias. MEGAPRIME_FILTER_DEFINITIONS = FilterDefinitionCollection( FilterDefinition(physical_filter="u.MP9301", band="u", lambdaEff=374, lambdaMin=336, lambdaMax=412), FilterDefinition(physical_filter="u.MP9302", band="u2", alias={"u2"}, lambdaEff=354, lambdaMin=310, lambdaMax=397), FilterDefinition(physical_filter="u.MP9303", band="u3", lambdaEff=395, lambdaMin=390, lambdaMax=400), FilterDefinition(physical_filter="g.MP9401", band="g",
# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. __all__ = ("MEGAPRIME_FILTER_DEFINITIONS", ) from lsst.obs.base import FilterDefinition, FilterDefinitionCollection # Filter specification comes from # https://www.cfht.hawaii.edu/Instruments/Filters/megaprimenew.html # With current afwFilter singleton we can not define abstract filters # properly since we are only allowed one u alias. MEGAPRIME_FILTER_DEFINITIONS = FilterDefinitionCollection( FilterDefinition(physical_filter="u.MP9301", band="u"), FilterDefinition(physical_filter="u.MP9302", band="u", afw_name="u2"), FilterDefinition(physical_filter="u.MP9303", band="u", afw_name="u3"), FilterDefinition(physical_filter="g.MP9401", band="g"), FilterDefinition(physical_filter="g.MP9402", band="g", afw_name="g2"), FilterDefinition(physical_filter="g.MP9501", band="g", afw_name="g3"), FilterDefinition(physical_filter="g.MP9502", band="g", afw_name="g4"), FilterDefinition(physical_filter="r.MP9601", band="r"), FilterDefinition(physical_filter="r.MP9602", band="r", afw_name="r2"), FilterDefinition(physical_filter="r.MP9603", band="r", afw_name="r3"), FilterDefinition(physical_filter="r.MP9604", band="r", afw_name="r4"), FilterDefinition(physical_filter="r.MP9605", band="r", afw_name="r5"), FilterDefinition(physical_filter="i.MP9701", band="i"), FilterDefinition(physical_filter="i.MP9702", band="i", afw_name="i2"), FilterDefinition(physical_filter="i.MP9703", band="i", afw_name="i3"), FilterDefinition(physical_filter="z.MP9801", band="z"),
from lsst.obs.base import FilterDefinition, FilterDefinitionCollection # SDSS g': http://www.naoj.org/Observing/Instruments/SCam/txt/g.txt # SDSS r': http://www.naoj.org/Observing/Instruments/SCam/txt/r.txt # SDSS i': http://www.naoj.org/Observing/Instruments/SCam/txt/i.txt # SDSS z': http://www.naoj.org/Observing/Instruments/SCam/txt/z.txt # y-band: Shimasaku et al., 2005, PASJ, 57, 447 # The order of these filters matters as their IDs are used to generate at # least some object IDs (e.g. on coadds) and changing the order will # invalidate old objIDs HSC_FILTER_DEFINITIONS = FilterDefinitionCollection( FilterDefinition(abstract_filter="UNRECOGNISED", physical_filter="NONE", lambdaEff=0, alias=[ "NONE", "None", "Unrecognised", "UNRECOGNISED", "Unrecognized", "UNRECOGNIZED", "NOTSET" ]), FilterDefinition(physical_filter="HSC-G", abstract_filter="g", lambdaEff=477, alias={'W-S-G+'}), FilterDefinition(physical_filter="HSC-R", abstract_filter="r", lambdaEff=623, alias={'W-S-R+'}), FilterDefinition(physical_filter="ENG-R1", abstract_filter="r1", lambdaEff=623, alias={'109'}),
__all__ = ("CTMO_FILTER_DEFINITIONS",) from lsst.obs.base import FilterDefinition, FilterDefinitionCollection CTMO_FILTER_DEFINITIONS = FilterDefinitionCollection( FilterDefinition( physical_filter="Clear", band="Clear", lambdaEff=535.5, alias={"Clear"} ) )
# along with this program. If not, see <http://www.gnu.org/licenses/>. from lsst.obs.base import FilterDefinition, FilterDefinitionCollection # SDSS g': http://www.naoj.org/Observing/Instruments/SCam/txt/g.txt # SDSS r': http://www.naoj.org/Observing/Instruments/SCam/txt/r.txt # SDSS i': http://www.naoj.org/Observing/Instruments/SCam/txt/i.txt # SDSS z': http://www.naoj.org/Observing/Instruments/SCam/txt/z.txt # y-band: Shimasaku et al., 2005, PASJ, 57, 447 # The order of these filters matters as their IDs are used to generate at # least some object IDs (e.g. on coadds) and changing the order will # invalidate old objIDs HSC_FILTER_DEFINITIONS = FilterDefinitionCollection( FilterDefinition(band="unknown", physical_filter="unknown", alias=["UNKNOWN", "Unrecognised", "UNRECOGNISED", "Unrecognized", "UNRECOGNIZED", "NOTSET"]), FilterDefinition(band="white", physical_filter="empty", alias=["NONE"]), FilterDefinition(physical_filter="HSC-G", band="g", alias={'W-S-G+'}), FilterDefinition(physical_filter="HSC-R", band="r", doc="Original r-band filter, replaced in July 2016 with HSC-R2.", alias={'W-S-R+'}), FilterDefinition(physical_filter="ENG-R1", band="r", doc="A filter used during early camera construction;" "very little data was taken with this filter.", alias={'109'}),
# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from lsst.obs.base import FilterDefinition, FilterDefinitionCollection # lambdaMin and lambda max are chosen to be where the filter rises above 1% # from http://www.ctio.noao.edu/noao/sites/default/files/DECam/DECam_filters_transmission.txt DECAM_FILTER_DEFINITIONS = FilterDefinitionCollection( FilterDefinition(physical_filter="u DECam c0006 3500.0 1000.0", band="u", lambdaEff=350, lambdaMin=305, lambdaMax=403), FilterDefinition(physical_filter="g DECam SDSS c0001 4720.0 1520.0", band="g", lambdaEff=450, lambdaMin=394, lambdaMax=555), FilterDefinition(physical_filter="r DECam SDSS c0002 6415.0 1480.0", band="r", lambdaEff=600, lambdaMin=562, lambdaMax=725), FilterDefinition( physical_filter="i DECam SDSS c0003 7835.0 1470.0", band="i",