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

clean up a few bugs and make tabs line up in photometry output #123

Merged
merged 1 commit into from
Jan 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions imexam/imexamine.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def plot_line(self, x, y, data=None, fig=None):
ax.set_ylabel(self.lineplot_pars["ylabel"][0])

if not self.lineplot_pars["xmax"][0]:
xmax = len(data[y, :])
xmax = len(data[int(y), :])
else:
xmax = self.lineplot_pars["xmax"][0]
ax.set_xlim(self.lineplot_pars["xmin"][0], xmax)
Expand Down Expand Up @@ -517,6 +517,7 @@ def aper_phot(self, x, y, data=None):
if data is None:
data = self._data

center = False
if not photutils_installed:
self.log.warning("Install photutils to enable")
else:
Expand Down Expand Up @@ -571,20 +572,17 @@ def aper_phot(self, x, y, data=None):
mag = magzero - 2.5 * (np.log10(total_flux))

pheader = (
"x\ty\tradius\tflux\tmag(zpt={0:0.2f})"
"sky\t".format(magzero)).expandtabs(15)
"x\ty\tradius\tflux\tmag(zpt={0:0.2f})\tsky/pix\t".format(magzero)).expandtabs(15)
if center:
pheader += ("fwhm")
pstr = "\n{0:.2f}\t{1:0.2f}\t{2:d}\t{3:0.2f}\t{4:0.2f}\
\t{5:0.2f}\t{6:0.2f}".format(x, y, radius,
total_flux, mag,
sky_per_pix,
math_helper.gfwhm(sigma)[0]).expandtabs(15)
pheader += ("fwhm(pix)")
pstr = "\n{0:.2f}\t{1:0.2f}\t{2:d}\t{3:0.2f}\t{4:0.2f}\t{5:0.2f}\t{6:0.2f}".format(x, y, radius,
total_flux, mag,
sky_per_pix,
math_helper.gfwhm(sigma)[0]).expandtabs(15)
else:
pstr = "\n{0:0.2f}\t{1:0.2f}\t{2:d}\t{3:0.2f}\
\t{4:0.2f}\t{5:0.2f}".format(x, y, radius,
total_flux, mag,
sky_per_pix,).expandtabs(15)
pstr = "\n{0:0.2f}\t{1:0.2f}\t{2:d}\t{3:0.2f}\t{4:0.2f}\t{5:0.2f}".format(x, y, radius,
total_flux, mag,
sky_per_pix).expandtabs(15)

# print(pheader + pstr)
self.log.info(pheader + pstr)
Expand Down