LSSTApplications  18.1.0
LSSTDataManagementBasePackage
Functions
lsst.obs.base.utils Namespace Reference

Functions

def bboxFromIraf (irafBBoxStr)
 

Function Documentation

◆ bboxFromIraf()

def lsst.obs.base.utils.bboxFromIraf (   irafBBoxStr)
Return a Box2I corresponding to an IRAF-style BBOX

[x0:x1,y0:y1] where x0 and x1 are the one-indexed start and end columns, and correspondingly
y0 and y1 are the start and end rows.

Definition at line 27 of file utils.py.

27 def bboxFromIraf(irafBBoxStr):
28  """Return a Box2I corresponding to an IRAF-style BBOX
29 
30  [x0:x1,y0:y1] where x0 and x1 are the one-indexed start and end columns, and correspondingly
31  y0 and y1 are the start and end rows.
32  """
33 
34  mat = re.search(r"^\[([-\d]+):([-\d]+),([-\d]+):([-\d]+)\]$", irafBBoxStr)
35  if not mat:
36  raise RuntimeError("Unable to parse IRAF-style bbox \"%s\"" % irafBBoxStr)
37  x0, x1, y0, y1 = [int(_) for _ in mat.groups()]
38 
39  return afwGeom.BoxI(afwGeom.PointI(x0 - 1, y0 - 1), afwGeom.PointI(x1 - 1, y1 - 1))
40 
def bboxFromIraf(irafBBoxStr)
Definition: utils.py:27
An integer coordinate rectangle.
Definition: Box.h:54