Skip to content

Commit

Permalink
Merge pull request #101 from lsst/tickets/DM-35838
Browse files Browse the repository at this point in the history
DM-35838: Remove deprecated code scheduled for removal.
  • Loading branch information
erykoff committed Apr 26, 2023
2 parents 1a4f0af + ee5097c commit bf1a427
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 83 deletions.
5 changes: 3 additions & 2 deletions python/lsst/fgcmcal/fgcmBuildFromIsolatedStars.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
match star observations into unique stars, and performs as much cleaning of the
input catalog as possible.
"""
import warnings
import numpy as np
import esutil
import hpgeom as hpg
Expand Down Expand Up @@ -523,9 +524,9 @@ def _make_all_star_obs_from_isolated_stars(
exp_time = np.zeros(len(star_obs))
exp_time[obs_match] = visit_cat_table["exptime"][visit_match]

with np.warnings.catch_warnings():
with warnings.catch_warnings():
# Ignore warnings, we will filter infinities and nans below.
np.warnings.simplefilter("ignore")
warnings.simplefilter("ignore")

inst_mag_inner = -2.5*np.log10(sources[self.config.apertureInnerInstFluxField])
inst_mag_err_inner = k*(sources[self.config.apertureInnerInstFluxField + "Err"]
Expand Down
5 changes: 3 additions & 2 deletions python/lsst/fgcmcal/fgcmBuildStarsTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"""

import time
import warnings

import numpy as np
import collections
Expand Down Expand Up @@ -383,9 +384,9 @@ def fgcmMakeAllStarObservations(self, groupedHandles, visitCat,
tempCat[ccdKey][:] = df['detector'].values[use]
tempCat['psf_candidate'] = df[self.config.psfCandidateName].values[use]

with np.warnings.catch_warnings():
with warnings.catch_warnings():
# Ignore warnings, we will filter infinites and nans below
np.warnings.simplefilter("ignore")
warnings.simplefilter("ignore")

instMagInner = -2.5*np.log10(df[self.config.apertureInnerInstFluxField].values[use])
instMagErrInner = k*(df[self.config.apertureInnerInstFluxField + 'Err'].values[use]
Expand Down
7 changes: 0 additions & 7 deletions python/lsst/fgcmcal/fgcmOutputProducts.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,6 @@ class FgcmOutputProductsConfig(pipeBase.PipelineTaskConfig,
pipelineConnections=FgcmOutputProductsConnections):
"""Config for FgcmOutputProductsTask"""

cycleNumber = pexConfig.Field(
doc="Final fit cycle from FGCM fit",
dtype=int,
default=0,
deprecated=("This config is no longer used, and will be removed after v25. "
"Please set config.connections.cycleNumber directly instead."),
)
physicalFilterMap = pexConfig.DictField(
doc="Mapping from 'physicalFilter' to band.",
keytype=str,
Expand Down
72 changes: 0 additions & 72 deletions python/lsst/fgcmcal/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
import numpy as np
import os
import re
from deprecated.sphinx import deprecated

from lsst.daf.base import PropertyList
import lsst.afw.cameraGeom as afwCameraGeom
import lsst.afw.table as afwTable
import lsst.afw.image as afwImage
import lsst.afw.math as afwMath
Expand Down Expand Up @@ -421,76 +419,6 @@ def translateVisitCatalog(visitCat):
return fgcmExpInfo


@deprecated(reason="This method is no longer used in fgcmcal. It will be removed after v23.",
version="v23.0", category=FutureWarning)
def computeCcdOffsets(camera, defaultOrientation):
"""
Compute the CCD offsets in ra/dec and x/y space
Parameters
----------
camera: `lsst.afw.cameraGeom.Camera`
defaultOrientation: `float`
Default camera orientation (degrees)
Returns
-------
ccdOffsets: `numpy.ndarray`
Numpy array with ccd offset information for input to FGCM.
Angular units are degrees, and x/y units are pixels.
"""
# TODO: DM-21215 will fully generalize to arbitrary camera orientations

# and we need to know the ccd offsets from the camera geometry
ccdOffsets = np.zeros(len(camera), dtype=[('CCDNUM', 'i4'),
('DELTA_RA', 'f8'),
('DELTA_DEC', 'f8'),
('RA_SIZE', 'f8'),
('DEC_SIZE', 'f8'),
('X_SIZE', 'i4'),
('Y_SIZE', 'i4')])

# Generate fake WCSs centered at 180/0 to avoid the RA=0/360 problem,
# since we are looking for relative positions
boresight = geom.SpherePoint(180.0*geom.degrees, 0.0*geom.degrees)

# TODO: DM-17597 will update testdata_jointcal so that the test data
# does not have nan as the boresight angle for HSC data. For the
# time being, there is this ungainly hack.
if camera.getName() == 'HSC' and np.isnan(defaultOrientation):
orientation = 270*geom.degrees
else:
orientation = defaultOrientation*geom.degrees
flipX = False

# Create a temporary visitInfo for input to createInitialSkyWcs
visitInfo = afwImage.VisitInfo(boresightRaDec=boresight,
boresightRotAngle=orientation,
rotType=afwImage.RotType.SKY)

for i, detector in enumerate(camera):
ccdOffsets['CCDNUM'][i] = detector.getId()

wcs = createInitialSkyWcs(visitInfo, detector, flipX)

detCenter = wcs.pixelToSky(detector.getCenter(afwCameraGeom.PIXELS))
ccdOffsets['DELTA_RA'][i] = (detCenter.getRa() - boresight.getRa()).asDegrees()
ccdOffsets['DELTA_DEC'][i] = (detCenter.getDec() - boresight.getDec()).asDegrees()

bbox = detector.getBBox()

detCorner1 = wcs.pixelToSky(geom.Point2D(bbox.getMin()))
detCorner2 = wcs.pixelToSky(geom.Point2D(bbox.getMax()))

ccdOffsets['RA_SIZE'][i] = np.abs((detCorner2.getRa() - detCorner1.getRa()).asDegrees())
ccdOffsets['DEC_SIZE'][i] = np.abs((detCorner2.getDec() - detCorner1.getDec()).asDegrees())

ccdOffsets['X_SIZE'][i] = bbox.getMaxX()
ccdOffsets['Y_SIZE'][i] = bbox.getMaxY()

return ccdOffsets


def computeReferencePixelScale(camera):
"""
Compute the median pixel scale in the camera
Expand Down

0 comments on commit bf1a427

Please sign in to comment.