Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1"""GWCelery application configuration. 

2 

3This module defines configuration variables and default values, including both 

4:doc:`generic options for Celery <celery:userguide/configuration>` as well as 

5options that control the behavior of specific GWCelery :mod:`~gwcelery.tasks`. 

6 

7To override the configuration, define the ``CELERY_CONFIG_MODULE`` environment 

8variable to the fully qualified name of any Python module that can be located 

9in :obj:`sys.path`, including any of the following presets: 

10 

11 * :mod:`gwcelery.conf.development` 

12 * :mod:`gwcelery.conf.playground` (the default) 

13 * :mod:`gwcelery.conf.production` 

14 * :mod:`gwcelery.conf.test` 

15""" 

16 

17import getpass 

18import os 

19 

20# Celery application settings. 

21 

22# Task tombstones expire after 2 hours. 

23# Celery's default setting of 1 day could cause the Redis database to grow too 

24# large because we pass large byte strings as task arguments and return values. 

25result_expires = 7200 

26 

27# Use pickle serializer, because it supports byte values. 

28accept_content = ['json', 'pickle'] 

29event_serializer = 'json' 

30result_serializer = 'pickle' 

31task_serializer = 'pickle' 

32 

33# Compress tasks to reduce bandwidth in and out of Redis. 

34result_compression = task_compression = 'zstandard' 

35 

36# Task priority settings. 

37task_inherit_parent_priority = True 

38task_default_priority = 0 

39task_queue_max_priority = 1 

40broker_transport_options = { 

41 'priority_steps': list(range(task_queue_max_priority + 1)) 

42} 

43 

44worker_log_format = "[%(asctime)s: %(levelname)s/%(processName)s/%(threadName)s] %(message)s" # noqa: E501 

45"""Custom worker log format that includes the thread name.""" 

46 

47# GWCelery-specific settings. 

48 

49condor_accounting_group = 'ligo.dev.o3.cbc.pe.bayestar' 

50"""HTCondor accounting group for Celery workers launched with condor_submit.""" 

51 

52expose_to_public = False 

53"""Set to True if events meeting the public alert threshold really should be 

54exposed to the public.""" 

55 

56lvalert_host = 'lvalert-playground.cgca.uwm.edu' 

57"""LVAlert host.""" 

58 

59gracedb_host = 'gracedb-playground.ligo.org' 

60"""GraceDB host.""" 

61 

62voevent_broadcaster_address = ':5342' 

63"""The VOEvent broker will bind to this address to send GCNs. 

64This should be a string of the form `host:port`. If `host` is empty, 

65then listen on all available interfaces.""" 

66 

67voevent_broadcaster_whitelist = [] 

68"""List of hosts from which the broker will accept connections. 

69If empty, then completely disable the broker's broadcast capability.""" 

70 

71voevent_receiver_address = '68.169.57.253:8099' 

72"""The VOEvent listener will connect to this address to receive GCNs. For 

73options, see `GCN's list of available VOEvent servers 

74<https://gcn.gsfc.nasa.gov/voevent.html#tc2>`_. If this is an empty string, 

75then completely disable the GCN listener.""" 

76 

77email_host = 'imap.gmail.com' 

78"""IMAP hostname to receive the GCN e-mail notice formats.""" 

79 

80superevent_d_t_start = {'gstlal': 1.0, 

81 'spiir': 1.0, 

82 'pycbc': 1.0, 

83 'mbtaonline': 1.0} 

84"""Pipeline based lower extent of superevent segments. 

85For cwb and lib this is decided from extra attributes.""" 

86 

87superevent_d_t_end = {'gstlal': 1.0, 

88 'spiir': 1.0, 

89 'pycbc': 1.0, 

90 'mbtaonline': 1.0} 

91"""Pipeline based upper extent of superevent segments 

92For cwb and lib this is decided from extra attributes.""" 

93 

94superevent_query_d_t_start = 100. 

95"""Lower extent of superevents query""" 

96 

97superevent_query_d_t_end = 100. 

98"""Upper extent of superevents query""" 

99 

100superevent_default_d_t_start = 1.0 

101"""Default lower extent of superevent segments""" 

102 

103superevent_default_d_t_end = 1.0 

104"""Default upper extent for superevent segments""" 

105 

106superevent_far_threshold = 1 / 3600 

107"""Maximum false alarm rate to consider events superevents.""" 

108 

109preliminary_alert_timeout = 30.0 

110"""Wait this many seconds for the preferred event to stabilize before issuing a 

111preliminary alert.""" 

112 

113preliminary_alert_far_threshold = {'cbc': 1 / (60 * 86400), 

114 'burst': 1 / (365 * 86400), 

115 'test': 1 / (30 * 86400)} 

116"""Group specific maximum false alarm rate to consider 

117sending preliminary alerts.""" 

118 

119early_warning_alert_trials_factor = 2.0 

120"""Trials factor for early warning alerts. There are two pipelines that are 

121producing early warning events: gstlal and spiir.""" 

122 

123preliminary_alert_trials_factor = dict(cbc=5.0, burst=4.0) 

124"""Trials factor corresponding to trigger categories. For CBC and Burst, trials 

125factor is the number of pipelines. CBC pipelines are gstlal, pycbc, mbtaonline 

126and spiir. Burst searches are cwb.allsky, cwb.bbh and cwb.imbh.""" 

127 

128early_warning_alert_far_threshold = 1 / (3600 * 24) 

129"""False alarm rate threshold for early warning alerts.""" 

130 

131snews_gw_far_threshold = 1 / (3600 * 24) 

132"""Maximum false alarm rate for a superevent to send out a coincidence alert 

133between an external SNEWS alert and the superevent.""" 

134 

135superevent_clean_up_timeout = 270. 

136"""The orchestrator will wait this many seconds from the time of the 

137application of the GCN_PRELIM_SENT label to revise the preferred 

138event out of the accumulated events.""" 

139 

140subthreshold_annotation_timeout = 300. 

141"""The orchestrator will wait this many seconds from the time of the 

142creation of a new superevent to the time that subthreshold superevents 

143are annotated. It is expected that the timeout is long enough such 

144that there are no more G events being added to the superevent.""" 

145 

146pe_timeout = 345.0 

147"""The orchestrator will wait this many seconds from the time of the 

148creation of a new superevent to the time that parameter estimation begins, in 

149case the preferred event is updated with high latency.""" 

150 

151check_vector_prepost = {'gstlal': [2, 2], 

152 'spiir': [2, 2], 

153 'pycbc': [2, 2], 

154 'MBTAOnline': [2, 2], 

155 'oLIB': [1.5, 1.5], 

156 'LIB': [1.5, 1.5], 

157 'CWB': [1.5, 1.5], 

158 'HardwareInjection': [2, 2], 

159 'Swift': [2, 2], 

160 'Fermi': [2, 2], 

161 'INTEGRAL': [2, 2], 

162 'AGILE': [2, 2], 

163 'SNEWS': [10, 10]} 

164"""Seconds before and after the superevent start and end times which the DQ 

165vector check will include in its check. Pipeline dependent.""" 

166 

167uses_gatedhoft = {'gstlal': True, 

168 'spiir': True, 

169 'pycbc': True, 

170 'MBTAOnline': True, 

171 'oLIB': False, 

172 'LIB': False, 

173 'CWB': True, 

174 'HardwareInjection': False, 

175 'Swift': False, 

176 'Fermi': False, 

177 'INTEGRAL': False, 

178 'AGILE': False, 

179 'SNEWS': False} 

180"""Whether or not a pipeline uses gated h(t). Determines whether or not 

181the DMT-DQ_VECTOR will be analyzed for data quality.""" 

182 

183llhoft_glob = '/dev/shm/kafka/{detector}_O3/*.gwf' 

184"""File glob for playground low-latency h(t) frames. Currently points 

185to O3 replay data.""" 

186 

187llhoft_channels = { 

188 'H1:DMT-DQ_VECTOR': 'dmt_dq_vector_bits', 

189 'L1:DMT-DQ_VECTOR': 'dmt_dq_vector_bits', 

190 'H1:GDS-CALIB_STATE_VECTOR': 'ligo_state_vector_bits', 

191 'L1:GDS-CALIB_STATE_VECTOR': 'ligo_state_vector_bits', 

192 'V1:DQ_ANALYSIS_STATE_VECTOR': 'virgo_state_vector_bits'} 

193"""Low-latency h(t) state vector configuration. This is a dictionary consisting 

194of a channel and its bitmask, as defined in :mod:`gwcelery.tasks.detchar`.""" 

195 

196idq_channels = ['H1:IDQ-PGLITCH_OVL_16_4096', 

197 'L1:IDQ-PGLITCH_OVL_16_4096'] 

198"""Low-latency iDQ p(glitch) channel names from O3 replay.""" 

199 

200idq_pglitch_thresh = 0.95 

201"""If P(Glitch) is above this threshold, and 

202:obj:`~gwcelery.conf.idq_veto` for the pipeline is true, DQV will be labeled 

203for the event. 

204""" 

205 

206idq_veto = {'gstlal': False, 

207 'spiir': False, 

208 'pycbc': False, 

209 'MBTAOnline': False, 

210 'oLIB': False, 

211 'LIB': False, 

212 'CWB': False, 

213 'HardwareInjection': False, 

214 'Swift': False, 

215 'Fermi': False, 

216 'INTEGRAL': False, 

217 'AGILE': False, 

218 'SNEWS': False} 

219"""If true for a pipeline, iDQ values above the threshold defined in 

220:obj:`~gwcelery.conf.idq_pglitch.thres` will cause DQV to be labeled. 

221Currently all False, pending iDQ review (should be done before O3). 

222""" 

223 

224low_latency_frame_types = {'H1': 'H1_O3_llhoft', 

225 'L1': 'L1_O3_llhoft', 

226 'V1': 'V1_O3_llhoft'} 

227"""Types of low latency frames used in Parameter Estimation (see 

228:mod:`gwcelery.tasks.inference`) and in cache creation for detchar 

229checks (see :mod:`gwcelery.tasks.detchar`). 

230""" 

231 

232high_latency_frame_types = {'H1': None, 

233 'L1': None, 

234 'V1': None} 

235"""Types of high latency frames used in Parameter Estimation and in cache 

236creation for detchar checks. They do not exist for O3Replay data. (see 

237:mod:`gwcelery.tasks.inference` and :mod:`gwcelery.tasks.detchar`) 

238""" 

239 

240strain_channel_names = {'H1': 'H1:GDS-CALIB_STRAIN_O3Replay', 

241 'L1': 'L1:GDS-CALIB_STRAIN_O3Replay', 

242 'V1': 'V1:Hrec_hoft_16384Hz_O3Replay'} 

243"""Names of h(t) channels used in Parameter Estimation (see 

244:mod:`gwcelery.tasks.inference`) and in detchar omegascan creation 

245(see :mod:`gwcelery.tasks.detchar`).""" 

246 

247state_vector_channel_names = {'H1': 'H1:GDS-CALIB_STATE_VECTOR', 

248 'L1': 'L1:GDS-CALIB_STATE_VECTOR', 

249 'V1': 'V1:DQ_ANALYSIS_STATE_VECTOR'} 

250"""Names of state vector channels used in Parameter Estimation (see 

251:mod:`gwcelery.tasks.inference`)""" 

252 

253detchar_bit_definitions = { 

254 'dmt_dq_vector_bits': { 

255 'channel': 'DMT-DQ_VECTOR', 

256 'bits': { 

257 1: 'NO_OMC_DCPD_ADC_OVERFLOW', 

258 2: 'NO_DMT-ETMY_ESD_DAC_OVERFLOW' 

259 }, 

260 'description': { 

261 'NO_OMC_DCPD_ADC_OVERFLOW': 'OMC DCPC ADC not overflowing', 

262 'NO_DMT-ETMY_ESD_DAC_OVERFLOW': 'ETMY ESD DAC not overflowing' 

263 } 

264 }, 

265 'ligo_state_vector_bits': { 

266 'channel': 'GDS-CALIB_STATE_VECTOR', 

267 'bits': { 

268 0: 'HOFT_OK', 

269 1: 'OBSERVATION_INTENT', 

270 5: 'NO_STOCH_HW_INJ', 

271 6: 'NO_CBC_HW_INJ', 

272 7: 'NO_BURST_HW_INJ', 

273 8: 'NO_DETCHAR_HW_INJ' 

274 }, 

275 'description': { 

276 'HOFT_OK': 'h(t) was successfully computed', 

277 'OBSERVATION_INTENT': '"observation intent" button is pushed', 

278 'NO_STOCH_HW_INJ': 'No stochastic HW injection', 

279 'NO_CBC_HW_INJ': 'No CBC HW injection', 

280 'NO_BURST_HW_INJ': 'No burst HW injection', 

281 'NO_DETCHAR_HW_INJ': 'No HW injections for detector characterization' # noqa: E501 

282 } 

283 }, 

284 'virgo_state_vector_bits': { 

285 'channel': 'DQ_ANALYSIS_STATE_VECTOR', 

286 'bits': { 

287 0: 'HOFT_OK', 

288 1: 'OBSERVATION_INTENT', 

289 5: 'NO_STOCH_HW_INJ', 

290 6: 'NO_CBC_HW_INJ', 

291 7: 'NO_BURST_HW_INJ', 

292 8: 'NO_DETCHAR_HW_INJ', 

293 10: 'GOOD_DATA_QUALITY_CAT1' 

294 }, 

295 'description': { 

296 'HOFT_OK': 'h(t) was successfully computed', 

297 'OBSERVATION_INTENT': '"observation intent" button is pushed', 

298 'NO_STOCH_HW_INJ': 'No stochastic HW injection', 

299 'NO_CBC_HW_INJ': 'No CBC HW injection', 

300 'NO_BURST_HW_INJ': 'No burst HW injection', 

301 'NO_DETCHAR_HW_INJ': 'No HW injections for detector characterization', # noqa: E501 

302 'GOOD_DATA_QUALITY_CAT1': 'Good data quality (CAT1 type)' 

303 } 

304 } 

305} 

306"""Bit definitions for detchar checks""" 

307 

308omegascan_durations = [0.5, 2.0, 10.0] 

309"""Durations for omegascans, symmetric about t0""" 

310 

311pe_results_path = os.path.join(os.getenv('HOME'), 'public_html/online_pe') 

312"""Path to the results of Parameter Estimation (see 

313:mod:`gwcelery.tasks.inference`)""" 

314 

315pe_results_url = ('https://ldas-jobs.ligo.caltech.edu/~{}/' 

316 'online_pe/').format(getpass.getuser()) 

317"""URL of page where all the results of Parameter Estimation are outputted 

318(see :mod:`gwcelery.tasks.inference`)""" 

319 

320raven_coincidence_windows = {'GRB_CBC': [-5, 1], 

321 'GRB_CBC_SubFermi': [-11, 1], 

322 'GRB_CBC_SubSwift': [-20, 10], 

323 'GRB_Burst': [-600, 60], 

324 'SNEWS': [-10, 10]} 

325"""Time coincidence windows passed to ligo-raven. External events and 

326superevents of the appropriate type are considered to be coincident if 

327within time window of each other.""" 

328 

329mock_events_simulate_multiple_uploads = False 

330"""If True, then upload each mock event several times in rapid succession with 

331random jitter in order to simulate multiple pipeline uploads.""" 

332 

333only_alert_for_mdc = False 

334"""If True, then only sends alerts for MDC events. Useful for times outside 

335of observing runs.""" 

336 

337# Delete imported modules so that they do not pollute the config object 

338del os, getpass