hipercam.window¶
CCD window modules
Defines classes to represent sub-windows of a CCD and associated functions.
Classes summary
|
The header parts of a CCD window |
|
A CCD window, headers, position and data |
|
All the |
|
All the |
-
class
hipercam.window.
Winhead
(llx, lly, nx, ny, xbin, ybin, outamp, head=None, copy=False)¶ Bases:
hipercam.header.Header
The header parts of a CCD window
Winhead objects contain everything needed to represent a CCD window other than its data. This represents an arbitrary rectangular region of binned pixels. The lower-left pixel of the CCD is assumed to have coordinates (x,y) = (1,1). Winhead dimensions are in binned pixels.
>>> from hipercam import Winhead >>> win = Winhead(12, 6, 100, 150, 2, 3) >>> print(win)
- Attributes
- llxint
X ordinate lower-left pixel, unbinned pixels
- llyint
Y ordinate lower-left pixel, unbinned pixels
- xbinint
X-binning factor
- ybinint
Y-binning factor
nx
intBinned X-dimension of the Winhead.
ny
intBinned Y-dimension of the Winhead.
- outampstr, {‘’,’LL’,’LR’,’UL’,’UR’}
output amplifier location
urx
intUnbinned X pixel at upper-right of Winhead
ury
intUnbinned Y pixel at upper-right of Winhead
xlo
floatLeft-hand edge of window (llx-0.5)
xhi
floatRight-hand edge of window (urx+0.5)
ylo
floatBottom edge of window (lly-0.5)
yhi
floatTop edge of window (ury+0.5)
-
class
hipercam.window.
Window
(win, data=None, copy=False)¶ Bases:
hipercam.window.Winhead
A CCD window, headers, position and data
Constructed from a
Winhead
and anumpy.ndarray
which is stored in an attribute called data.>>> import numpy as np >>> from hipercam import Winhead, Window >>> win = Winhead(12, 6, 100, 150, 2, 3, 'LL') >>> data = np.ones((150,100)) >>> wind = Window(win,data) >>> wind += 0.5 >>> wind *= 2
You cannot directly change the nx, ny values of a Window; you have to change its data array attribute and nx and ny will be taken from it.
Window
objects support various arithematical operations such as subtraction or addition of constants. The end result of these always has a float type for safety to avoid problems with e.g. trying to make the result of adding a float to an integer an integer or with the range of integers.- Parameters
- win
Winhead
the
Winhead
defining the position and, optionally, headers- data2D numpy.ndarray
the data (2D). The dimensions must match those in win unless data is None in which case a zero array of the correct size will be created. A ValueError will be raised if not. Standard C-type ordering, y-then-x assumed.
- copybool
flag sent to
Winhead
controlling whether the header is copied by value or reference. ‘False’ is lightweight and faster but when building up CCDs from multiple Windows, you should probably use ‘True’ unless you are careful to make ‘win’ a different object every time.
- win