-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathpybdsm_script.py
More file actions
executable file
·37 lines (34 loc) · 1.61 KB
/
pybdsm_script.py
File metadata and controls
executable file
·37 lines (34 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 - Francesco de Gasperin
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import bdsf
import sys
f = sys.argv[1]
try:
freq = sys.argv[2]
except:
freq = None
img = bdsf.process_image(f, advanced_opts=True, detection_image=f.replace('int', 'app'), interactive=False, thresh_pix=5., thresh_isl=4., \
adaptive_rms_box=True, rms_box=(140,20), rms_box_bright=(70,10), adaptive_thresh=6., frequency=freq)
img.write_catalog(format='fits',catalog_type='srl', clobber=True)
img.write_catalog(format='ds9',catalog_type='srl', clobber=True)
#img.write_catalog(format='ds9',catalog_type='gaul', clobber=True)
#img.export_image(outfile=f+'_gaus_resid.fits', img_type='gaus_resid',clobber=True)
#img.export_image(outfile=f+'_gaus_model.fits', img_type='gaus_model',clobber=True)
#img.export_image(outfile=f+'_rms.fits', img_type='rms',clobber=True)
#img.export_image(outfile=f+'_mean.fits', img_type='mean',clobber=True)