Skip to content

Commit

Permalink
streamline output dir wrt webpage paths; not ideal, todo: consolidate…
Browse files Browse the repository at this point in the history
… visibility.py, run_visibility.py and flows_create_visibility_plots.py
  • Loading branch information
Erik Jensen committed Nov 5, 2024
1 parent 7f5342b commit abf3c48
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions run_visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,30 @@
from flows.plots import plots_interactive
import flows
from flows.target import Target
import re
import os.path

if __name__ == '__main__':
# Parse command line arguments:
parser = argparse.ArgumentParser(description='Run photometry pipeline.')
parser.add_argument('-t', '--target', type=str, help='TIC identifier of target.', nargs='?', default=2)
parser.add_argument('-s', '--site', type=int, help='TIC identifier of target.', nargs='?', default=None)
parser.add_argument('-d', '--date', type=str, help='TIC identifier of target.', nargs='?', default=None)
parser.add_argument('-o', '--output', type=str, help='TIC identifier of target.', nargs='?', default=None)
parser.add_argument('-o', '--output', type=str, help='Base output directory for visibility plots.', nargs='?', default=None)
args = parser.parse_args()

if args.output is None:
plots_interactive()

t = Target.from_tname(args.target)
flows.visibility(target=t, siteid=args.site, date=args.date, output=args.output)

output = args.output
if output is not None:
regex_year = re.compile(r'^(\d+)')
m = regex_year.match(t.name)
year = int(m.group(1))
output = os.path.join(output, str(year), t.name)
if not os.path.exists(output):
os.makedirs(output)

flows.visibility(target=t, siteid=args.site, date=args.date, output=output)

0 comments on commit abf3c48

Please sign in to comment.