Skip to content

Commit

Permalink
MCCD.crop -- now doesn't pass through all CCDs
Browse files Browse the repository at this point in the history
Previously assuming that the two MCCDs in MCCD.crop had the same set of CCDs.
  • Loading branch information
Tom Marsh committed May 23, 2021
1 parent e344b7f commit 4c6b4d5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions hipercam/ccd.py
Expand Up @@ -778,16 +778,19 @@ def matches(self, mccd):
ccd.matches(mccd[key])

def crop(self, mccd):
"""Crops the :class:MCCD to the same format as a template, `mccd`. Returns
the new version. Will raise a HipercamError if it fails.
"""Crops the :class:MCCD to the same format as a template,
`mccd`. Returns the new version. Will raise a HipercamError if
it fails.
"""

# build an empty CCD to get the headers. this will be added to
tmccd = MCCD(Group(CCD), self.head)

# wind through the Windows of the template CCD
# wind through the CCDs of the template MCCD
for cnam, ccd in mccd.items():
tmccd[cnam] = self[cnam].crop(ccd)
if cnam in self:
tmccd[cnam] = self[cnam].crop(ccd)

return tmccd

Expand Down

0 comments on commit 4c6b4d5

Please sign in to comment.