LSST Applications g04c3c9f7ca+b6bf0e30ce,g2079a07aa2+3e9fd84d81,g20cdd03214+7686ae5cb8,g2305ad1205+9b0098d534,g2bbee38e9b+6c6beb4891,g337abbeb29+6c6beb4891,g3a166c0a6a+6c6beb4891,g4322eb9e3a+da50164803,g4e26c3aaff+ce16cedc45,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+9687a16dd4,g5c3423f6d4+7686ae5cb8,g607f77f49a+7686ae5cb8,g69c4c69b53+6c6beb4891,g858d7b2824+7686ae5cb8,g9963eaa53e+397fd696c8,g99cad8db69+2f9f763ee9,g9ddcbc5298+9a081db1e4,ga1e77700b3+2cbb763275,ga8d6e2f9c9+cbb649eb12,gadfd92a7e4+aec2f3b930,gae0086650b+585e252eca,gb0e22166c9+0e73c8378f,gbb8dafda3b+024d427455,gc120e1dc64+fcd4152152,gc28159a63d+6c6beb4891,gcdd4ae20e8+3b72bea61f,gcf0d15dbbd+3b72bea61f,gd1535ee943+38e04e5621,gd71bba6883+4b9ebe24e7,gdaeeff99f8+f9a426f77a,gddc38dedce+585e252eca,ge79ae78c31+6c6beb4891,gfbcc870c63+b310236976,w.2024.24
LSST Data Management Base Package
Loading...
Searching...
No Matches
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