Loading [MathJax]/extensions/tex2jax.js
LSST Applications g07dc498a13+5a531fccd6,g1409bbee79+5a531fccd6,g1a7e361dbc+5a531fccd6,g1fd858c14a+665e312648,g28da252d5a+a317024c06,g33399d78f5+6804da6274,g35bb328faa+e55fef2c71,g3bd4b5ce2c+4a07cc943c,g3c79e8cd92+d786b80045,g43bc871e57+9a9eb91fab,g53246c7159+e55fef2c71,g60b5630c4e+3d27850df0,g78460c75b0+8427c4cc8f,g786e29fd12+307f82e6af,g8534526c7b+af2545e932,g89139ef638+5a531fccd6,g8b49a6ea8e+3d27850df0,g9125e01d80+e55fef2c71,g97b8272a79+b6fee22cc3,g989de1cb63+5a531fccd6,g9f33ca652e+9f0bd23748,gaaedd4e678+5a531fccd6,gabe3b4be73+9c0c3c7524,gafaee74c96+447dce4572,gb1101e3267+9f3a9bd797,gb58c049af0+28045f66fd,gc1fe0db326+3d27850df0,gca43fec769+e55fef2c71,gcf25f946ba+6804da6274,gd397e13551+2ae48f76b9,gd6cbbdb0b4+784e334a77,gde0f65d7ad+f638193783,ge278dab8ac+25667260f6,geab183fbe5+3d27850df0,gecb8035dfe+0fa5abcb94,gefa07fa684+89734069dd,gf58bf46354+e55fef2c71,gfe7187db8c+44651d607e,w.2025.02
LSST Data Management Base Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
utils.py
Go to the documentation of this file.
1# This file is part of afw.
2#
3# Developed for the LSST Data Management System.
4# This product includes software developed by the LSST Project
5# (https://www.lsst.org).
6# See the COPYRIGHT file at the top-level directory of this distribution
7# for details of code ownership.
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <https://www.gnu.org/licenses/>.
21
22__all__ = ["writeFootprintAsDefects"]
23
24from . import footprintToBBoxList
25
26
28 """
29 Write foot as a set of Defects to fd
30
31 Given a detection footprint, convert it to a BBoxList and write the output to the file object fd.
32
33 Parameters
34 ----------
35 fd : `typing.TextIO`
36 foot : `lsst.afw.detection.Footprint`
37
38 See Also
39 --------
40 lsst.afw.detection.footprintToBBoxList
41 """
42
43 bboxes = footprintToBBoxList(foot)
44 for bbox in bboxes:
45 print("""\
46Defects: {
47 x0: %4d # Starting column
48 width: %4d # number of columns
49 y0: %4d # Starting row
50 height: %4d # number of rows
51}""" % (bbox.getMinX(), bbox.getWidth(), bbox.getMinY(), bbox.getHeight()), file=fd)
writeFootprintAsDefects(fd, foot)
Definition utils.py:27