Commit 2245e7c3 authored by skamann's avatar skamann
Browse files

Debugged INITFIT for pixtable usage.

parent f7bba37b
......@@ -55,7 +55,7 @@ catalogue and is called by the function 'initfit'.
Latest SVN Revision
-------------------
349, 2016/08/05
350, 2016/08/05
"""
import datetime
import itertools
......@@ -79,7 +79,7 @@ from ..utils.statistics import der_snr
__author__ = "Sebastian Kamann (skamann@astro.physik.uni-goettingen.de)"
__revision__ = 349
__revision__ = 350
logger = logging.getLogger(__name__)
......@@ -266,8 +266,8 @@ def initfit(pampelmuse):
valid &= (dist > -(pampelmuse.ccmaxoff+10)) # sources outside FoV have negative values, add some margin
# Initialize sources-class
if pampelmuse.globsky: # add background component(s) if requested
# If requested, add background component(s) to source catalogue
if pampelmuse.globsky:
if pampelmuse.skysize <= 0:
background = BackgroundGrid.constant()
else:
......@@ -286,6 +286,7 @@ def initfit(pampelmuse):
if "dec" in cfp_results.keys():
cfp_results["dec"].append("0")
# Initialize instance of Sources-class
sources = Sources(ids=np.asarray(cfp_results["id"], dtype=np.int32)[valid])
sources.x = np.asarray(cfp_results["x"], dtype=np.float32)[valid]
sources.y = np.asarray(cfp_results["y"], dtype=np.float32)[valid]
......@@ -499,11 +500,12 @@ def initfit(pampelmuse):
sources.y += dy
# Match transformation in PSF instances to shape of IFS data
if isinstance(pampelmuse.ifs_data, MusePixtable): # pixtable has no constant transformation
# psf.transform = cc_data_image.shape)
raise NotImplementedError
if isinstance(pampelmuse.ifs_data, MusePixtable):
# Pixtable has no constant transformation, it is therefore matched to the shape of the IFS image created before
transform = psf_class.from_shape(cc_data_image.shape).transform
else:
[setattr(psf, 'transform', pampelmuse.ifs_data.transform) for psf in psf_instances]
transform = pampelmuse.ifs_data.transform
[setattr(psf, 'transform', transform) for psf in psf_instances]
for i in xrange(sources.nsrc):
if sources.ID[i] < 0:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment