utils#
Back to API tree index
Purpose#
Cross-cutting utility functions and run/path helpers.
Module summary#
No module-level description available.
Function |
Summary |
|---|---|
No docstring summary available. |
|
No docstring summary available. |
|
Joins blocks together if they are separated by less than n_tol |
|
Creates desired filter, and computes its impulse response length |
|
No docstring summary available. |
|
No docstring summary available. |
|
No docstring summary available. |
|
Converts a conditioned filter to a different time array by zero-padding in time-domain |
|
Converts a conditioned filter to a different time array by zero-padding in time-domain |
|
No docstring summary available. |
|
Combine H1 terms from scores_vetoed_max, returns scalar for single element |
|
No docstring summary available. |
|
Compute support, weight, and truncate input frequency domain filter |
|
Compute support, weight, and truncate input time domain filter |
|
Reads the names of all subdirectories, and creates a dictionary of dictionaries, with the outer dictionary having chirp mass ids as keys and the inner dictionary having subbank ids as keys and subdirectory names as values |
|
Convenience function to prune some leaves from a hdf5 file |
|
Creates text snippet to be added before submitting jobs to clusters |
|
Extracts the filename from a string representation of a buffer object |
|
Extracts the parts of the directory name based on the prefix and suffix |
|
Finds the closest associated coarse calphas to given fine calphas |
|
No docstring summary available. |
|
Assumes that the file names go like “Det-Detn-….” where Detn is the key |
|
Gives a list of length n_runs with each entry being a dictionary of dictionaries with the outer dictionary having chirp mass ids as keys and the inner dictionary having subbank ids as keys and subdirectory names as values. Figures out the number of subbanks and chirp mass ids by itself |
|
No docstring summary available. |
|
No docstring summary available. |
|
No docstring summary available. |
|
Returns a hdf5 file object with the given mode, given a source. Warning, if the file is already open in read-only mode, we can’t return a writeable version. |
|
No docstring summary available. |
|
No docstring summary available. |
|
TODO: What if we choose a different fmax? Assumes that the file names go like “Det-Detn-….” where Detn is the detector key |
|
No docstring summary available. |
|
No docstring summary available. |
|
Returns a PESummary object to interact with the LSC PE samples |
|
Gets root directories by run, used since O3a is on scratch |
|
Returns the run name for a given GPS time |
|
Function used to dechirp Gets a trigger in the format of trigger, bank_id |
|
Returns the strain file names given a time |
|
No docstring summary available. |
|
No docstring summary available. |
|
No docstring summary available. |
|
No docstring summary available. |
|
No docstring summary available. |
|
No docstring summary available. |
|
Function that decides which indices to include in the average such that we always average window_size indices to avoid \`regression-to-mean’ artifacts due to fewer samples near holes |
|
get log-log interpolant of ASD with old_f[0] >= 0, |
|
get log-log interpolant of amp & lin of phase with old_f[0] >= 0, |
|
Check if a GPS time is in a given run, works with HM/non-standard runs |
|
No docstring summary available. |
|
Take two gps times t1 and t2 and return: 0 if the hole chunk from t1 to t2 is invalid 1 if it is partially valid 2 if it is fully valid where valid means that both H and L have all the [‘DATA’, ‘CBC_CAT1’, ‘CBC_CAT2’, ‘CBC_CAT3’] flags True. (e.g. for assessing whether a waveform between t1 and t2 had the right to be found or not) |
|
No docstring summary available. |
|
Loads a dictionary from the attributes of a hdf5 file |
|
I need to do some monkey patching to make it work on my machine |
|
complete m1, m2, mt or check consistency if all given –> return m1, m2, mt |
|
No docstring summary available. |
|
Run this only once to make the file /data/bzackay/GW/LIGO_holes.npy |
|
No docstring summary available. |
|
No docstring summary available. |
|
Computes all conversions given a subset of parameters describing the masses |
|
Computes match, or cosine, between waveforms |
|
Memory mapping is much faster for single row access than non-chunked hdf5, as long as we have a 64 bit architecture It is slower for random access, as the kernel version on the IAS systems is older and doesn’t activate the madvise system call WARNING: If the hdf5 file is already open (e.g., in a writeable manner), the values in the mmap object might not be updated until the changes to the hdf5 file are flushed (despite the description of the dedault UNIX driver, it has a small buffer, set by rdcc_nbytes)! |
|
A shorthand function to apply multiprocessing in a one liner |
|
Creates notch filter |
|
Defines set of sos filters to apply to notch out lines |
|
Finds the amount to shift the detectors’ data streams by. It returns an integer multiple of dt_shift |
|
Function to compute orthogonalized scores to those in the L subset |
|
WARNING: this sees keys ‘chi1’ and ‘chi2’ as being the vector spins [sjx, sjy, sjz] \*UNLIKE\* in other places where chij = sqrt(sjx^2 + sjy^2 + sjz^2) complete intrinsic parameter dictionary from sufficient parts |
|
Make four-panel diagnostic plot for vetoes |
|
Decorator to populate magic methods for HDF5DatasetSubset, they enable us to interact with it like it’s a numpy array when needed |
|
No docstring summary available. |
|
No docstring summary available. |
|
Convenience function to read/create a group from a hdf5 file |
|
Removes elements of dat that are in the same bucket as in bad_time_list |
|
No docstring summary available. |
|
Utility to change the extension of a path |
|
\*NOTE\* this uses chia = (m1\*s1z - m2\*s2z) / (m1 + m2) |
|
No docstring summary available. |
|
No docstring summary available. |
|
Saves a dictionary to the attributes of a hdf5 file |
|
No docstring summary available. |
|
Computes sigma from median for an array with Gaussian samps + outliers Silently returns 1 if we passed in an empty array |
|
exact same as sinc_interp_by_factor_of_2() except along last axis of two dimensional array x2D |
|
Function to return time-domain sine-gaussian pulses (ready for FFT) |
|
Splits a single or multi-dimensional array into sub-arrays based on a coordinate |
|
Maintain consistency in run names, mainly used to confirm with the GWOSC naming conventions |
|
Track a multiprocessing job that was submitted in chunks |
|
Function to compute split scores - expectations from total score |
|
Convenience function to create/overwrite a leaf in a hdf5 file |
|
NOTE: azim = pi/2 - vphi |
|
NOTE: azim = pi/2 - vphi |
Class |
Summary |
|---|---|
No class docstring summary available. |
|
Custom h5py file object that wraps datasets with EditableHDF5Dataset on access |
|
Custom h5py group object that wraps datasets with EditableHDF5Dataset on access |
|
Wrapper of hdf5 dataset that returns references instead of copies when indexed if it is multidimensional or variable-length |
|
Simulates a copy-on-write reference to a subset of a multidimensional or variable-length HDF5 dataset. This is needed because by default, edits to a HDF5 dataset’s elements don’t propagate back to the underlying dataset |
|
No class docstring summary available. |
|
No class docstring summary available. |