Skip to content

Commit

Permalink
implemented -nodeblending option for pp_photometry
Browse files Browse the repository at this point in the history
  • Loading branch information
mommermi committed Oct 31, 2019
1 parent 4de4b21 commit 63967ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ the logical order:
curve-of-growth analysis
:param -target_only: only account for the target in the
curve-of-growth analysis
:param -nodeblending: (optional) deactives Source Extractor deblending
:param images: images to run `pp_photometry` on


Expand Down
16 changes: 13 additions & 3 deletions pp_photometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@


def curve_of_growth_analysis(filenames, parameters,
display=False, diagnostics=False):
nodeblending=False, display=False,
diagnostics=False):

output = {}
obsparam = parameters['obsparam']
Expand All @@ -78,6 +79,7 @@ def curve_of_growth_analysis(filenames, parameters,
'paramfile': _pp_conf.rootpath
+ '/setup/twentyapertures.sexparam',
'aprad': aprads, 'telescope': parameters['telescope'],
'nodeblending': nodeblending,
'quiet': False}

extraction = pp_extract.extract_multiframe(filenames, extractparameters)
Expand Down Expand Up @@ -339,7 +341,8 @@ def curve_of_growth_analysis(filenames, parameters,

def photometry(filenames, sex_snr, source_minarea, aprad,
manobjectname, background_only, target_only,
telescope, obsparam, display=False,
telescope, obsparam, nodeblending=False,
display=False,
diagnostics=False):
"""
wrapper for photometry analysis
Expand All @@ -353,6 +356,7 @@ def photometry(filenames, sex_snr, source_minarea, aprad,
'target_only': target_only,
'obsparam': obsparam,
'telescope': telescope,
'nodeblending': nodeblending,
'quiet': not display}

# do curve-of-growth analysis if aprad not provided
Expand All @@ -372,6 +376,7 @@ def photometry(filenames, sex_snr, source_minarea, aprad,

photpar['aprad'] = aprads
cog = curve_of_growth_analysis(filenames, photpar,
nodeblending=nodeblending,
display=display,
diagnostics=diagnostics)
aprad = cog['optimum_aprad']
Expand Down Expand Up @@ -442,6 +447,9 @@ def photometry(filenames, sex_snr, source_minarea, aprad,
parser.add_argument('-target_only', help='find aperture for target only',
action="store_true")
parser.add_argument('images', help='images to process', nargs='+')
parser.add_argument('-nodeblending',
help='deactivate deblending in source extraction',
action="store_true")

args = parser.parse_args()
sex_snr = float(args.snr)
Expand All @@ -450,6 +458,7 @@ def photometry(filenames, sex_snr, source_minarea, aprad,
manobjectname = args.target
background_only = args.background_only
target_only = args.target_only
nodeblending = args.nodeblending
filenames = args.images

# check if input filenames is actually a list
Expand Down Expand Up @@ -477,5 +486,6 @@ def photometry(filenames, sex_snr, source_minarea, aprad,

phot = photometry(filenames, sex_snr, source_minarea, aprad,
manobjectname, background_only, target_only,
telescope, obsparam, display=True,
telescope, obsparam,
nodeblending=nodeblending, display=True,
diagnostics=True)

0 comments on commit 63967ef

Please sign in to comment.