Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update_dq improvement in findsat_mrt #201

Merged
merged 11 commits into from
Mar 14, 2024
Prev Previous commit
Next Next commit
added binsize>=1 requirement to binsize setter
  • Loading branch information
dvstark committed Mar 11, 2024
commit 41b2b66698fb54132e5d71b0062074bd0d00b6f9
8 changes: 4 additions & 4 deletions acstools/findsat_mrt.py
Original file line number Diff line number Diff line change
@@ -1290,8 +1290,8 @@ def binsize(self):

@binsize.setter
def binsize(self, value):
if value is not None and not isinstance(value, int):
raise ValueError(f"binsize must be None or int but got: {value}")
if value is not None and not (isinstance(value, int) and value >= 1):
raise ValueError(f"binsize must be None or int >= 1 but got: {value}") # noqa
self._binsize = value

@property
@@ -1361,8 +1361,8 @@ def rebin(self):
LOG.info('Rebinning the data by {}'.format(self.binsize))

# trigger a warning if the image dimensions are not even
if ((self.image.shape[0] % self.binsize != 0)) |
((self.image.shape[1] % self.binsize != 0)):
if (((self.image.shape[0] % self.binsize != 0)) |
((self.image.shape[1] % self.binsize != 0))):
LOG.warning('Image dimensions do not evenly divide by bin size.'
'\nExtra rows/columns will be trimmed first.')