Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Revert "Add calibration uncertainty model" #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions bin/gwin
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import gwin
from gwin import (__version__, burn_in, option_utils)
from gwin.io.hdf import InferenceFile
from gwin.option_utils import validate_checkpoint_files
from gwin.calibration import Recalibrate

# command line usage
parser = argparse.ArgumentParser(usage=__file__ + " [--options]",
Expand Down Expand Up @@ -199,9 +198,9 @@ with ctx:
# get ifo-specific instances of calibration model
if cp.has_section('calibration'):
logging.info("Initializing calibration model")
recalibration = {ifo: Recalibrate.from_config(cp, ifo, section='calibration') for
ifo in opts.instruments}
model_args['recalibration'] = recalibration
recalib = {ifo : strain.read_model_from_config(cp, ifo) for
ifo in opts.instruments}
model_args['recalib'] = recalib

# get gates for templates
gates = strain.gates_from_cli(opts)
Expand Down
16 changes: 9 additions & 7 deletions bin/gwin_make_workflow
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ parser.add_argument("--gps-end-time", type=float, nargs="+", default=None,
"this option is ignored.")

# input configuration file options
parser.add_argument("--inference-config-file", type=str, nargs='+', required=True,
parser.add_argument("--inference-config-file", type=str, required=True,
help="workflow.WorkflowConfigParser parsable file with "
"prior information.")
"proir information.")
parser.add_argument("--prior-section", type=str, default="prior",
help="Name of the section in inference configuration file "
"that contains priors.")
Expand Down Expand Up @@ -154,6 +154,9 @@ workflow_options = opts.bank_file != None \
if not workflow_options and not (opts.gps_end_time != None):
raise ValueError("Must use either workflow options or --gps-end-time")

# typecast str from command line to File instances
config_file = to_file(opts.inference_config_file)

# sections for output HTML pages
rdir = layout.SectionNumber("results",
["detector_sensitivity", "priors", "posteriors",
Expand Down Expand Up @@ -191,6 +194,9 @@ workflow_options = opts.bank_file != None \
if not workflow_options and not (opts.gps_end_time != None):
raise ValueError("Must use either workflow options or --gps-end-time")

# typecast str from command line to File instances
config_file = to_file(opts.inference_config_file)

# if using workflow files to find analysis times
if workflow_options:

Expand Down Expand Up @@ -233,11 +239,7 @@ inference_exe = wf.Executable(workflow.cp, "inference", ifos=workflow.ifos,
out_dir=opts.output_dir)

# read inference configuration file
# typecast str from command line to File instances
cp = WorkflowConfigParser(opts.inference_config_file)
with open('inference.ini', 'w') as ff:
cp.write(ff)
config_file = to_file('inference.ini')
cp = WorkflowConfigParser([opts.inference_config_file])

# get channel names
channel_names = {}
Expand Down
12 changes: 2 additions & 10 deletions docs/command-line/gwin_make_workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,11 @@ A simple configuration file for parameter estimation on the ringdown is::

If you want to use another variable parameter in the inference sampler then add its name to ``[variable_params]`` and add a prior section like shown above.

When working on real data, it is necessary to marginalise over calibration uncertainty.
The model and parameters describing the calibration uncertainty can be passed in another ini file, e.g.:

.. literalinclude:: ../../examples/workflow/GW150914_example/calibration.ini
:language: ini

=====================
Generate the workflow
=====================

To generate a workflow you will need your configuration files.
The workflow creates a single config file ``inference.ini`` from all the files specified in ``INFERENCE_CONFIG_PATH``.
We set the following enviroment variables for this example::
To generate a workflow you will need your configuration files. We set the following enviroment variables for this example::

# name of the workflow
WORKFLOW_NAME="r1"
Expand All @@ -100,7 +92,7 @@ We set the following enviroment variables for this example::

# input configuration files
CONFIG_PATH=workflow.ini
INFERENCE_CONFIG_PATH="gwin.ini calibration.ini"
INFERENCE_CONFIG_PATH=gwin.ini

Specify a directory to save the HTML pages::

Expand Down
132 changes: 0 additions & 132 deletions examples/workflow/GW150914_example/calibration.ini

This file was deleted.

Loading