Skip to content

Commit

Permalink
Merge branch 'master' into trm-dev
Browse files Browse the repository at this point in the history
Bringing in some urgent fixes I made to the master branch that I want in this development branch
  • Loading branch information
trmrsh committed May 26, 2021
2 parents dfe940a + e9c296f commit 75c20a9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion hipercam/fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ def fitGaussian(
# construct function object for gaussian fit. First the mode.
mode = "" if sky is None else "s"
mode = mode if fwhm_fix else mode + "f"
gfit = Gfit(wind, read, gain, ndiv, mode, fwhm)
gfit = Gfit(wind, sigma, ndiv, mode, fwhm)

mode_switch = False

Expand Down
2 changes: 1 addition & 1 deletion hipercam/scripts/genred.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def genred(args=None):
)

sinner = cl.get_value(
"sinner", "inner sky aperture radius [unbinned pixels]", 30.0, rmax
"sinner", "inner sky aperture radius [unbinned pixels]", 30.0, ramax
)

souter = cl.get_value(
Expand Down
2 changes: 1 addition & 1 deletion hipercam/scripts/joinup.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def joinup(args=None):
ystart = (wind.lly - llymin) // ybin
data[ystart:ystart+wind.ny,xstart:xstart+wind.nx] = wind.data

if dtype == 'uint16' and data.min() < 0 or data.max() > 65535:
if dtype == 'uint16' and (data.min() < 0 or data.max() > 65535):
raise hcam.HipercamError(
f'CCD {cnam}, frame {nf}, data range {data.min()} to {data.max()}, is incompatible with uint16'
)
Expand Down
22 changes: 10 additions & 12 deletions hipercam/scripts/rupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,10 @@ def rupdate(args=None):

elif version == "20200318":
# update version number
line = (
"version = {:s} # must be"
" compatible with the"
" version in reduce\n"
).format(hcam.REDUCE_FILE_VERSION)
lines.append(line)
lines.append(
f"version = {hcam.REDUCE_FILE_VERSION} # must be"
" compatible with the version in reduce\n"
)

# record version in case we need other actions later
nversion = 4
Expand All @@ -135,22 +133,22 @@ def rupdate(args=None):
exit(1)

elif line.startswith("fit_fwhm_min ="):
if version <= 3:
lines.append(line)
lines.append(line)
if nversion <= 3:
lines.append("\n# Next line was automatically added by rupdate\n")
lines.append(
"fit_fwhm_max = 1000 # Maximum FWHM, unbinned pixels\n"
)

elif line.startswith("dark ="):
if version <= 4:
lines.append(line)
lines.append(line)
if nversion <= 4:
lines.append("\n# Next lines were automatically added by rupdate\n")
lines.append("fringe = # Fringe map, blabk to ignore\n")
lines.append("fmap = # Fringe map, blank to ignore\n")
lines.append("fpair = # FringePair file, ignored if fringe blank\n")
lines.append("nhalf = # Half-width, ignored if fringe blank\n")
lines.append("rmin = # minimum ratio, ignored if fringe blank\n")
lines.append("rmax = # maximum ratio ignored if fringe blank\n")
lines.append("rmax = # maximum ratio ignored if fringe blank\n\n")

else:
# Default action is just to store save the line
Expand Down
2 changes: 1 addition & 1 deletion hipercam/scripts/setaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ def _centre(self):
sky = np.percentile(fwind.data, 25)

# uncertainties
sigma = np.sqrt(self.read2**2 + np.maximum(0,fwind.data)/self.gain)
sigma = np.sqrt(self.read**2 + np.maximum(0,fwind.data)/self.gain)

# refine the Aperture position by fitting the profile
(
Expand Down

0 comments on commit 75c20a9

Please sign in to comment.