Skip to content

Commit

Permalink
analysis.composite_indv_detect.main: print statement when file exists…
Browse files Browse the repository at this point in the history
…; auto overwrite (iss #21)
  • Loading branch information
astrochun committed Feb 22, 2020
1 parent 034b5f6 commit 4c173e0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Metallicity_Stack_Commons/analysis/composite_indv_detect.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from os.path import join
from os.path import exists

import numpy as np
from astropy.io import ascii as asc
Expand Down Expand Up @@ -71,4 +72,9 @@ def main(fitspath, dataset, composite_file, indv_em_line_file, indv_bin_file, ou
det3_table.add_columns([col_temp, col_metal]) # Add at the end (default)

# Write Astropy ASCII table containing composite T_e and derived metallicity
det3_table.write(outfile, format='ascii.fixed_width_two_line')

if exists(outfile):
print("File exists! Overwriting : ", outfile)
else:
print("Writing : ", outfile)
det3_table.write(outfile, overwrite=True, format='ascii.fixed_width_two_line')

0 comments on commit 4c173e0

Please sign in to comment.