LSST Applications g0dd1f4853b+10f999ec6a,g1635faa6d4+b976e9dbb0,g1653933729+a8ce1bb630,g28da252d5a+20f909b684,g2bbee38e9b+de1ea1445d,g2bc492864f+de1ea1445d,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+de1ea1445d,g35bb328faa+a8ce1bb630,g3a166c0a6a+de1ea1445d,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fa1be12bb0,g531c6476d5+b4b02c216c,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g7ab3e175f3+14b8e72808,g80478fca09+f5ec7b2bf0,g82479be7b0+0c309e1a1e,g858d7b2824+b4b02c216c,g9125e01d80+a8ce1bb630,ga5288a1d22+46505f0d18,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gb9c6c11c1e+5a4033fdfe,gc28159a63d+de1ea1445d,gcf0d15dbbd+e25110243b,gd3624f51fd+6b4a7374c1,gda3e153d99+b4b02c216c,gda6a2b7d83+e25110243b,gdaeeff99f8+1711a396fd,ge2409df99d+4338270cf0,ge33fd446bb+b4b02c216c,ge79ae78c31+de1ea1445d,gee3d5c6094+3b2e26a966,gf0baf85859+147a0692ba,gf3967379c6+02b11634a5,w.2024.45
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