Skip to content

Commit

Permalink
Add options for not doing spline fitting, still making checkmasks plots
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelley M. Hess committed Oct 21, 2020
1 parent bf66116 commit e06d9d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sourcefinding.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,4 @@ def run(i):
os.system('/home/apercal/SoFiA-2/sofia ' + new_paramfile + ' >> ' + outlog)

# After all cubes are done, run checkmasks to get summary plots for cleaning:
checkmasks.main(taskid, [b])
checkmasks.main(taskid, [b], args.nospline)
14 changes: 11 additions & 3 deletions src/checkmasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ def parse_args():
parser.add_argument('-b', '--beams', default='0-39',
help='Specify a range (0-39) or list (3,5,7,11) of beams on which to do source finding (default: %(default)s).')

parser.add_argument('-n', "--nospline",
help="Only controls output name of png! For book keeping purposes.",
action='store_true')

# Parse the arguments above
args = parser.parse_args()
return args


# If running by itself use: python -m src/checkmasks -t 191004041 -b 14
def main(taskid, beams):
def main(taskid, beams, nospline=False):

cubes = [1, 2, 3] # Most sources in 2; nearest galaxies in 3.
max_cat_len = 25
Expand Down Expand Up @@ -129,8 +133,12 @@ def main(taskid, beams):
else:
print("\tNo continuum filtered file for Beam {:02} Cube {}. Check sourcefinding/ALTA?".format(b, c))

fig_im.savefig(loc + 'HI_image_4sig_summary_filtspline.png', bbox_inches='tight')
fig_spec.savefig(loc + 'HI_image_4sig_summary_spec_filtspline.png', bbox_inches='tight')
if nospline:
fig_im.savefig(loc + 'HI_image_4sig_summary.png', bbox_inches='tight')
fig_spec.savefig(loc + 'HI_image_4sig_summary_spec.png', bbox_inches='tight')
else:
fig_im.savefig(loc + 'HI_image_4sig_summary_filtspline.png', bbox_inches='tight')
fig_spec.savefig(loc + 'HI_image_4sig_summary_spec_filtspline.png', bbox_inches='tight')
plt.close(fig_im)
plt.close(fig_spec)
else:
Expand Down

0 comments on commit e06d9d4

Please sign in to comment.