Esempio n. 1
0
from glue.segmentdb import segmentdb_utils

logging.basicConfig(format='%(asctime)s:%(levelname)s : %(message)s', \
                    level=logging.INFO,datefmt='%I:%M:%S')

# command line options
_desc = __doc__[1:]
parser = argparse.ArgumentParser(description=_desc)
parser.add_argument('--version', action='version', version=__version__)
parser.add_argument("-d", "--output-dir", required=True,\
                    help="Path to output directory.")
_workflow.add_workflow_command_line_group(parser)
args = parser.parse_args()

workflow = _workflow.Workflow(args)
currDir = os.path.abspath(args.output_dir)
segDir = os.path.join(currDir, "segments")
dfDir = os.path.join(currDir, "datafind")

print "BEGIN BY GENERATING SCIENCE AND CAT_X VETOES"


def segment_report(sSegs):
    fullLen = 0
    fullNum = 0
    shortLen = 0
    shortNum = 0
    longLen = 0
    longNum = 0
    for ifo in sSegs.keys():
Esempio n. 2
0
import argparse
from glue import segments
import pycbc.workflow as _workflow

logging.basicConfig(format='%(asctime)s:%(levelname)s : %(message)s', \
                    level=logging.INFO,datefmt='%I:%M:%S')
logger = logging.getLogger()

# command line options
_desc = __doc__[1:]
parser = argparse.ArgumentParser(description=_desc)
parser.add_argument('--version', action='version', version=__version__)
_workflow.add_workflow_command_line_group(parser)
args = parser.parse_args()

workflow = _workflow.Workflow(args, 'daily_check')
currDir = os.getcwd()
segDir = os.path.join(currDir, "segments")
dfDirSYR = os.path.join(currDir, "datafindSYR")
dfDirCIT = os.path.join(currDir, "datafindCIT")
dfDirLHO = os.path.join(currDir, "datafindLHO")
dfDirLLO = os.path.join(currDir, "datafindLLO")
dfDirUWM = os.path.join(currDir, "datafindUWM")

print "BEGIN BY GENERATING SCIENCE AND CAT_X VETOES"


def segment_report(sSegs):
    fullLen = 0
    fullNum = 0
    shortLen = 0
opts.workflow_name = "wfex"
opts.config_files = ["ex_wfex.ini"]
opts.config_delete = None
opts.config_overrides = None
opts.output_file = "wfex.dax"
opts.output_map = "output.map"
opts.transformation_catalog = "wfex.tc.txt"

# set output directory
out_dir = "wfex_results"

# create output directory
wf.makedir(out_dir)

# create workflow
container = wf.Workflow(opts, opts.workflow_name)

# create executable
exe_echo = wf.Executable(container.cp,
                         "echo",
                         ifos=container.ifos,
                         out_dir=out_dir)

# create node
node_echo = exe_echo.create_node()

# add options
node_echo.add_opt("--option-1", container.analysis_time[0])
node_echo.add_opt("--option-2", container.analysis_time[1])

# add node to workflow
Esempio n. 4
0
import argparse
import pycbc
import pycbc.workflow as wf
import os

pycbc.init_logging(True)
parser = argparse.ArgumentParser(description=__doc__[1:])
parser.add_argument("--multilevel", action='store_true', default=False)
wf.add_workflow_command_line_group(parser)
wf.add_workflow_settings_cli(parser)
args = parser.parse_args()

input_file = wf.resolve_url_to_file("test_input.txt")
input_file.add_pfn(os.path.abspath('./test_input.txt'), 'local')

cont = wf.Workflow(args, 'cont')
sub1 = wf.Workflow(args, 'sub1')
sub1_1 = wf.Workflow(args, 'sub1_1')
sub2 = wf.Workflow(args, 'sub2')

exe1 = wf.Executable(cont.cp, 'exe1')

SUBSUB = args.multilevel

# Subworkflow 1: generate file that will be needed later

# PATH1: generate that input in a sub-sub workflow
if SUBSUB:
    # Subworkflow 1: sub-subworkflow
    node = exe1.create_node()
    wf1_out_file = wf.File.from_path(os.path.abspath("test_output.txt.2"))