Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-16296: Flake8 fixes #17

Merged
merged 3 commits into from
Oct 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions python/lsst/meas/extensions/astrometryNet/anetAstrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ class ANetAstrometryConfig(pexConfig.Config):
doc="Basic astrometry solver",
)
forceKnownWcs = pexConfig.Field(dtype=bool, doc=(
"Assume that the input image's WCS is correct, without comparing it to any external reality." +
" (In contrast to using Astrometry.net). NOTE, if you set this, you probably also want to" +
" un-set 'solver.calculateSip'; otherwise we'll still try to find a TAN-SIP WCS starting " +
"Assume that the input image's WCS is correct, without comparing it to any external reality."
" (In contrast to using Astrometry.net). NOTE, if you set this, you probably also want to"
" un-set 'solver.calculateSip'; otherwise we'll still try to find a TAN-SIP WCS starting "
" from the existing WCS"), default=False)
rejectThresh = pexConfig.RangeField(dtype=float, default=3.0, doc="Rejection threshold for Wcs fitting",
min=0.0, inclusiveMin=False)
Expand All @@ -70,7 +70,7 @@ def refObjLoader(self):


class ANetAstrometryTask(pipeBase.Task):
"""!Use astrometry.net to match input sources with a reference catalog and solve for the Wcs
r"""!Use astrometry.net to match input sources with a reference catalog and solve for the Wcs

@anchor ANetAstrometryTask_

Expand Down Expand Up @@ -143,7 +143,7 @@ def DebugInfo(name):
_DefaultName = "astrometricSolver"

def __init__(self, schema, refObjLoader=None, **kwds):
"""!Create the astrometric calibration task. Most arguments are simply passed onto pipe.base.Task.
r"""!Create the astrometric calibration task. Most arguments are simply passed onto pipe.base.Task.

\param schema An lsst::afw::table::Schema used to create the output lsst.afw.table.SourceCatalog
\param refObjLoader The AstrometryTask constructor requires a refObjLoader. In order to make this
Expand Down Expand Up @@ -199,7 +199,7 @@ def run(self, exposure, sourceCat):

@pipeBase.timeMethod
def solve(self, exposure, sourceCat):
"""!Match with reference sources and calculate an astrometric solution
r"""!Match with reference sources and calculate an astrometric solution

\param[in,out] exposure Exposure to calibrate; wcs is updated
\param[in] sourceCat catalog of measured sources (an lsst.afw.table.SourceCatalog)
Expand Down Expand Up @@ -234,7 +234,7 @@ def solve(self, exposure, sourceCat):

@pipeBase.timeMethod
def distort(self, sourceCat, exposure):
"""!Calculate distorted source positions
r"""!Calculate distorted source positions

CCD images are often affected by optical distortion that makes
the astrometric solution higher order than linear. Unfortunately,
Expand Down Expand Up @@ -335,7 +335,7 @@ def loadAndMatch(self, exposure, sourceCat, bbox=None):

@pipeBase.timeMethod
def _astrometry(self, sourceCat, exposure, bbox=None):
"""!Solve astrometry to produce WCS
r"""!Solve astrometry to produce WCS

\param[in] sourceCat Sources on exposure, an lsst.afw.table.SourceCatalog
\param[in,out] exposure Exposure to process, an lsst.afw.image.ExposureF or D; wcs is updated
Expand Down Expand Up @@ -454,7 +454,7 @@ def fitWcs(initialWcs, title=None):


def showAstrometry(exposure, wcs, allMatches, useMatches, frame=0, title=None, pause=False):
"""!Show results of astrometry fitting
r"""!Show results of astrometry fitting

\param exposure Image to display
\param wcs Astrometric solution
Expand Down
22 changes: 11 additions & 11 deletions python/lsst/meas/extensions/astrometryNet/anetBasicAstrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ class ANetBasicAstrometryConfig(LoadAstrometryNetObjectsTask.ConfigClass):
default=True,
)
raDecSearchRadius = RangeField(
doc="When useWcsRaDecCenter=True, this is the radius, in degrees, around the RA,Dec center " +
"specified in the input exposure\'s WCS to search for a solution.",
doc="When useWcsRaDecCenter=True, this is the radius, in degrees, around the RA,Dec center "
r"specified in the input exposure\'s WCS to search for a solution.",
dtype=float,
default=1.0,
min=0.0,
)
pixelScaleUncertainty = RangeField(
doc="Range of pixel scales, around the value in the WCS header, to search. " +
"If the value of this field is X and the nominal scale is S, " +
doc="Range of pixel scales, around the value in the WCS header, to search. "
"If the value of this field is X and the nominal scale is S, "
"the range searched will be S/X to S*X",
dtype=float,
default=1.1,
Expand Down Expand Up @@ -203,16 +203,16 @@ class ANetBasicAstrometryConfig(LoadAstrometryNetObjectsTask.ConfigClass):
default=True,
)
maxIter = RangeField(
doc="maximum number of iterations of match sources and fit WCS" +
doc="maximum number of iterations of match sources and fit WCS"
"ignored if not fitting a WCS",
dtype=int,
default=5,
min=1,
)
matchDistanceSigma = RangeField(
doc="The match and fit loop stops when maxMatchDist minimized: "
" maxMatchDist = meanMatchDist + matchDistanceSigma*stdDevMatchDistance " +
" (where the mean and std dev are computed using outlier rejection);" +
" maxMatchDist = meanMatchDist + matchDistanceSigma*stdDevMatchDistance "
" (where the mean and std dev are computed using outlier rejection);"
" ignored if not fitting a WCS",
dtype=float,
default=2,
Expand Down Expand Up @@ -258,7 +258,7 @@ def __init__(self,
config,
andConfig=None,
**kwargs):
"""!Construct an ANetBasicAstrometryTask
r"""!Construct an ANetBasicAstrometryTask

@param[in] config configuration (an instance of self.ConfigClass)
@param[in] andConfig astrometry.net data config (an instance of AstromNetDataConfig, or None);
Expand Down Expand Up @@ -374,7 +374,7 @@ def useKnownWcs(self, sourceCat, wcs=None, exposure=None, filterName=None, bbox=
matches = self._getMatchList(sourceCat, refCat, wcs)
uniq = set([sm.second.getId() for sm in matches])
if len(matches) != len(uniq):
self.log.warn('The list of matched stars contains duplicate reference source IDs ' +
self.log.warn('The list of matched stars contains duplicate reference source IDs '
'(%i sources, %i unique ids)', len(matches), len(uniq))
if len(matches) == 0:
self.log.warn('No matches found between input sources and reference catalogue.')
Expand Down Expand Up @@ -537,7 +537,7 @@ def getBlindWcsSolution(self, sourceCat,
if radecCenter is None:
if useRaDecCenter:
radecCenter = wcs.pixelToSky(xc, yc)
self.log.debug('Setting RA,Dec center estimate = (%.3f, %.3f) from given WCS ' +
self.log.debug('Setting RA,Dec center estimate = (%.3f, %.3f) from given WCS '
'estimate, using pixel center = (%.1f, %.1f)',
radecCenter.getLongitude().asDegrees(),
radecCenter.getLatitude().asDegrees(), xc, yc)
Expand All @@ -547,7 +547,7 @@ def getBlindWcsSolution(self, sourceCat,
assert(pixelScale is not None)
pixRadius = math.hypot(*bboxD.getDimensions()) / 2
searchRadius = (pixelScale * pixRadius * searchRadiusScale)
self.log.debug('Using RA,Dec search radius = %.3f deg, from pixel scale, ' +
self.log.debug('Using RA,Dec search radius = %.3f deg, from pixel scale, '
'image size, and searchRadiusScale = %g',
searchRadius, searchRadiusScale)
if useParity:
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[flake8]
max-line-length = 110
ignore = E133, E226, E228, N802, N803, N806
ignore = E133, E226, E228, N802, N803, N806, W504
exclude =
__init__.py,
andConfig*.py
Expand All @@ -9,7 +9,7 @@ exclude =

[tool:pytest]
addopts = --flake8
flake8-ignore = E133 E226 E228 N802 N803 N806
flake8-ignore = E133 E226 E228 N802 N803 N806 W504
__init__.py
andConfig*.py
ticket2710.py E402 E741
Expand Down