Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mommermi committed Oct 8, 2018
1 parent a626633 commit b8d57bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
9 changes: 7 additions & 2 deletions catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ def download_catalog(self, ra_deg, dec_deg, rad_deg,
+ 'a {:.2f} deg radius').format(self.catalogname,
ra_deg, dec_deg,
rad_deg),
end=' ', flush=True)
end=' ')
sys.stdout.flush()
logging.info(('query Vizier for {:s} at {:7.3f}/{:+.3f} in '
+ 'a {:.2f} deg radius').format(self.catalogname,
ra_deg, dec_deg,
Expand Down Expand Up @@ -340,6 +341,7 @@ def download_catalog(self, ra_deg, dec_deg, rad_deg,
self.data.rename_column('e_DE_ICRS', 'e_dec.deg')
self.data['e_dec.deg'].convert_unit_to(u.deg)
self.data.rename_column('Epoch', 'epoch_yr')
self.data['mag'] = self.data['Gmag'] # required for scamp

# TBD:
# - implement proper error ellipse handling
Expand Down Expand Up @@ -701,7 +703,10 @@ def read_ldac(self, filename, fits_filename=None, maxflag=None,
if telescope_keyword in line:
telescope = line.split('\'')[1]
self.catalogname = filename
self.origin = '{:s};{:s}'.format(telescope.strip(), fits_filename)
if fits_filename is not None:
self.origin = '{:s};{:s}'.format(telescope.strip(), fits_filename)
else:
self.origin = '{:s};'.format(telescope.strip())
self.magsys = 'instrumental'

# reject flagged sources (if requested)
Expand Down
10 changes: 5 additions & 5 deletions pp_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ def run_the_pipeline(filenames, man_targetname, man_filtername,
refcatname = 'instrumental magnitudes'
summary_message = "<FONT COLOR=\"green\">average zeropoint = " + \
("%5.2f+-%5.2f using %s</FONT>; " %
(numpy.average(zps),
numpy.average(zp_errs),
(np.average(zps),
np.average(zp_errs),
refcatname))
except TypeError:
summary_message = "<FONT COLOR=\"red\">no phot. calibration</FONT>; "
Expand All @@ -309,13 +309,13 @@ def run_the_pipeline(filenames, man_targetname, man_filtername,
None, None,
display=True, diagnostics=True)

targets = numpy.array(list(distillate['targetnames'].keys()))
targets = np.array(list(distillate['targetnames'].keys()))
try:
target = targets[targets != 'control_star'][0]
mags = [frame[7] for frame in distillate[target]]
summary_message = ("average target brightness and std: " +
"%5.2f+-%5.2f\n" % (numpy.average(mags),
numpy.std(mags)))
"%5.2f+-%5.2f\n" % (np.average(mags),
np.std(mags)))
except IndexError:
summary_message = "no primary target extracted"

Expand Down

0 comments on commit b8d57bf

Please sign in to comment.