Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
javierggt committed Feb 1, 2021
1 parent aaebaca commit 7faca45
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
11 changes: 7 additions & 4 deletions agasc/scripts/update_mag_supplement.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ def main():
else:
args.reports_dir = Path(os.path.expandvars(args.reports_dir))

if args.whole_history and (args.start or args.stop):
logger.error('--whole-history argument is incompatible with --start/--stop arguments')
the_parser.exit(1)

if args.whole_history:
if args.start or args.stop:
logger.error('--whole-history argument is incompatible with --start/--stop arguments')
the_parser.exit(1)
args.start = None
args.stop = None

pyyaks.logger.get_logger(
name='agasc.supplement',
level=args.log_level.upper(),
Expand Down
11 changes: 2 additions & 9 deletions agasc/supplement/magnitudes/update_mag_supplement.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,6 @@ def do(output_dir,
# as ascii. It displays a warning which I want to avoid:
warnings.filterwarnings("ignore", category=tables.exceptions.FlavorWarning)

if start:
start = CxoTime(start)
if stop:
stop = CxoTime(stop)

filename = output_dir / 'agasc_supplement.h5'

if multi_process:
Expand All @@ -336,10 +331,8 @@ def do(output_dir,
if agasc_ids is None:
agasc_ids = sorted(star_obs_catalogs.STARS_OBS['agasc_id'])
else:
if not stop:
stop = CxoTime.now().date
if not start:
start = (CxoTime(stop) - 14 * u.day).date
stop = CxoTime(stop).date if stop else CxoTime.now().date
start = CxoTime(start).date if start else (CxoTime(stop) - 14 * u.day).date
obs_in_time = ((star_obs_catalogs.STARS_OBS['mp_starcat_time'] >= start)
& (star_obs_catalogs.STARS_OBS['mp_starcat_time'] <= stop))
agasc_ids = sorted(star_obs_catalogs.STARS_OBS[obs_in_time]['agasc_id'])
Expand Down

0 comments on commit 7faca45

Please sign in to comment.