Skip to content

Commit

Permalink
ignore empty LDAC tables in curve-of-growth analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
mommermi committed Nov 20, 2018
1 parent 6059625 commit 7ca1e85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 6 additions & 2 deletions pp_photometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,15 @@ def curve_of_growth_analysis(filenames, parameters,
data = catalog('Sextractor_LDAC')
data.read_ldac(ldac_filename, maxflag=3)

if data.shape[0] == 0:
continue

# identify target and extract its curve-of-growth
n_target_identified = 0
if not parameters['background_only']:
residuals = numpy.sqrt((data['ra_deg']-target_ra)**2 +
(data['dec_deg']-target_dec)**2)

target_idx = numpy.argmin(residuals)
if residuals[target_idx] > _pp_conf.pos_epsilon/3600:
logging.warning(('WARNING: frame %s, large residual to ' +
Expand All @@ -182,8 +186,8 @@ def curve_of_growth_analysis(filenames, parameters,
n_src = 50 # use only 50 sources
for idx, src in enumerate(data.data[:n_src]):
if (numpy.any(numpy.isnan(src['FLUX_'+_pp_conf.photmode])) or
numpy.any(numpy.isnan(src['FLUXERR_'+_pp_conf.photmode])) or
src['FLAGS'] > 3):
numpy.any(numpy.isnan(src['FLUXERR_'+_pp_conf.photmode]))
or src['FLAGS'] > 3):
continue

# create growth curve
Expand Down
4 changes: 0 additions & 4 deletions pp_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,6 @@ def run_the_pipeline(filenames, man_targetname, man_filtername,
change_header,
diagnostics=True, display=True)

# check that all images are roughly for the same field in the sky

ra, dec, rad = toolbox.skycenter(catalogs)

# run wcs registration

# default sextractor/scamp parameters
Expand Down

0 comments on commit 7ca1e85

Please sign in to comment.