Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • iain.morton/locklost
  • oli.patane/locklost-olifork
  • timothy.ohanlon/locklost
  • benjaminrobert.mannix/locklost
  • austin.jennings/locklost
  • camilla.compton/locklost
  • arnaud.pele/locklost
  • yamamoto/locklost
  • marc.lormand/locklost
  • saravanan.tiruppatturrajamanikkam/locklost
  • nikhil-mukund/locklost
  • patrick.godwin/locklost
  • yannick.lecoeuche/locklost
  • jameson.rollins/locklost
14 results
Show changes
Showing
with 1082 additions and 211 deletions
This diff is collapsed.
import numpy as np
from gwpy.segments import Segment
from .. import logger
from .. import config
from .. import data
##############################################
def check_soft_limiters(event):
"""Checks if ASC limits are reached for Pitch and Yaw and creates a tag if railed.
"""
if config.IFO == 'L1':
logger.info("followup is not configured or not applicable to LLO.")
return
mod_window = [config.SOFT_SEARCH_WINDOW[0], config.SOFT_SEARCH_WINDOW[1]]
segment = Segment(mod_window).shift(int(event.gps))
data_collect = data.fetch(config.ASC, segment, as_dict=True)
# collects all ASC data for analysis
soft_limits = False
ASC_INMON = [val.data for key, val in data_collect.items() if key in config.ASC_INMON]
# ASC raw input signal
ASC_LIMIT = [val.data for key, val in data_collect.items() if key in config.ASC_LIMIT]
# ASC soft loop limits
ASC_ENABLE = [val.data for key, val in data_collect.items() if key in config.ASC_ENABLE]
# ASC soft loop switch
inputs = [max(i) for i in ASC_INMON]
# pull inmon channels into a list
inputs_max = [max(i) for i in ASC_LIMIT]
# pull threshold values
switch = [max(i) for i in ASC_ENABLE]
# pull toggle values
finallist = []
abs_set_diff = np.abs(inputs)
# take absolute value
sub = np.subtract(abs_set_diff, inputs_max)
# subtract array from limits, if array > 0 it is railed
sub = sub.tolist()
finallist.append(sub)
for el, s in zip(finallist[0], switch):
if el > 0 and s == 1:
soft_limits = True
logger.info('{} is railed.'.format(config.ASC_INMON[finallist[0].index(el)]))
break
if soft_limits:
event.add_tag('SOFT_LIMITERS')
else:
logger.info('No ASC channel hit its soft limit.')
This diff is collapsed.
import os
import logging
import numpy as np
import matplotlib.pyplot as plt
from gwpy.segments import Segment
from .. import logger
from .. import config
from .. import data
from .. import plotutils
##############################################
def check_wind(event):
"""Checks for elevated windspeed.
......@@ -40,9 +41,9 @@ def check_wind(event):
if windy:
event.add_tag('WINDY')
else:
logging.info("wind speed below threshold")
logger.info("wind speed below threshold")
fig, ax = plt.subplots(1, figsize=(22,16))
fig, ax = plt.subplots(1, figsize=(22, 16))
for buf in wind_channels:
srate = buf.sample_rate
t = np.arange(segment[0], segment[1], 1/srate)
......@@ -66,7 +67,7 @@ def check_wind(event):
ax.grid()
ax.set_xlabel('Time [s] since lock loss at {}'.format(event.gps), labelpad=10)
ax.set_ylabel('Velocity [mph]')
ax.set_ylim(0, max_windspeed+1)
# ax.set_ylim(0, max_windspeed+1)
ax.set_xlim(t[0]-event.gps, t[-1]-event.gps)
ax.legend(loc='best')
ax.set_title('End/corner station wind speeds', y=1.04)
......
This diff is collapsed.
import os
import shutil
import logging
from gwpy.segments import Segment, SegmentList
from . import logger
def load_segments(segdir, intersect=None):
"""Load segments from directory
......@@ -16,7 +17,7 @@ def load_segments(segdir, intersect=None):
for i, sf in enumerate(os.listdir(segdir)):
s, e = map(int, sf.split('-'))
seglist.append(Segment(s, e))
logging.debug("{} segments loaded".format(i+1))
logger.debug("{} segments loaded".format(i+1))
return seglist.coalesce()
......@@ -66,16 +67,14 @@ def compress_segdir(segdir):
"""
if not os.path.exists(segdir):
#raise RuntimeError("segdir does not exist")
logging.warning("segdir does not exist")
logger.warning("segdir does not exist")
return
tmpdir = segdir+'.tmp'
if os.path.exists(tmpdir):
#raise RuntimeError("segdir compression in progress")
logging.warning("segdir compression in progress, skipping")
logger.warning("segdir compression in progress, skipping")
return
logging.info("compressing segdir: {}".format(segdir))
logger.info("compressing segdir: {}".format(segdir))
shutil.move(segdir, tmpdir)
n = write_segments(segdir, load_segments(tmpdir))
logging.debug("{} segments written".format(n))
logger.debug("{} segments written".format(n))
shutil.rmtree(tmpdir)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
% rebase('base.tpl', IFO=IFO, web_script=web_script, online_status=online_status, is_home=is_home)
% import os
% from locklost import config
<h4>Summary Plots: {{epoch}}</h4>
% for id in [epoch]:
<div id={{id}} class="tabcontent">
% plot_dir = os.path.join(config.SUMMARY_ROOT, id)
% for plotname in os.listdir(plot_dir):
% plot_url = os.path.join(config.WEB_ROOT, 'summary', id, plotname)
% include('plots.tpl', plots=[plot_url], size=8)
% end
</div>
% end
This diff is collapsed.
[flake8]
ignore = E226,E501
exclude = locklost/plugins/__init__.py
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.