Detectors package
Submodules
simple_pe.detectors.dets module
- class simple_pe.detectors.dets.Det(detector_name, horizon, f_mean, f_band, found_thresh=5.0, loc_thresh=4.0, duty_cycle=1.0, bns_range=True)[source]
Bases:
Detector
Class to hold the details of a detector
Parameters
- detector_name: str
2 character string for detector
- horizon: float
the BNS horizon of the detector
- f_mean: float
mean frequency
- f_band: float
frequency bandwidth
- found_thresh: float
threshold for declaring an event found
- loc_thresh: float
threshold for declaring an event localized
- duty_cycle: float
fraction of time the detector is operational
- bns_range: boolean
is the given range for BNS (if yes, then rescale SNR with mchirp^5/6)
- calculate_mirror_sensitivity(event)[source]
Calculate the sensitivity of the detector to an event, in its mirror sky location
Parameters
- event: even.Event
object, containing mirror_ra, mirror_dec, psi, gmst
- calculate_sensitivity(event)[source]
Calculate the sensitivity of the detector to an event
Parameters
- event: event.Event
object, containing ra, dec, psi, gmst
simple_pe.detectors.detectors module
- simple_pe.detectors.detectors.bandwidth(configuration)[source]
Provide the bandwidth for a set of detectors based upon the given configuration
Parameters
- configuration: str
the name of the network configuration
Returns
- bandwidth_dict: dict
dictionary of bandwidths for ifos in network
- simple_pe.detectors.detectors.calc_location_response(longitude, latitude, arms)[source]
Calculate the location and response for a detector with longitude, latitude in degrees The angle gives the orientation of the arms and is in degrees from North to East
Parameters
- longitude: float
the longitude
- latitude: float
the latitude
- arms: float
the angle between the arms
Returns
- location: np.array
the detector location
- response: np.array
the detector response
- simple_pe.detectors.detectors.detectors(ifos)[source]
Set up a dictionary of detector locations and responses.
Parameters
- ifos: list
a list of IFOs
Returns
- location: dict
a dictionary of detector locations
- response: dict
a dictionary of the detector responses
- simple_pe.detectors.detectors.fmean(configuration)[source]
Provide the mean frequency for a set of detectors based upon the given configuration
Parameters
- configuration: str
the name of the network configuration
Returns
- fmean_dict: dict
dictionary of mean frequencies for ifos in network
- simple_pe.detectors.detectors.phitheta(loc)[source]
return spherical co-ordinates for a given set of cartesian coordinates
Parameters
- loc: np.array
(x, y, z) locations
Returns
- phi: float
azimuthal angle
- theta:
inclination angle
- simple_pe.detectors.detectors.range_8(configuration)[source]
Provide the range for a set of detectors based upon the given configuration
Parameters
- configuration: str
the name of the network configuration
Returns
- range_dict: dict
dictionary of ranges for ifos in network
- simple_pe.detectors.detectors.sigma_t(configuration)[source]
return the timing accuracy. We use SNR of 10 in LIGO, but scale the expected SNR in other detectors based on the range. It’s just 1/(20 pi sigma_f for LIGO. But 1/(20 pi sigma_f)(r_ligo/r_virgo) for others ;
Parameters
- configuration: str
the name of the network configuration
Returns
- sigma_t_dict: dict
dictionary of timing accuracies for ifos in network
simple_pe.detectors.network module
- class simple_pe.detectors.network.Network(threshold=12.0)[source]
Bases:
object
Class to hold the details of the network.
Parameters
- threshold: float
detection threshold for the network
- add_ifo(ifo, horizon, f_mean, f_band, found_thresh=5.0, loc_thresh=4.0, duty_cycle=1.0, bns_range=True)[source]
Add an ifo to a network
Parameters
- ifo: str
name of ifo
- horizon: float
the BNS range of the detector
- f_mean: float
mean frequency
- f_band: float
frequency bandwidth
- found_thresh: float
threshold for declaring an event found
- loc_thresh: float
threshold for declaring an event localized
- duty_cycle: float
fraction of time the detector is operational
- bns_range: float
is the given range for BNS (if yes, then rescale SNR with chirp_mass^5/6)
- generate_network_from_psds(ifos, psds, f_lows, approximant='IMRPhenomD', found_thresh=5.0, loc_thresh=4.0, duty_cycle=1.0, bns_range=True)[source]
Generate a network from a list of ifos, with associated PSDs and f_lows
Parameters
- ifos: list
A list of ifos
- psds: dict
Dictionary of psds associated with the ifos
- f_lows: dict
Dictionary of low frequency cutoffs for each ifo
- approximant: str
approximant to use in waveform generation
- found_thresh: float
threshold for declaring an event found
- loc_thresh: float
threshold for declaring an event localized
- duty_cycle: float
fraction of time the detector is operational
- bns_range: bool
is the given range for BNS (if yes, then rescale SNR with chirp_mass^5/6)
- get_data(data)[source]
get the relevant data for each detector and return it as an array
Parameters
- data: str
name of data to return from a detector
Returns
- data_array: np.array
containing requested data
- set_configuration(configuration, found_thresh=5.0, loc_thresh=4.0, duty_cycle=1.0)[source]
set the details of the detectors based on the given configuration. data is stored in the detectors module
Parameters
- configuration: str
name of configuration
- found_thresh: float
threshold for single ifo detection
- loc_thresh: float
threshold for single ifo localization
- duty_cycle: float
fraction of time detectors are operational
simple_pe.detectors.noise_curves module
- simple_pe.detectors.noise_curves.calc_amp_info(amp, probs=None)[source]
Calculate the maximum amplitude and the ratios at the given probs
Parameters
- amp: np.array
Array of reported amplitudes
- probs: list
A list of probabilities at which to calculate relative amplitude
Returns
- amax: float
the maximum amplitude
- p_amp: dict
dictionary of relative amplitudes for each of the given probabilities
- simple_pe.detectors.noise_curves.calc_detector_horizon(mass1, mass2, spin1z, spin2z, psd, fmin, snr=8, waveform='IMRPhenomXHM')[source]
Calculate the horizon for a given PSD [in the detector frame] using only the (2, 2) mode. Note: the code doesn’t use the opening angle between detector arms, i.e. takes the maximum F+= 1.
Parameters
- mass1: float
the mass of the first component
- mass2: float
the mass of second component
- spin1z: float
the z-component of spin for first component
- spin2z: float
the z-component of spin for second component
- psd: pycbc.psd
the power spectrum to use
- fmin: float
the minimum frequency
- snr: float
the SNR at which to calculate the horizon
- waveform: str
the waveform used to calculate the horizon
Returns
- horizon: float
the horizon distance for the given system
- simple_pe.detectors.noise_curves.calc_mode_horizon(mass1, mass2, spin1z, spin2z, psd, fmin, snr=8, mode='22', waveform='IMRPhenomXHM')[source]
Calculate the horizon for a given PSD [in the detector frame] using only the (2, 2) mode. Note: the code doesn’t use the opening angle between detector arms, i.e. takes the maximum F+= 1. For the (2, 2) mode, we return the horizon for a face-on signal, for other modes we return the horizon for an edge-on system. [This is correct for most modes, but the (3, 3) has a slightly larger amplitude at a different inclination]
Parameters
- mass1: float
the mass of the first component
- mass2: float
the mass ratio of second component
- spin1z: float
the z-component of spin for first component
- spin2z: float
the z-component of spin for second component
- psd: pycbc.psd
the power spectrum to use
- fmin: float
the minimum frequency
- snr: float
the SNR at which to calculate the horizon
- mode: str
the mode for which to calculate horizon
- waveform: str
the waveform used to calculate the horizon
- triangle: bool
scale horizon for a triangular detector (True/False)
Returns
horizon: the higher mode horizon in detector frame for given masses and spin
- simple_pe.detectors.noise_curves.calc_orientation_factors(ntrials=1000000, modes=None, triangle=False)[source]
generate orientation factors for a set of samples located at random sky locations and random orientations
Parameters
- ntrials: int
the number of trials
- modes: list
a list of modes
- triangle: bool
L or triangle detector
Returns
- amp: dict
dictionary of arrays of amplitudes. One array with ntrials entries per mode
- simple_pe.detectors.noise_curves.calc_reach_bandwidth(masses, spin, approx, psd, fmin, thresh=8.0, mass_configuration='component')[source]
Calculate the horizon, mean frequency and bandwidth for a given PSD in the detector frame
Parameters
- masses: list
the masses of the binary. Can be component masses or chirp mass-symmetric mass ratio
- spin: float
the aligned spin for both components
- approx: str
the waveform used to calculate the horizon
- psd: pycbc.psd
the power spectrum to use
- fmin: float
the minimum frequency
- thresh: float
the SNR at which to calculate the horizon
- mass_configuration: str, optional
configuration of the binary masses. Must be either ‘component’ if masses contains the primary mass and secondary, or ‘chirp’ if masses contained the chirp mass and symmetric mass ratio
Returns
- max_dist: float
the horizon for the signal
- meanf: float
the mean frequency
- sigf: float
the frequency bandwidth
- simple_pe.detectors.noise_curves.generate_fplus_fcross_samples(ntrials=1000000, triangle=False)[source]
generate values of F+ and Fx for a set of ntrials samples located at random sky positions (uniformly over the sky)
Parameters
- ntrials: int
the number of trials
- triangle: bool
L or triangle detector
Returns
- f_plus: numpy.array
array of f_plus values
- f_cross: numpy.array
array of f_plus values
- simple_pe.detectors.noise_curves.interpolate_horizon(min_mass, max_mass, q, spin1z, spin2z, psd, fmin, snr=8, waveform='IMRPhenomXHM', npts=100)[source]
Generate an interpolation function for the horizon [in the detector frame] for a binary with total mass between min_mass and max_mass, with given mass ratio and spin from a frequency fmin in a detector with given psd Note: the code doesn’t use the opening angle between detector arms, i.e. takes the maximum F+= 1.
Parameters
- min_mass: float
the minimum total mass
- max_mass: float
the maximum total mass
- q: float
the mass ratio
- spin1z: float
the z-component of spin for first component
- spin2z: float
the z-component of spin for second component
- psd: pycbc.psd
the PSD used to calculate the horizon
- fmin: float
the minimum frequency
- snr: float
the SNR at which to calculate the horizon
- waveform: str
the waveform used to calculate the horizon
- npts: int
number of points to use in interpolation
Returns
- horizon_interp:
horizon interpolation function
- simple_pe.detectors.noise_curves.interpolate_mode_horizon(min_mass, max_mass, q, spin1z, spin2z, psd, fmin, snr=8, mode='22', waveform='IMRPhenomXHM', npts=100)[source]
Generate an interpolation function for the horizon [in the detector frame] for a binary with total mass between min_mass and max_mass, with given mass ratio and spin from a frequency fmin in a detector with given psd Note: the code doesn’t use the opening angle between detector arms, i.e. takes the maximum F+= 1.
Parameters
- min_mass: float
the minimum total mass
- max_mass: float
the maximum total mass
- q: float
the mass ratio
- spin1z: float
the z-component of spin for first component
- spin2z: float
the z-component of spin for second component
- psd: pycbc.psd
the power spectrum to use
- fmin: float
the minimum frequency
- snr: float
the SNR at which to calculate the horizon
- mode: str
the mode to calculate the horizon for
- waveform: str
the waveform used to calculate the horizon
- triangle: bool
scale horizon for a triangular detector (True/False)
- npts: int
number of points to use in interpolation
Returns
- horizon_interp:
horizon interpolation in detector frame for higher modes
- simple_pe.detectors.noise_curves.interpolate_source_horizon(min_mass, max_mass, hor_interp, snr_factor=1.0)[source]
Generate an interpolation function for the reach of the detector for a binary with total mass between min_mass and max_mass in the source frame, given the detector frame horizon. The SNR factor takes into account the difference in threshold between the horizon and requested contour (either through wanting a different SNR limit or through sky averaging)
Parameters
- min_mass: float
the minimum total mass
- max_mass: float
the maximum total mass
- hor_interp:
detector frame interpolator
- snr_factor: float
ratio between SNR for horizon and requested contour
Returns
- h_interp:
horizon interpolation in source frame