Commit 68c692ec authored by John Douglas Veitch's avatar John Douglas Veitch

Let lalinference_pipe use outside cache file

Original: e7c4a301441c394c093913eab4164cb0a7f62dff
parent 16ab15c3
......@@ -167,7 +167,7 @@ def chooseEngineNode(name):
return LALInferenceMCMCNode
return EngineNode
def scan_timefile(self,timefile):
def scan_timefile(timefile):
import re
p=re.compile('[\d.]+')
times=[]
......@@ -490,19 +490,25 @@ class LALInferencePipelineDAG(pipeline.CondorDAG):
gotdata+=node.add_ifo_data(ifo,seg,self.channels[ifo],timeslide=slide)
if self.config.has_option('lalinference','fake-cache'):
node.cachefiles=ast.literal_eval(self.config.get('lalinference','fake-cache'))
node.channels=ast.literal_eval(self.config.get('data','channels'))
if len(ifos)==0: node.ifos=node.cachefiles.keys()
else: node.ifos=ifos
print 'added ifos %s'%(str(ifos))
node.timeslides=dict([ (ifo,0) for ifo in node.ifos])
gotdata=1
else:
# Add the nodes it depends on
for seg in node.scisegs.values():
dfnode=seg.get_df_node()
if dfnode is not None and dfnode not in self.get_nodes():
self.add_node(dfnode)
self.add_node(node)
if gotdata==0:
'Print no data found for time %f'%(end_time)
return None
if extra_options is not None:
for opt in extra_options.keys():
node.add_var_arg('--'+opt+' '+extra_options[opt])
# Add the nodes it depends on
for seg in node.scisegs.values():
dfnode=seg.get_df_node()
if dfnode is not None and dfnode not in self.get_nodes():
self.add_node(dfnode)
self.add_node(node)
# Add control options
if self.config.has_option('input','injection-file'):
node.set_injection(self.config.get('input','injection-file'),event.event_id)
......@@ -691,8 +697,13 @@ class EngineNode(pipeline.CondorDAGNode):
# NOTE: We perform this arithmetic for all ifos to ensure that a common data set is
# Used when we are running the coherence test.
# Otherwise the noise evidence will differ.
starttime=max([int(self.scisegs[ifo].start()) for ifo in self.ifos])
endtime=min([int(self.scisegs[ifo].end()) for ifo in self.ifos])
if self.scisegs!={}:
print self.scisegs
starttime=max([int(self.scisegs[ifo].start()) for ifo in self.ifos])
endtime=min([int(self.scisegs[ifo].end()) for ifo in self.ifos])
else:
starttime=self.get_trig_time()-0.5*self.maxlength
endtime=starttime+self.maxlength
self.GPSstart=starttime
self.__GPSend=endtime
length=endtime-starttime
......@@ -708,9 +719,9 @@ class EngineNode(pipeline.CondorDAGNode):
if self.psdstart is not None:
self.GPSstart=self.psdstart
print 'Over-riding start time to user-specified value %f'%(self.GPSstart)
if self.GPSstart<starttime or self.GPSstart>endtime:
print 'ERROR: Over-ridden time lies outside of science segment!'
raise Exception('Bad psdstart specified')
#if self.GPSstart<starttime or self.GPSstart>endtime:
# print 'ERROR: Over-ridden time lies outside of science segment!'
# raise Exception('Bad psdstart specified')
self.add_var_opt('psdstart',str(self.GPSstart))
if self.psdlength is None:
self.psdlength=self.__GPSend-self.GPSstart
......
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