Commit b5552d21 authored by Leo Pound Singer's avatar Leo Pound Singer Committed by Leo Pound Singer

Do not print airmass table by default

parent cbebcbde
Pipeline #51984 passed with stages
in 9 minutes and 33 seconds
......@@ -27,6 +27,9 @@ from . import ArgumentParser, FileType, figure_parser
def parser():
from astropy.coordinates import EarthLocation
parser = ArgumentParser(parents=[figure_parser])
parser.add_argument(
'-v', '--verbose', action='store_true',
help='Print airmass table to stdout')
parser.add_argument(
'input', metavar='INPUT.fits[.gz]', type=FileType('rb'),
default='-', nargs='?', help='Input FITS file')
......@@ -161,17 +164,18 @@ def main(args=None):
min(times).to_datetime(tzinfo).date(),
timezone))
# Write airmass table to stdout.
times.format = 'isot'
table = Table(masked=True)
table['time'] = times
table['sun_alt'] = np.ma.masked_greater_equal(
observer.sun_altaz(times).alt, 0)
table['sun_alt'].format = lambda x: '{}'.format(int(np.round(x)))
for p, data in sorted(zip(percentiles, airmass)):
table[str(p)] = np.ma.masked_invalid(data)
table[str(p)].format = lambda x: '{:.01f}'.format(np.around(x, 1))
table.write(sys.stdout, format='ascii.fixed_width')
if opts.verbose:
# Write airmass table to stdout.
times.format = 'isot'
table = Table(masked=True)
table['time'] = times
table['sun_alt'] = np.ma.masked_greater_equal(
observer.sun_altaz(times).alt, 0)
table['sun_alt'].format = lambda x: '{}'.format(int(np.round(x)))
for p, data in sorted(zip(percentiles, airmass)):
table[str(p)] = np.ma.masked_invalid(data)
table[str(p)].format = lambda x: '{:.01f}'.format(np.around(x, 1))
table.write(sys.stdout, format='ascii.fixed_width')
# Show or save output.
opts.output()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment