Skip to content

Commit

Permalink
black + manual cleanup of flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
parejkoj committed Jun 28, 2024
1 parent 1d445c4 commit 45a572c
Show file tree
Hide file tree
Showing 53 changed files with 140 additions and 129 deletions.
5 changes: 3 additions & 2 deletions config/assembleCoadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@

import os.path

from lsst.pipe.tasks.selectImages import PsfWcsSelectImagesTask

# Load configs shared between assembleCoadd and makeCoaddTempExp
config.load(os.path.join(os.path.dirname(__file__), "coaddBase.py"))

config.subregionSize = (10000, 200) # 200 rows (since patch width is typically < 10k pixels)
config.subregionSize = (10000, 200) # 200 rows (since patch width is typically < 10k pixels)
config.removeMaskPlanes.append("CROSSTALK")
config.doNImage = True
config.badMaskPlanes += ["SUSPECT"]

from lsst.pipe.tasks.selectImages import PsfWcsSelectImagesTask
config.select.retarget(PsfWcsSelectImagesTask)

# FUTURE: Set to True when we get transmission curves
Expand Down
8 changes: 4 additions & 4 deletions config/cmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.

import os
import lsst.meas.modelfit
import lsst.meas.modelfit # noqa: F401 required to use modelfit plugin below

config.measurement.plugins.names |= ["modelfit_DoubleShapeletPsfApprox", "modelfit_CModel"]
config.measurement.slots.modelFlux = 'modelfit_CModel'
config.catalogCalculation.plugins['base_ClassificationExtendedness'].fluxRatio = 0.985
config.measurement.slots.modelFlux = "modelfit_CModel"
config.catalogCalculation.plugins["base_ClassificationExtendedness"].fluxRatio = 0.985
1 change: 1 addition & 0 deletions config/coaddDriver_noPSF.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@
# see <http://www.lsstcorp.org/LegalNotices/>.

from lsst.pipe.tasks.selectImages import WcsSelectImagesTask

config.select.retarget(WcsSelectImagesTask)
3 changes: 2 additions & 1 deletion config/comCamSim/analysisToolsPhotometricCatalogMatch.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""comCamSim-specific overrides for PhotometricCatalogMatchTask"""

import os.path

configDir = os.path.dirname(__file__)
config.referenceCatalogLoader.refObjLoader.load(os.path.join(configDir, 'filterMap.py'))
config.referenceCatalogLoader.refObjLoader.load(os.path.join(configDir, "filterMap.py"))
config.referenceCatalogLoader.doApplyColorTerms = False

config.connections.refCatalog = "uw_stars_20240524"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""comCamSim-specific overrides for PhotometricCatalogMatchVisitTask"""

import os.path

configDir = os.path.dirname(__file__)
config.referenceCatalogLoader.refObjLoader.load(os.path.join(configDir, 'filterMap.py'))
config.referenceCatalogLoader.refObjLoader.load(os.path.join(configDir, "filterMap.py"))

config.connections.refCatalog = "uw_stars_20240524"
config.referenceCatalogLoader.doApplyColorTerms = False
36 changes: 18 additions & 18 deletions config/comCamSim/computeExposureSummaryStats.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@

# Fiducial PsfSigma in pixels
config.fiducialPsfSigma = {
'u': 1.72,
'g': 1.63,
'r': 1.56,
'i': 1.51,
'z': 1.47,
'y': 1.44,
"u": 1.72,
"g": 1.63,
"r": 1.56,
"i": 1.51,
"z": 1.47,
"y": 1.44,
}

# Fiducial ZeroPoint for 1s exposure
config.fiducialZeroPoint = {
'u': 25.96,
'g': 27.95,
'r': 27.80,
'i': 27.61,
'z': 27.22,
'y': 26.26,
"u": 25.96,
"g": 27.95,
"r": 27.80,
"i": 27.61,
"z": 27.22,
"y": 26.26,
}

# Fiducial SkyBackground in ADU per second
config.fiducialSkyBackground = {
'u': 0.90,
'g': 9.20,
'r': 19.62,
'i': 31.51,
'z': 47.26,
'y': 53.91,
"u": 0.90,
"g": 9.20,
"r": 19.62,
"i": 31.51,
"z": 47.26,
"y": 53.91,
}
2 changes: 1 addition & 1 deletion config/comCamSim/fgcmFitCycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
config.maxIterBeforeFinalCycle = 50
config.minCcdPerExp = 1
config.utBoundary = 0.0
config.washMjds = (0.0, )
config.washMjds = (0.0,)
# For now, define 1 observing epoch that encompasses everything.
config.epochMjds = (0.0, 100000.0)
config.coatingMjds = []
Expand Down
2 changes: 1 addition & 1 deletion config/comCamSim/fgcmMakeLut.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
]

# FGCM name or filename of precomputed atmospheres
config.atmosphereTableName = 'fgcm_atm_lsst2'
config.atmosphereTableName = "fgcm_atm_lsst2"
2 changes: 1 addition & 1 deletion config/comCamSim/gbdesAstrometricFit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"""
config.connections.referenceCatalog = "uw_stars_20240524"
config.applyRefCatProperMotion = False
config.referenceFilter = 'lsst_r'
config.referenceFilter = "lsst_r"
config.devicePolyOrder = 5
config.exposurePolyOrder = 7
3 changes: 2 additions & 1 deletion config/convolvedFluxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.

import lsst.meas.extensions.convolved # noqa: Load flux.convolved algorithm
import lsst.meas.extensions.convolved # noqa: F401 required to use ConvolvedFlux below

config.plugins.names.add("ext_convolved_ConvolvedFlux")
config.plugins["ext_convolved_ConvolvedFlux"].seeing.append(8.0)
2 changes: 1 addition & 1 deletion config/findDefects.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os.path

config.load(os.path.join(os.path.dirname(__file__), "lsstCamCommon.py"))
config.ccdKey = 'detector'
config.ccdKey = "detector"
3 changes: 1 addition & 2 deletions config/forcedPhotCoadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

import os.path

from lsst.meas.base import CircularApertureFluxAlgorithm

config.measurement.load(os.path.join(os.path.dirname(__file__), "apertures.py"))
config.measurement.load(os.path.join(os.path.dirname(__file__), "kron.py"))
config.measurement.load(os.path.join(os.path.dirname(__file__), "convolvedFluxes.py"))
Expand All @@ -35,6 +33,7 @@
config.catalogCalculation.plugins.names = ["base_ClassificationExtendedness"]
config.measurement.slots.psfFlux = "base_PsfFlux"


def doUndeblended(config, algName, fluxList=None):
"""Activate undeblended measurements of algorithm
Parameters
Expand Down
3 changes: 2 additions & 1 deletion config/gaap.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.

import lsst.meas.extensions.gaap # noqa: Load GAaP algorithm
import lsst.meas.extensions.gaap # noqa: F401 required to use GaapFlux below

config.plugins.names.add("ext_gaap_GaapFlux")
config.plugins["ext_gaap_GaapFlux"].sigmas = [0.5, 0.7, 1.0, 1.5, 2.5, 3.0]
# Enable PSF photometry after PSF-Gaussianization in the `ext_gaap_GaapFlux` plugin
Expand Down
3 changes: 2 additions & 1 deletion config/imsim/analysisToolsPhotometricCatalogMatch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os.path

configDir = os.path.dirname(__file__)
config.referenceCatalogLoader.refObjLoader.load(os.path.join(configDir, 'filterMap.py'))
config.referenceCatalogLoader.refObjLoader.load(os.path.join(configDir, "filterMap.py"))

config.referenceCatalogLoader.doApplyColorTerms = False
3 changes: 2 additions & 1 deletion config/imsim/analysisToolsPhotometricCatalogMatchVisit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os.path

configDir = os.path.dirname(__file__)
config.referenceCatalogLoader.refObjLoader.load(os.path.join(configDir, 'filterMap.py'))
config.referenceCatalogLoader.refObjLoader.load(os.path.join(configDir, "filterMap.py"))

config.referenceCatalogLoader.doApplyColorTerms = False
4 changes: 2 additions & 2 deletions config/imsim/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
# imSim-specifc reference catalog configuration.
config.connections.astromRefCat = "cal_ref_cat"
config.connections.photoRefCat = "cal_ref_cat"
config.astromRefObjLoader.load(os.path.join(configDir, 'filterMap.py'))
config.photoRefObjLoader.load(os.path.join(configDir, 'filterMap.py'))
config.astromRefObjLoader.load(os.path.join(configDir, "filterMap.py"))
config.photoRefObjLoader.load(os.path.join(configDir, "filterMap.py"))
config.astromRefObjLoader.anyFilterMapsToThis = None

# Reduce Chebyshev polynomial order for background fitting (DM-30820)
Expand Down
4 changes: 2 additions & 2 deletions config/imsim/calibrateImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
config.connections.astrometry_ref_cat = "cal_ref_cat_2_2"
config.connections.photometry_ref_cat = "cal_ref_cat_2_2"
# Use the ImSim filterMap ("lsst_X_smeared" reference fluxes).
config.astrometry_ref_loader.load(os.path.join(config_dir, 'filterMap.py'))
config.astrometry_ref_loader.load(os.path.join(config_dir, "filterMap.py"))
config.astrometry_ref_loader.anyFilterMapsToThis = None
config.photometry_ref_loader.load(os.path.join(config_dir, 'filterMap.py'))
config.photometry_ref_loader.load(os.path.join(config_dir, "filterMap.py"))

# Make sure galaxies from truth catalog are not used for calibration.
config.astrometry.referenceSelector.doUnresolved = True
Expand Down
2 changes: 1 addition & 1 deletion config/imsim/filterMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.

config.filterMap = {band: 'lsst_%s_smeared' % (band) for band in 'ugrizy'}
config.filterMap = {band: "lsst_%s_smeared" % (band) for band in "ugrizy"}
2 changes: 1 addition & 1 deletion config/imsim/isr.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
"""
imsim-specific overrides for IsrTask
"""
config.connections.newBFKernel = "bfk"
config.connections.newBFKernel = "bfk"
config.doBrighterFatter = True
3 changes: 2 additions & 1 deletion config/kron.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.

import lsst.meas.extensions.photometryKron
import lsst.meas.extensions.photometryKron # noqa: F401 required to use KronFlux below

config.plugins.names |= ["ext_photometryKron_KronFlux"]
4 changes: 2 additions & 2 deletions config/latiss/assembleCoadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
# see <http://www.lsstcorp.org/LegalNotices/>.

# AuxTel PSF is not stable at this time resulting in many frames being
# rejected by standard psfWcsSelect. Switch to using WcsSelectImagesTask
# rejected by standard psfWcsSelect. Switch to using WcsSelectImagesTask
# to avoid rejecting too many frames.

import os.path
from lsst.pipe.tasks.selectImages import WcsSelectImagesTask

# Load configs shared between assembleCoadd and makeWarp.
config.load(os.path.join(os.path.dirname(__file__), "coaddBase.py"))

from lsst.pipe.tasks.selectImages import WcsSelectImagesTask
config.select.retarget(WcsSelectImagesTask)
2 changes: 1 addition & 1 deletion config/latiss/associatedSourcesTractAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# By default loop over all the same bands that are present in the Object Table
objectConfig = TransformObjectCatalogConfig()
objectConfig.load(os.path.join(os.path.dirname(__file__), "transformObjectCatalog.py"))
config.bands = objectConfig.outputBands
config.bands = objectConfig.outputBands
10 changes: 5 additions & 5 deletions config/latiss/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
colors["g-r"] = ColorLimit(primary="g_flux", secondary="r_flux", minimum=0.4, maximum=2.0)

config.photoCal.applyColorTerms = True
config.photoCal.photoCatName="atlas_refcat2_20220201"
config.photoCal.photoCatName = "atlas_refcat2_20220201"
config.photoCal.colorterms.load(os.path.join(ObsConfigDir, "colorterms.py"))

# We often have very few sources due to smaller aperture so use affine task.
Expand Down Expand Up @@ -44,14 +44,14 @@
config.astrometry.matcher.maxRotationDeg = 2.0

config.astrometry.sourceFluxType = "Psf"
config.astrometry.sourceSelector['matcher'].sourceFluxType = "Psf"
config.astrometry.sourceSelector['matcher'].minSnr = 10
config.astrometry.sourceSelector["matcher"].sourceFluxType = "Psf"
config.astrometry.sourceSelector["matcher"].minSnr = 10

config.measurement.plugins["base_Jacobian"].pixelScale = 0.1

# Set the default aperture as appropriate for the LATISS plate scale.
config.measurement.algorithms["base_CompensatedTophatFlux"].apertures = [35]
config.normalizedCalibrationFlux.raw_calibflux_name = "base_CompensatedTophatFlux_35"

config.measurement.slots.apFlux='base_CircularApertureFlux_35_0'
config.measurement.slots.calibFlux='base_CircularApertureFlux_35_0'
config.measurement.slots.apFlux = "base_CircularApertureFlux_35_0"
config.measurement.slots.calibFlux = "base_CircularApertureFlux_35_0"
8 changes: 4 additions & 4 deletions config/latiss/calibrateImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
config.psf_measure_psf.psfDeterminer["psfex"].stampSize = 71

config.install_simple_psf.width = 21
config.install_simple_psf.fwhm = 2.355*2 # LATISS plate scale is 2x LSST nominal
config.install_simple_psf.fwhm = 2.355 * 2 # LATISS plate scale is 2x LSST nominal

# Turn off S/N cut for aperture correction measurement source selection
# (it now only includes calib_psf_used objects, and that cut is "good
Expand All @@ -36,7 +36,7 @@
colors["g-r"] = ColorLimit(primary="g_flux", secondary="r_flux", minimum=0.4, maximum=2.0)

config.photometry.applyColorTerms = True
config.photometry.photoCatName="atlas_refcat2_20220201"
config.photometry.photoCatName = "atlas_refcat2_20220201"
config.photometry.colorterms.load(os.path.join(config_dir, "colorterms.py"))

# Note that the following two config values were validated on data taken in
Expand Down Expand Up @@ -64,5 +64,5 @@

# Set the default aperture as appropriate for the LATISS plate scale.
config.star_measurement.plugins["base_CircularApertureFlux"].radii = [35.0]
config.star_measurement.slots.apFlux = 'base_CircularApertureFlux_35_0'
config.star_measurement.slots.calibFlux = 'base_CircularApertureFlux_35_0'
config.star_measurement.slots.apFlux = "base_CircularApertureFlux_35_0"
config.star_measurement.slots.calibFlux = "base_CircularApertureFlux_35_0"
10 changes: 7 additions & 3 deletions config/latiss/characterizeImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
config.measurePsf.psfDeterminer["psfex"].stampSize = 71

config.installSimplePsf.width = 21
config.installSimplePsf.fwhm = 2.355*2 # LATISS plate scale is 2x LSST nominal
config.installSimplePsf.fwhm = 2.355 * 2 # LATISS plate scale is 2x LSST nominal

# Turn off S/N cut for aperture correction measurement source selection
# (it now only includes calib_psf_used objects, and that cut is "good
Expand All @@ -36,7 +36,11 @@
# As above, turn off S/N cut for aperture correction source selection.
config.normalizedCalibrationFlux.measure_ap_corr.sourceSelector["science"].doSignalToNoise = False
# Put in the correct override fields in case we revisit this in the future.
config.normalizedCalibrationFlux.measure_ap_corr.sourceSelector["science"].signalToNoise.fluxField = "base_CompensatedTophatFlux_35_instFlux"
config.normalizedCalibrationFlux.measure_ap_corr.sourceSelector["science"].signalToNoise.errField = "base_CompensatedTophatFlux_35_instFluxErr"
config.normalizedCalibrationFlux.measure_ap_corr.sourceSelector[
"science"
].signalToNoise.fluxField = "base_CompensatedTophatFlux_35_instFlux"
config.normalizedCalibrationFlux.measure_ap_corr.sourceSelector[
"science"
].signalToNoise.errField = "base_CompensatedTophatFlux_35_instFluxErr"
config.measurement.slots.apFlux = "base_CircularApertureFlux_35_0"
config.measurement.slots.calibFlux = "base_CircularApertureFlux_35_0"
1 change: 0 additions & 1 deletion config/latiss/coaddBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@
# These configs are for skymaps of pixel scale 0.1
# TO DO: Delete the below if we go a 0.2 pixel scale.
config.matchingKernelSize = 43

1 change: 0 additions & 1 deletion config/latiss/compareWarpAssembleCoadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@

# Load configs from base assembleCoadd
config.load(os.path.join(os.path.dirname(__file__), "assembleCoadd.py"))

6 changes: 3 additions & 3 deletions config/latiss/fgcmBuildFromIsolatedStars.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
config.minPerBand = 2
config.connections.ref_cat = "atlas_refcat2_20220201"

config.apertureInnerInstFluxField="apFlux_35_0_instFlux"
config.apertureOuterInstFluxField="apFlux_50_0_instFlux"
config.apertureInnerInstFluxField = "apFlux_35_0_instFlux"
config.apertureOuterInstFluxField = "apFlux_50_0_instFlux"

configDir = os.path.join(os.path.dirname(__file__))
config.physicalFilterMap = LATISS_FILTER_DEFINITIONS.physical_to_band
config.doSubtractLocalBackground = False
config.fgcmLoadReferenceCatalog.load(os.path.join(configDir, "filterMap.py"))
config.fgcmLoadReferenceCatalog.applyColorTerms = True
config.fgcmLoadReferenceCatalog.colorterms.load(os.path.join(configDir, 'colorterms.py'))
config.fgcmLoadReferenceCatalog.colorterms.load(os.path.join(configDir, "colorterms.py"))
config.fgcmLoadReferenceCatalog.referenceSelector.doSignalToNoise = True
config.fgcmLoadReferenceCatalog.referenceSelector.signalToNoise.fluxField = "i_flux"
config.fgcmLoadReferenceCatalog.referenceSelector.signalToNoise.errField = "i_fluxErr"
Expand Down
2 changes: 1 addition & 1 deletion config/latiss/fgcmFitCycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
config.maxIterBeforeFinalCycle = 100
config.minCcdPerExp = 1
config.utBoundary = 0.0
config.washMjds = (0.0, )
config.washMjds = (0.0,)
# For now, define 1 observing epoch that encompasses everything.
config.epochMjds = (0.0, 100000.0)
config.coatingMjds = []
Expand Down
2 changes: 1 addition & 1 deletion config/latiss/fgcmMakeLut.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
"empty~SDSSy_65mm": "SDSSy_65mm~empty"}

# FGCM name or filename of precomputed atmospheres
config.atmosphereTableName = 'fgcm_atm_lsst2'
config.atmosphereTableName = "fgcm_atm_lsst2"
3 changes: 2 additions & 1 deletion config/latiss/fgcmOutputProducts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from lsst.obs.lsst.filters import LATISS_FILTER_DEFINITIONS

config.connections.cycleNumber = 6

from lsst.obs.lsst.filters import LATISS_FILTER_DEFINITIONS
config.physicalFilterMap = LATISS_FILTER_DEFINITIONS.physical_to_band
Loading

0 comments on commit 45a572c

Please sign in to comment.