"--output", dqVetoes["combined-veto-file"][category] ] + veto_cat_files)
  inspiralutils.make_external_call(concat_veto_call)

  # FIXME: remove this block when the veto files from
  # ligolw_segments_from_cats have contain a segment table with start_time_ns
  # and end_time_ns, and when the process table doesn't need the domain, jobid,
  # and is_online columns added

  compat_veto_call = " ".join([cp.get("condor", "ligolw_segments_compat"), dqVetoes["combined-veto-file"][category]])
  inspiralutils.make_external_call(compat_veto_call)

segFile = {}

for ifo in ifos:
  segFile[ifo], dqVetoes[ifo] = inspiralutils.findSegmentsToAnalyze(
      cp, ifo, veto_categories,
      opts.generate_segments, opts.use_available_data,
      opts.generate_veto_segments)
  # set correct name as we're in the segments directory:
  segFile[ifo] = "../segments/" + segFile[ifo]
  cp.set("input", ifo.lower() + "-segments", segFile[ifo])
  for key in dqVetoes[ifo].keys():
    dqVetoes[ifo][key] = "../segments/" + dqVetoes[ifo][key]
for key in dqVetoes["combined-veto-file"].keys():
  dqVetoes["combined-veto-file"][key] = "../segments/" + dqVetoes["combined-veto-file"][key]

os.chdir("..")

hw_inj_dir = "hardware_injection_summary"
if opts.run_hardware_inj:
  inspiralutils.mkdir(hw_inj_dir)
  inspiralutils.get_hwinj_segments(cp,ifos,hw_inj_dir)
Example #2
0
from glue import segmentsUtils

parser=OptionParser()
opts,args = parser.parse_args()
config=ConfigParser.ConfigParser()
config.read(args[0])


if config.has_option('analysis','ifos'):
  ifos=ast.literal_eval(config.get('analysis','ifos'))
else:
  ifos=['H1','L1']#,'V1']
segments={}
if config.has_option('datafind','veto-categories'):
  veto_categories=ast.literal_eval(config.get('datafind','veto-categories'))
else: veto_categories=[]

for ifo in ifos:

    (segFileName,dqVetoes)=inspiralutils.findSegmentsToAnalyze(config, ifo,
            veto_categories, generate_segments=True,
            use_available_data=False, data_quality_vetoes=False)

    segfile=open(segFileName)
    segments[ifo]=segmentsUtils.fromsegwizard(segfile)

    print segments[ifo]



Example #3
0
    vetoCats = ast.literal_eval(cp.get('segments', 'veto-categories'))

    vetoDefFile = inspiralutils.downloadVetoDefFile(cp, True)
    inspiralutils.generate_veto_cat_files(cp, vetoDefFile, True)

    # Populate dictionary with veto filenames for each IFO and generate the veto segment files
    veto_dic = {}
    seg_dic = {}

    # Download science segment files for each IFO
    for IFO in ifos:
        (seg_dic[IFO], veto_dic[IFO]) = inspiralutils.findSegmentsToAnalyze(
            cp,
            IFO,
            vetoCats,
            generate_segments=True,
            use_available_data=False,
            data_quality_vetoes=True)

    # Feed science and veto segment files to make_injtimes and generate injection times and timeslides
    print 'TIGER: Generating GPS times for unvetoed injections'
    ensure_dir(os.path.join(basefolder, 'injtimes'))
    IFOdict = {}
    for ifo in ifos:
        IFOdict[ifo] = make_injtimes.IFO(ifo,
                                         seg_dic[ifo],
                                         veto_dic[ifo][4],
                                         minlen=max(psdlen, seglen))
    os.chdir(curdir)
Example #4
0
                        gps_end_time)])
        else:

            #
            # --- Run segdb query
            #

            if cp.has_option('datafind','veto-categories'):
              veto_categories=ast.literal_eval(cp.get('datafind','veto-categories'))
            else: veto_categories=[]

            curdir=os.getcwd()
            os.chdir(segment_dir)

            (segFileName,dqVetoes)=inspiralutils.findSegmentsToAnalyze(cp, ifo,
                    veto_categories, generate_segments=True,
                    use_available_data=False, data_quality_vetoes=False)

            segfile=open(segFileName)
            segmentList[ifo]=segmentsUtils.fromsegwizard(segfile)
            segmentList[ifo].coalesce()
            segfile.close()

            if segmentList[ifo] == []:
                print >> sys.stderr, "No matching segments for %s"%ifo
                sys.exit()

            os.chdir(curdir)


        # --------------------------------------------------------------------
  curdir = os.getcwd()
  os.chdir(segfolder)

  vetoCats = ast.literal_eval(cp.get('segments', 'veto-categories'))

  vetoDefFile = inspiralutils.downloadVetoDefFile(cp, True)
  inspiralutils.generate_veto_cat_files(cp, vetoDefFile, True)

  # Populate dictionary with veto filenames for each IFO and generate the veto segment files
  veto_dic = {}
  seg_dic = {}


  # Download science segment files for each IFO
  for IFO in ifos:
    (seg_dic[IFO], veto_dic[IFO]) = inspiralutils.findSegmentsToAnalyze(cp, IFO, vetoCats, generate_segments=True, use_available_data=False, data_quality_vetoes=True)


  # Feed science and veto segment files to make_injtimes and generate injection times and timeslides
  print 'TIGER: Generating GPS times for unvetoed injections'
  ensure_dir(os.path.join(basefolder, 'injtimes'))
  IFOdict={}
  for ifo in ifos: 
    IFOdict[ifo]=make_injtimes.IFO(ifo, seg_dic[ifo], veto_dic[ifo][4], minlen=max(psdlen, seglen))
  os.chdir(curdir)


  # Generate injtimes file
  if timeslides:
    print 'TIGER: Injection times will be generated with timeslides'
    timesdict = {}