{# Template of ini file for Parameter Estimation. This is a jinja template. The
explanation on jinja is here http://jinja.pocoo.org . #}

{% set engine = 'lalinferencenest' %}
{% set nparallel = '4' %}
{% set roq = 'True' %}
{% set roqdir = '/home/cbc/ROQ_data/IMRPhenomPv2/' %}
{% set approx = 'IMRPhenomPv2pseudoFourPN' %}
{% set neff = '1000' %}

{# IMRPhenomPv2_ROQ can not be applied for large massratio #}
{% if q <= 0.143 %}
    {% set approx = 'SEOBNRv4_ROM' %}
    {% set roqdir = '/home/cbc/ROQ_data/SEOBNRv4ROQ/' %}
{% endif %}

{# SEOBNRv4 for large massratio is not ROQed. #}
{# Change to non-ROQ run but use mcmc with 10 chains to make the run fast #}
{% if q <= 0.0588 %}
    {% set engine = 'lalinferencemcmc' %}
    {% set nparallel = '10' %}
    {% set roq = 'False' %}
    {% set neff = '300' %}
    {% set margphi = 'margphi=' %}
{% endif %}

{% if 'playground' in service_url %}
    {% set accounting_group = 'ligo.dev.o3.cbc.pe.lalinference' %}
{% else %}
    {% set accounting_group = 'ligo.prod.o3.cbc.pe.lalinference' %}
{% endif %}


[analysis]
ifos=['H1', 'L1', 'V1']
engine={{ engine }}
nparallel={{ nparallel }}
service-url={{ service_url }}
roq={{ roq }}
coherence-test=False
upload-to-gracedb=False
singularity=False
osg=False


[paths]
webdir={{ webdir }}
roq_b_matrix_directory={{ roqdir }}


[input]
max-psd-length=10000
padding=16
minimum_realizations_number=8
events=all
analyse-all-time=False
timeslides=False
ignore-gracedb-psd=True
threshold-snr=3


[condor]
{# paths to executables #}
{% for path in paths %}
{{ path.name }}={{ path.path }}
{% endfor %}

mpirun=mpirun
accounting_group={{ accounting_group  }}
accounting_group_user=soichiro.morisaki


[datafind]
url-type=file
types = {{ types | safe }}


[data]
channels = {{ channels | safe }}


[lalinference]
flow = {'H1': 20.0, 'L1': 20.0, 'V1': 20.0}


[engine]
fref=20
approx={{ approx }}
amporder=0
neff={{ neff }}
nlive=512
tolerance=0.1
ntemps=8
resume=
adapt-temps=
progress=
# The following calibration uncertainties are from
# https://wiki.ligo.org/LSC/JRPComm/O3PreparationER13
enable-spline-calibration=
H1-spcal-amp-uncertainty=0.05
L1-spcal-amp-uncertainty=0.1
V1-spcal-amp-uncertainty=0.15
H1-spcal-phase-uncertainty=2.86
L1-spcal-phase-uncertainty=5.73
V1-spcal-phase-uncertainty=2.86
{{ margphi }}


[mpi]
mpi_task_count=8
machine-count=8
machine-memory=4000


[skyarea]
maxpts=2000


[resultspage]
skyres=0.5


[bayeswave]
{# FIXME: We should use Bayeswave PSD with the following settings
in the future.
Niter=100000
Nchain=10
Nbayesline=20000
#}

[statevector]
state-vector-channel={{ state_vector_channels | safe }}

# Bits of state vector channel referred to. Use only data during the time when
# the following bits are active. The meaning of each bit is summarized in
# https://wiki.ligo.org/Calibration/TDCalibReview and
# https://dcc.ligo.org/cgi-bin/private/DocDB/ShowDocument?docid=G1801125&version= .
# The most important bits for PE are
# Bit 0: HOFT_OK: h(t) was successfully computed
# Bit 1: OBSERVATION_INTENT: "observation intent" button is pushed
# Bit 2: OBSERVATION_READY: observation ready data is available
bits=['Bit 0', 'Bit 1', 'Bit 2']


[ppanalysis]


[singularity]


[ligo-skymap-from-samples]
enable-multiresolution=


[ligo-skymap-plot]
