FindJumpAnalyzer

class dias.analyzers.FindJumpAnalyzer(name, write_dir, state_dir)

Bases: dias.chime_analyzer.CHIMEAnalyzer

Finds jumps or steps in the autocorrelations.

Searches the autocorrelation of each input at some (user specified) subset of frequencies for jumps or step-like features. Calculates the continuous wavelet transform of the autocorrelations using an asymmetric wavelet and then finds times that are local maxima of the modulus of the wavelet transform over a range of time scales. See “Singularity Detection and Processing with Wavelets” by Stephane Mallat and Wen Liang Hwang for more information.

DocLib 788 describes this analyzer and the associated theremin graph.

Attributes:
archive_data_dir
data_size_max
edge_buffer
freq_collapse
freq_high
freq_low
freq_physical
freq_step
ignore_point_sources
ignore_sun
input_threshold
instrument
log_level
log_scale
max_num_file
max_num_freq
max_scale
min_rise
min_scale
num_scale
offset
output_suffix
period
psigma_max
rain_window
search_span
start_time
state_size_max
threshold
transit_window
use_input_flag
wavelet_name

Methods

Finder(self[, acqs]) Get a ch_util Finder object.
add_data_metric(self, name[, description, …]) Add a gauge metric.
add_task_metric(self, metric_name[, …]) Add a gauge metric.
delete_callback(self, deleted_files) Tell the analyzer that files have been deleted after the task has run.
finish(self) Close connection to data index and archive index databases.
from_config(config, \*args, \*\*kwargs) Create a new instance with values loaded from config.
init_logger(self[, log_level_override]) Set up the logger.
load_rain(self, start_time, end_time) Query prometheus server for rainfall metrics.
read_config(self, config[, compare_keys, …]) Set all properties in this class from the supplied config.
refresh_archive_index(self) Remove expired rows from the archive index database.
refresh_data_index(self) Remove expired files from the data index database.
run(self) Run the analyzer.
setup(self) Set up the analyzer.
update_data_index(self, start, stop[, …]) Add row to data index database.

Construct the CHIME analyzer base class.

Parameters:
  • name (String) – The name of the task.
  • write_dir (String) – The path to write output data to.
  • state_dir (String) – The path to write state data to.
Attributes:
archive_data_dir
data_size_max
edge_buffer
freq_collapse
freq_high
freq_low
freq_physical
freq_step
ignore_point_sources
ignore_sun
input_threshold
instrument
log_level
log_scale
max_num_file
max_num_freq
max_scale
min_rise
min_scale
num_scale
offset
output_suffix
period
psigma_max
rain_window
search_span
start_time
state_size_max
threshold
transit_window
use_input_flag
wavelet_name

Methods

Finder(self[, acqs]) Get a ch_util Finder object.
add_data_metric(self, name[, description, …]) Add a gauge metric.
add_task_metric(self, metric_name[, …]) Add a gauge metric.
delete_callback(self, deleted_files) Tell the analyzer that files have been deleted after the task has run.
finish(self) Close connection to data index and archive index databases.
from_config(config, \*args, \*\*kwargs) Create a new instance with values loaded from config.
init_logger(self[, log_level_override]) Set up the logger.
load_rain(self, start_time, end_time) Query prometheus server for rainfall metrics.
read_config(self, config[, compare_keys, …]) Set all properties in this class from the supplied config.
refresh_archive_index(self) Remove expired rows from the archive index database.
refresh_data_index(self) Remove expired files from the data index database.
run(self) Run the analyzer.
setup(self) Set up the analyzer.
update_data_index(self, start, stop[, …]) Add row to data index database.

Attributes Summary

edge_buffer
freq_collapse
freq_high
freq_low
freq_physical
freq_step
ignore_point_sources
ignore_sun
input_threshold
instrument
log_scale
max_num_file
max_num_freq
max_scale
min_rise
min_scale
num_scale
offset
output_suffix
psigma_max
rain_window
search_span
threshold
transit_window
use_input_flag
wavelet_name

Methods Summary

finish(self) Close connection to data index and archive index databases.
load_rain(self, start_time, end_time) Query prometheus server for rainfall metrics.
refresh_archive_index(self) Remove expired rows from the archive index database.
refresh_data_index(self) Remove expired files from the data index database.
run(self) Run the analyzer.
setup(self) Set up the analyzer.
update_data_index(self, start, stop[, …]) Add row to data index database.

Attributes Documentation

edge_buffer = None
freq_collapse = None
freq_high = None
freq_low = None
freq_physical = None
freq_step = None
ignore_point_sources = None
ignore_sun = None
input_threshold = None
instrument = None
log_scale = None
max_num_file = None
max_num_freq = None
max_scale = None
min_rise = None
min_scale = None
num_scale = None
offset = None
output_suffix = None
psigma_max = None
rain_window = None
search_span = None
threshold = None
transit_window = None
use_input_flag = None
wavelet_name = None

Methods Documentation

finish(self)

Close connection to data index and archive index databases.

load_rain(self, start_time, end_time)

Query prometheus server for rainfall metrics.

Parameters:
  • start_time (datetime.datetime) – Load all data after this datetime (in UTC).
  • end_time (datetime.datetime) – Load all data before this datetime (in UTC).
Returns:

output (dict) – Dictionary containing a ‘time’ and ‘accum’ key that provide the unix timestamp and accumulated rain fall in millimeters between that timestamp and rain_window hours before that timestamp.

refresh_archive_index(self)

Remove expired rows from the archive index database.

Remove any rows of the archive index database that correspond to files that have been cleaned (removed) by arclink. This has to be done by the analzer since full time coverage autocorrelation data is not archived or registered in alpenhorn.

refresh_data_index(self)

Remove expired files from the data index database.

Find rows of the data index database that correspond to files that have been cleaned (removed) by dias manager. Replace the filename with None.

run(self)

Run the analyzer.

Load autocorrelations from the last period. Loop over frequencies and inputs and find jumps. Write locations and snapshots of the jumps to disk.

setup(self)

Set up the analyzer.

Create connection to data index database and archive index database. Initialize Prometheus metrics.

update_data_index(self, start, stop, njump=0, filename=None)

Add row to data index database.

Update the data index database with a row that contains a span of time, the number of jumps found during that time, and the relative path to the output file that contains information on the jumps found.

Parameters:
  • start (unix time) – Earliest time processed.
  • stop (unix time) – Latest time processed.
  • njump (int) – Number of jumps found between start and stop.
  • filename (str or None) – Name of the file containing information on the jumps. If no jumps were found, then this will be set to None.