-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Hi,
Currently, I cannot create a DataSet from a list of targets. For example,
ztf = skysurvey.ZTF.from_logs()
tstart, tstop = ztf.get_timerange()
snii = skysurvey.SNeII.from_draw(500, tstart=tstart, tstop=tstop, effect=skysurvey.effects.mw_extinction)
sniin = skysurvey.SNeIIn.from_draw(500, tstart=tstart, tstop=tstop, effect=skysurvey.effects.mw_extinction)
dset = skysurvey.DataSet.from_targets_and_survey([snii, sniin], ztf)
This raises AttributeError: 'TemplateCollection' object has no attribute 'source'
which is because it calls this fuction from line 270 of collection.py:
@property
def template_names(self):
if not hasattr(self, "_template_names") or self._template_names is None:
self._template_names = [
target.template.source.name for target in self.targets
]
return self._template_names
I think the problem occurs because snii and sniin are MultiTemplateTSTransients. If I do two snia draws like
snia = skysurvey.SNeIa.from_draw(500, tstart=tstart, tstop=tstop, effect=skysurvey.effects.mw_extinction)
snia2 = skysurvey.SNeIa.from_draw(500, tstart=tstart, tstop=tstop, effect=skysurvey.effects.mw_extinction)
dset = skysurvey.DataSet.from_targets_and_survey([snia, snia2], ztf)
then there is no issue.
But there is still an issue with an snia and snii combination (and this example is given in the docs: step 3 for multi-targets)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels