Skip to content

Commit

Permalink
fixed image scaling issue (0<px<1)
Browse files Browse the repository at this point in the history
  • Loading branch information
mommermi committed Dec 4, 2018
1 parent ec68834 commit 551ac2d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def quickview_image(self, filename):
imgdat[np.where(np.isnan(imgdat))[0]] = np.nanmedian(imgdat)
imgdat = np.clip(imgdat, np.percentile(imgdat, 1),
np.percentile(imgdat, 99))
imgdat = (imgdat - np.min(imgdat)) / np.max(imgdat)
imgdat = (imgdat - np.min(imgdat)) / np.max(imgdat - np.min(imgdat))
# resize image larger than lg_image_size_px on one side
imgdat = resize(imgdat,
(min(imgdat.shape[0], self.conf.image_size_lg_px),
Expand Down Expand Up @@ -342,6 +342,14 @@ def add_index(self, filenames, datadirectory, obsparam):
translated_filtername = obsparam['filter_translations'][
refheader[obsparam['filter']]]

print(self.function_tag,
datadirectory,
obsparam['telescope_instrument'],
len(filenames),
raw_filtername,
translated_filtername,
os.path.join(datadirectory, 'LOG'))

html = ("{:s}\n<H1>Photometry Pipeline Diagnostic Output</H1>\n"
"<TABLE CLASS=\"gridtable\">\n"
" <TR><TH>Data Directory</TH><TD>{:s}</TD></TR>\n"
Expand All @@ -357,8 +365,8 @@ def add_index(self, filenames, datadirectory, obsparam):
datadirectory,
obsparam['telescope_instrument'],
len(filenames),
raw_filtername,
translated_filtername,
str(raw_filtername),
str(translated_filtername),
os.path.join(datadirectory, 'LOG'))

html += "<H3>Data Summary</H3>\n"
Expand Down

0 comments on commit 551ac2d

Please sign in to comment.