_id
stringlengths
2
7
title
stringlengths
1
88
partition
stringclasses
3 values
text
stringlengths
31
13.1k
language
stringclasses
1 value
meta_information
dict
q32000
BaseInferenceFile.copy_info
train
def copy_info(self, other, ignore=None): """Copies "info" from this file to the other. "Info" is defined all groups that are not the samples group. Parameters ---------- other : output file The output file. Must be an hdf file. ignore : (list of) str ...
python
{ "resource": "" }
q32001
BaseInferenceFile.copy_samples
train
def copy_samples(self, other, parameters=None, parameter_names=None, read_args=None, write_args=None): """Should copy samples to the other files. Parameters ---------- other : InferenceFile An open inference file to write to. parameters : list of...
python
{ "resource": "" }
q32002
BaseInferenceFile.copy
train
def copy(self, other, ignore=None, parameters=None, parameter_names=None, read_args=None, write_args=None): """Copies metadata, info, and samples in this file to another file. Parameters ---------- other : str or InferenceFile The file to write to. May be either...
python
{ "resource": "" }
q32003
BaseInferenceFile.write_kwargs_to_attrs
train
def write_kwargs_to_attrs(cls, attrs, **kwargs): """Writes the given keywords to the given ``attrs``. If any keyword argument points to a dict, the keyword will point to a list of the dict's keys. Each key is then written to the attrs with its corresponding value. Parameters ...
python
{ "resource": "" }
q32004
ceilpow2
train
def ceilpow2(n): """convenience function to determine a power-of-2 upper frequency limit""" signif,exponent = frexp(n) if (signif < 0):
python
{ "resource": "" }
q32005
coalign_waveforms
train
def coalign_waveforms(h1, h2, psd=None, low_frequency_cutoff=None, high_frequency_cutoff=None, resize=True): """ Return two time series which are aligned in time and phase. The alignment is only to the nearest sample point and all changes to the...
python
{ "resource": "" }
q32006
phase_from_frequencyseries
train
def phase_from_frequencyseries(htilde, remove_start_phase=True): """Returns the phase from the given frequency-domain waveform. This assumes that the waveform has been sampled finely enough that the phase cannot change by more than pi radians between each step. Parameters ---------- htilde : Fr...
python
{ "resource": "" }
q32007
amplitude_from_frequencyseries
train
def amplitude_from_frequencyseries(htilde): """Returns the amplitude of the given frequency-domain waveform as a FrequencySeries. Parameters ---------- htilde : FrequencySeries The waveform to get the amplitude of. Returns ------- FrequencySeries The amplitude of the wa...
python
{ "resource": "" }
q32008
time_from_frequencyseries
train
def time_from_frequencyseries(htilde, sample_frequencies=None, discont_threshold=0.99*numpy.pi): """Computes time as a function of frequency from the given frequency-domain waveform. This assumes the stationary phase approximation. Any frequencies lower than the first non-zero value in htilde ar...
python
{ "resource": "" }
q32009
phase_from_polarizations
train
def phase_from_polarizations(h_plus, h_cross, remove_start_phase=True): """Return gravitational wave phase Return the gravitation-wave phase from the h_plus and h_cross polarizations of the waveform. The returned phase is always positive and increasing with an initial phase of 0. Parameters --...
python
{ "resource": "" }
q32010
amplitude_from_polarizations
train
def amplitude_from_polarizations(h_plus, h_cross): """Return gravitational wave amplitude Return the gravitation-wave amplitude from the h_plus and h_cross polarizations of the waveform. Parameters ---------- h_plus : TimeSeries An PyCBC TmeSeries vector that contains the plus polariza...
python
{ "resource": "" }
q32011
frequency_from_polarizations
train
def frequency_from_polarizations(h_plus, h_cross): """Return gravitational wave frequency Return the gravitation-wave frequency as a function of time from the h_plus and h_cross polarizations of the waveform. It is 1 bin shorter than the input vectors and the sample times are advanced half a bin. ...
python
{ "resource": "" }
q32012
taper_timeseries
train
def taper_timeseries(tsdata, tapermethod=None, return_lal=False): """ Taper either or both ends of a time series using wrapped LALSimulation functions Parameters ---------- tsdata : TimeSeries Series to be tapered, dtype must be either float32 or float64 tapermethod : string ...
python
{ "resource": "" }
q32013
apply_fd_time_shift
train
def apply_fd_time_shift(htilde, shifttime, kmin=0, fseries=None, copy=True): """Shifts a frequency domain waveform in time. The shift applied is shiftime - htilde.epoch. Parameters ---------- htilde : FrequencySeries The waveform frequency series. shifttime : float The time to s...
python
{ "resource": "" }
q32014
td_taper
train
def td_taper(out, start, end, beta=8, side='left'): """Applies a taper to the given TimeSeries. A half-kaiser window is used for the roll-off. Parameters ---------- out : TimeSeries The ``TimeSeries`` to taper. start : float The time (in s) to start the taper window. end :...
python
{ "resource": "" }
q32015
fd_taper
train
def fd_taper(out, start, end, beta=8, side='left'): """Applies a taper to the given FrequencySeries. A half-kaiser window is used for the roll-off. Parameters ---------- out : FrequencySeries The ``FrequencySeries`` to taper. start : float The frequency (in Hz) to start the tap...
python
{ "resource": "" }
q32016
fd_to_td
train
def fd_to_td(htilde, delta_t=None, left_window=None, right_window=None, left_beta=8, right_beta=8): """Converts a FD waveform to TD. A window can optionally be applied using ``fd_taper`` to the left or right side of the waveform before being converted to the time domain. Parameters -----...
python
{ "resource": "" }
q32017
ParameterList.docstr
train
def docstr(self, prefix='', include_label=True): """Returns the ``docstr`` of each parameter joined together."""
python
{ "resource": "" }
q32018
hist_overflow
train
def hist_overflow(val, val_max, **kwds): """ Make a histogram with an overflow bar above val_max """ import pylab, numpy overflow = len(val[val>=val_max]) pylab.hist(val[val<val_max], **kwds) if 'color' in kwds: color = kwds['color'] else: color =
python
{ "resource": "" }
q32019
setup_psd_workflow
train
def setup_psd_workflow(workflow, science_segs, datafind_outs, output_dir=None, tags=None): ''' Setup static psd section of CBC workflow. At present this only supports pregenerated psd files, in the future these could be created within the workflow. Parameters ----------...
python
{ "resource": "" }
q32020
generate_inverse_mapping
train
def generate_inverse_mapping(order): """Genereate a lambda entry -> PN order map. This function will generate the opposite of generate mapping. So where generate_mapping gives dict[key] = item this will give dict[item] = key. Valid PN orders are: {} Parameters ---------- order : string...
python
{ "resource": "" }
q32021
ethinca_order_from_string
train
def ethinca_order_from_string(order): """ Returns the integer giving twice the post-Newtonian order used by the ethinca calculation. Currently valid only for TaylorF2 metric Parameters ---------- order : string Returns ------- int """ if order in get_ethinca_orders().keys()...
python
{ "resource": "" }
q32022
compile
train
def compile(source, name): """ Compile the string source code into a shared object linked against the static version of cufft for callback support. """ cache = os.path.join(pycbc._cache_dir_path, name) hash_file = cache + ".hash" lib_file = cache + ".so" obj_file = cache + ".o" try: ...
python
{ "resource": "" }
q32023
get_fn_plan
train
def get_fn_plan(callback=None, out_callback=None, name='pycbc_cufft', parameters=None): """ Get the IFFT execute and plan functions """ if parameters is None: parameters = [] source = fftsrc.render(input_callback=callback, output_callback=out_callback, parameters=parameters) path = compile(s...
python
{ "resource": "" }
q32024
determine_eigen_directions
train
def determine_eigen_directions(metricParams, preserveMoments=False, vary_fmax=False, vary_density=None): """ This function will calculate the coordinate transfomations that are needed to rotate from a coordinate system described by the various Lambda components in the freq...
python
{ "resource": "" }
q32025
interpolate_psd
train
def interpolate_psd(psd_f, psd_amp, deltaF): """ Function to interpolate a PSD to a different value of deltaF. Uses linear interpolation. Parameters ---------- psd_f : numpy.array or list or similar List of the frequencies contained within the PSD. psd_amp : numpy.array or list or s...
python
{ "resource": "" }
q32026
calculate_moment
train
def calculate_moment(psd_f, psd_amp, fmin, fmax, f0, funct, norm=None, vary_fmax=False, vary_density=None): """ Function for calculating one of the integrals used to construct a template bank placement metric. The integral calculated will be \int funct(x) * (psd_x)**(-7./3.) * delt...
python
{ "resource": "" }
q32027
calculate_metric
train
def calculate_metric(Js, logJs, loglogJs, logloglogJs, loglogloglogJs, \ mapping): """ This function will take the various integrals calculated by get_moments and convert this into a metric for the appropriate parameter space. Parameters ----------- Js : Dictionary ...
python
{ "resource": "" }
q32028
bank_bins_from_cli
train
def bank_bins_from_cli(opts): """ Parses the CLI options related to binning templates in the bank. Parameters ---------- opts : object Result of parsing the CLI with OptionParser. Results ------- bins_idx : dict A dict with bin names as key and an array of their indices as ...
python
{ "resource": "" }
q32029
get_found_param
train
def get_found_param(injfile, bankfile, trigfile, param, ifo, args=None): """ Translates some popular trigger parameters into functions that calculate them from an hdf found injection file Parameters ---------- injfile: hdf5 File object Injection file of format known to ANitz (DOCUMENTME...
python
{ "resource": "" }
q32030
get_inj_param
train
def get_inj_param(injfile, param, ifo, args=None): """ Translates some popular injection parameters into functions that calculate them from an hdf found injection file Parameters ---------- injfile: hdf5 File object Injection file of format known to ANitz (DOCUMENTME) param: string ...
python
{ "resource": "" }
q32031
ns_g_mass_to_ns_b_mass
train
def ns_g_mass_to_ns_b_mass(ns_g_mass, ns_sequence): """ Determines the baryonic mass of an NS given its gravitational mass and an NS equilibrium sequence. Parameters ----------- ns_g_mass: float NS gravitational mass (in solar masses) ns_sequence: 3D-array
python
{ "resource": "" }
q32032
low_frequency_cutoff_from_cli
train
def low_frequency_cutoff_from_cli(opts): """Parses the low frequency cutoff from the given options. Returns ------- dict Dictionary of instruments -> low frequency cutoff. """ # FIXME: this just uses the
python
{ "resource": "" }
q32033
data_from_cli
train
def data_from_cli(opts): """Loads the data needed for a model from the given command-line options. Gates specifed on the command line are also applied. Parameters ---------- opts : ArgumentParser parsed args Argument options parsed from a command line string (the sort of thing retur...
python
{ "resource": "" }
q32034
add_plot_posterior_option_group
train
def add_plot_posterior_option_group(parser): """Adds the options needed to configure plots of posterior results. Parameters ---------- parser : object ArgumentParser instance. """ pgroup = parser.add_argument_group("Options for what plots to create and " ...
python
{ "resource": "" }
q32035
plot_ranges_from_cli
train
def plot_ranges_from_cli(opts): """Parses the mins and maxs arguments from the `plot_posterior` option group. Parameters ---------- opts : ArgumentParser The parsed arguments from the command line. Returns ------- mins : dict Dictionary of parameter name -> specified mi...
python
{ "resource": "" }
q32036
add_scatter_option_group
train
def add_scatter_option_group(parser): """Adds the options needed to configure scatter plots. Parameters ---------- parser : object ArgumentParser instance. """ scatter_group = parser.add_argument_group("Options for configuring the " "scatter...
python
{ "resource": "" }
q32037
add_density_option_group
train
def add_density_option_group(parser): """Adds the options needed to configure contours and density colour map. Parameters ---------- parser : object ArgumentParser instance. """ density_group = parser.add_argument_group("Options for configuring the " ...
python
{ "resource": "" }
q32038
prior_from_config
train
def prior_from_config(cp, prior_section='prior'): """Loads a prior distribution from the given config file. Parameters ---------- cp : pycbc.workflow.WorkflowConfigParser The config file to read. sections : list of str, optional The sections to retrieve the prior from. If ``None`` (...
python
{ "resource": "" }
q32039
compute_search_efficiency_in_bins
train
def compute_search_efficiency_in_bins( found, total, ndbins, sim_to_bins_function=lambda sim: (sim.distance,)): """ Calculate search efficiency in the given ndbins. The first dimension of ndbins must be bins over injected distance. sim_to_bins_function must map an object to a tuple in...
python
{ "resource": "" }
q32040
compute_search_volume_in_bins
train
def compute_search_volume_in_bins(found, total, ndbins, sim_to_bins_function): """ Calculate search sensitive volume by integrating efficiency in distance bins No cosmological corrections are applied: flat space is assumed. The first dimension of ndbins must be bins over injected distance. sim_to_b...
python
{ "resource": "" }
q32041
volume_to_distance_with_errors
train
def volume_to_distance_with_errors(vol, vol_err): """ Return the distance and standard deviation upper and lower bounds Parameters ---------- vol: float vol_err: float Returns ------- dist: float ehigh: float elow: float """ dist = (vol * 3.0/4.0/numpy.pi) ** (1.0/3.0)...
python
{ "resource": "" }
q32042
volume_montecarlo
train
def volume_montecarlo(found_d, missed_d, found_mchirp, missed_mchirp, distribution_param, distribution, limits_param, min_param=None, max_param=None): """ Compute sensitive volume and standard error via direct Monte Carlo integral Injections should be made over a...
python
{ "resource": "" }
q32043
volume_binned_pylal
train
def volume_binned_pylal(f_dist, m_dist, bins=15): """ Compute the sensitive volume using a distance binned efficiency estimate Parameters ----------- f_dist: numpy.ndarray The distances of found injections m_dist: numpy.ndarray The distances of missed injections Returns ---...
python
{ "resource": "" }
q32044
volume_shell
train
def volume_shell(f_dist, m_dist): """ Compute the sensitive volume using sum over spherical shells. Parameters ----------- f_dist: numpy.ndarray The distances of found injections m_dist: numpy.ndarray The distances of missed injections Returns -------- volume: float ...
python
{ "resource": "" }
q32045
raw_samples_to_dict
train
def raw_samples_to_dict(sampler, raw_samples): """Convenience function for converting ND array to a dict of samples. The samples are assumed to have dimension ``[sampler.base_shape x] niterations x len(sampler.sampling_params)``. Parameters ---------- sampler : sampler instance An inst...
python
{ "resource": "" }
q32046
blob_data_to_dict
train
def blob_data_to_dict(stat_names, blobs): """Converts list of "blobs" to a dictionary of model stats. Samplers like ``emcee`` store the extra tuple returned by ``CallModel`` to a list called blobs. This is a list of lists of tuples with shape niterations x nwalkers x nstats, where nstats is the number ...
python
{ "resource": "" }
q32047
get_optional_arg_from_config
train
def get_optional_arg_from_config(cp, section, arg, dtype=str): """Convenience function to retrieve an optional argument from a config file. Parameters ---------- cp : ConfigParser Open config parser to retrieve the argument from. section : str Name of the section to retrieve fro...
python
{ "resource": "" }
q32048
BaseMCMC.niterations
train
def niterations(self): """The current number of iterations.""" itercounter = self._itercounter if itercounter is
python
{ "resource": "" }
q32049
BaseMCMC.get_thin_interval
train
def get_thin_interval(self): """Gets the thin interval to use. If ``max_samples_per_chain`` is set, this will figure out what thin interval is needed to satisfy that criteria. In that case, the thin interval used must be a multiple of the currently used thin interval. """ ...
python
{ "resource": "" }
q32050
BaseMCMC.pos
train
def pos(self): """A dictionary of the current walker positions. If the sampler hasn't been run yet, returns p0. """ pos = self._pos if pos is None: return self.p0
python
{ "resource": "" }
q32051
BaseMCMC.p0
train
def p0(self): """A dictionary of the initial position of the walkers. This is set by using ``set_p0``. If not set yet, a ``ValueError`` is raised when the attribute is accessed. """ if self._p0 is None: raise
python
{ "resource": "" }
q32052
BaseMCMC.set_p0
train
def set_p0(self, samples_file=None, prior=None): """Sets the initial position of the walkers. Parameters ---------- samples_file : InferenceFile, optional If provided, use the last iteration in the given file for the starting positions. prior : JointDistr...
python
{ "resource": "" }
q32053
BaseMCMC.set_initial_conditions
train
def set_initial_conditions(self, initial_distribution=None, samples_file=None): """Sets the initial starting point for the MCMC. If a starting samples file is provided, will also load the random state from it. """ self.set_p0(samples_file=samples_f...
python
{ "resource": "" }
q32054
BaseMCMC.run
train
def run(self): """Runs the sampler.""" if self.target_eff_nsamples and self.checkpoint_interval is None: raise ValueError("A checkpoint interval must be set if " "targetting an effective number of samples") # get the starting number of samples: # ...
python
{ "resource": "" }
q32055
BaseMCMC.effective_nsamples
train
def effective_nsamples(self): """The effective number of samples post burn-in that the sampler has acquired so far.""" try: act = numpy.array(list(self.acts.values())).max() except (AttributeError, TypeError): act = numpy.inf if self.burn_in is
python
{ "resource": "" }
q32056
BaseMCMC.checkpoint
train
def checkpoint(self): """Dumps current samples to the checkpoint file.""" # thin and write new samples for fn in [self.checkpoint_file, self.backup_file]: with self.io(fn, "a") as fp: # write the current number of iterations fp.write_niterations(self.n...
python
{ "resource": "" }
q32057
BaseMCMC.set_target_from_config
train
def set_target_from_config(self, cp, section): """Sets the target using the given config file. This looks for ``niterations`` to set the ``target_niterations``, and ``effective-nsamples`` to set the ``target_eff_nsamples``. Parameters ---------- cp : ConfigParser ...
python
{ "resource": "" }
q32058
BaseMCMC.set_burn_in_from_config
train
def set_burn_in_from_config(self, cp): """Sets the burn in class from the given config file. If no burn-in section exists in the file, then this just set the burn-in class to None. """ try:
python
{ "resource": "" }
q32059
BaseMCMC.set_thin_interval_from_config
train
def set_thin_interval_from_config(self, cp, section): """Sets thinning options from the given config file. """ if cp.has_option(section, "thin-interval"): thin_interval = int(cp.get(section, "thin-interval")) logging.info("Will thin samples using interval %i", thin_interv...
python
{ "resource": "" }
q32060
BaseMCMC.acts
train
def acts(self): """The autocorrelation times of each parameter. The autocorrelation time is defined as the ACL times the ``thin_interval``. It gives the number of iterations between independent samples. """ if self.acls
python
{ "resource": "" }
q32061
MCMCAutocorrSupport.compute_acl
train
def compute_acl(cls, filename, start_index=None, end_index=None, min_nsamples=10): """Computes the autocorrleation length for all model params in the given file. Parameter values are averaged over all walkers at each iteration. The ACL is then calculated over the ave...
python
{ "resource": "" }
q32062
LiveSingleFarThreshold.check
train
def check(self, triggers, data_reader): """ Look for a single detector trigger that passes the thresholds in the current data. """ if len(triggers['snr']) == 0: return None i = triggers['snr'].argmax() # This uses the pycbc live convention of chisq always mea...
python
{ "resource": "" }
q32063
InferenceTXTFile.write
train
def write(cls, output_file, samples, labels, delimiter=None): """ Writes a text file with samples. Parameters ----------- output_file : str The path of the file to write. samples : FieldArray Samples to write to file. labels : list A l...
python
{ "resource": "" }
q32064
get_topclasses
train
def get_topclasses(cls): """Gets the base classes that are in pycbc.""" bases = [c for c in inspect.getmro(cls) if c.__module__.startswith('pycbc') and c !=
python
{ "resource": "" }
q32065
int_gps_time_to_str
train
def int_gps_time_to_str(t): """Takes an integer GPS time, either given as int or lal.LIGOTimeGPS, and converts it to a string. If a LIGOTimeGPS with nonzero decimal part is given, raises a ValueError.""" if isinstance(t, int): return str(t) elif isinstance(t, float): # Wouldn't this...
python
{ "resource": "" }
q32066
select_tmpltbank_class
train
def select_tmpltbank_class(curr_exe): """ This function returns a class that is appropriate for setting up template bank jobs within workflow. Parameters ---------- curr_exe : string The name of the executable to be used for generating template banks. Returns -------- exe_class...
python
{ "resource": "" }
q32067
select_matchedfilter_class
train
def select_matchedfilter_class(curr_exe): """ This function returns a class that is appropriate for setting up matched-filtering jobs within workflow. Parameters ---------- curr_exe : string The name of the matched filter executable to be used. Returns -------- exe_class : Sub-...
python
{ "resource": "" }
q32068
select_generic_executable
train
def select_generic_executable(workflow, exe_tag): """ Returns a class that is appropriate for setting up jobs to run executables having specific tags in the workflow config. Executables should not be "specialized" jobs fitting into one of the select_XXX_class functions above, i.e. not a matched filter o...
python
{ "resource": "" }
q32069
multi_ifo_coherent_job_setup
train
def multi_ifo_coherent_job_setup(workflow, out_files, curr_exe_job, science_segs, datafind_outs, output_dir, parents=None, slide_dict=None, tags=None): """ Method for setting up coherent inspiral jobs. """ if tags is None: tags = ...
python
{ "resource": "" }
q32070
JobSegmenter.pick_tile_size
train
def pick_tile_size(self, seg_size, data_lengths, valid_chunks, valid_lengths): """ Choose job tiles size based on science segment length """ if len(valid_lengths) == 1: return data_lengths[0], valid_chunks[0], valid_lengths[0] else: # Pick the tile size that
python
{ "resource": "" }
q32071
JobSegmenter.get_valid_times_for_job
train
def get_valid_times_for_job(self, num_job, allow_overlap=True): """ Get the times for which this job is valid. """ if self.compatibility_mode: return self.get_valid_times_for_job_legacy(num_job) else: return
python
{ "resource": "" }
q32072
JobSegmenter.get_valid_times_for_job_workflow
train
def get_valid_times_for_job_workflow(self, num_job, allow_overlap=True): """ Get the times for which the job num_job will be valid, using workflow's method. """ # small factor of 0.0001 to avoid float round offs causing us to # miss a second at end of segments. shift_dur ...
python
{ "resource": "" }
q32073
JobSegmenter.get_valid_times_for_job_legacy
train
def get_valid_times_for_job_legacy(self, num_job): """ Get the times for which the job num_job will be valid, using the method use in inspiral hipe. """ # All of this should be integers, so no rounding factors needed. shift_dur = self.curr_seg[0] + int(self.job_time_shift * num_j...
python
{ "resource": "" }
q32074
JobSegmenter.get_data_times_for_job
train
def get_data_times_for_job(self, num_job): """ Get the data that this job will read in. """ if self.compatibility_mode: job_data_seg = self.get_data_times_for_job_legacy(num_job) else: job_data_seg = self.get_data_times_for_job_workflow(num_job) # Sanity check ...
python
{ "resource": "" }
q32075
PyCBCInspiralExecutable.get_valid_times
train
def get_valid_times(self): """ Determine possible dimensions of needed input and valid output """ if self.cp.has_option('workflow-matchedfilter', 'min-analysis-segments'): min_analysis_segs = int(self.cp.get('workflow-matchedfilt...
python
{ "resource": "" }
q32076
PyCBCTmpltbankExecutable.create_nodata_node
train
def create_nodata_node(self, valid_seg, tags=None): """ A simplified version of create_node that creates a node that does not need to read in data. Parameters ----------- valid_seg : glue.segment The segment over which to declare the node valid. Usually this ...
python
{ "resource": "" }
q32077
PycbcSplitBankExecutable.create_node
train
def create_node(self, bank, tags=None): """ Set up a CondorDagmanNode class to run splitbank code Parameters ---------- bank : pycbc.workflow.core.File The File containing the template bank to be split Returns -------- node : pycbc.workflow.c...
python
{ "resource": "" }
q32078
PycbcCreateInjectionsExecutable.create_node
train
def create_node(self, config_file=None, seed=None, tags=None): """ Set up a CondorDagmanNode class to run ``pycbc_create_injections``. Parameters ---------- config_file : pycbc.workflow.core.File A ``pycbc.workflow.core.File`` for inference configuration file to ...
python
{ "resource": "" }
q32079
PycbcInferenceExecutable.create_node
train
def create_node(self, channel_names, config_file, injection_file=None, seed=None, fake_strain_seed=None, tags=None): """ Set up a CondorDagmanNode class to run ``pycbc_inference``. Parameters ---------- channel_names : dict A ``dict`` of ``str`` to use fo...
python
{ "resource": "" }
q32080
ensurearray
train
def ensurearray(*args): """Apply numpy's broadcast rules to the given arguments. This will ensure that all of the arguments are numpy arrays and that they all have the same shape. See ``numpy.broadcast_arrays`` for more details. It also returns a boolean indicating whether any of the inputs were o...
python
{ "resource": "" }
q32081
_mass2_from_mchirp_mass1
train
def _mass2_from_mchirp_mass1(mchirp, mass1): r"""Returns the secondary mass from the chirp mass and primary mass. As this is a cubic equation this requires finding the roots and returning the one that is real. Basically it can be shown that:
python
{ "resource": "" }
q32082
_mass_from_knownmass_eta
train
def _mass_from_knownmass_eta(known_mass, eta, known_is_secondary=False, force_real=True): r"""Returns the other component mass given one of the component masses and the symmetric mass ratio. This requires finding the roots of the quadratic equation: .. math:: \eta m...
python
{ "resource": "" }
q32083
mass2_from_mass1_eta
train
def mass2_from_mass1_eta(mass1, eta, force_real=True): """Returns the secondary mass from the primary mass and symmetric mass ratio. """ return mass_from_knownmass_eta(mass1,
python
{ "resource": "" }
q32084
mass1_from_mass2_eta
train
def mass1_from_mass2_eta(mass2, eta, force_real=True): """Returns the primary mass from the secondary mass and symmetric mass ratio. """ return mass_from_knownmass_eta(mass2,
python
{ "resource": "" }
q32085
lambda_tilde
train
def lambda_tilde(mass1, mass2, lambda1, lambda2): """ The effective lambda parameter The mass-weighted dominant effective lambda parameter defined in https://journals.aps.org/prd/pdf/10.1103/PhysRevD.91.043002 """ m1, m2, lambda1, lambda2, input_is_array = ensurearray( mass1, mass2, lambda1...
python
{ "resource": "" }
q32086
chi_eff
train
def chi_eff(mass1, mass2, spin1z, spin2z): """Returns the effective spin from mass1, mass2, spin1z, and spin2z."""
python
{ "resource": "" }
q32087
chi_a
train
def chi_a(mass1, mass2, spin1z, spin2z): """ Returns the aligned mass-weighted spin difference
python
{ "resource": "" }
q32088
chi_p
train
def chi_p(mass1, mass2, spin1x, spin1y, spin2x, spin2y): """Returns the effective precession spin from mass1, mass2, spin1x, spin1y, spin2x, and spin2y. """ xi1 = secondary_xi(mass1, mass2, spin1x, spin1y,
python
{ "resource": "" }
q32089
phi_a
train
def phi_a(mass1, mass2, spin1x, spin1y, spin2x, spin2y): """ Returns the angle between the in-plane perpendicular spins.""" phi1 = phi_from_spinx_spiny(primary_spin(mass1, mass2, spin1x, spin2x), primary_spin(mass1, mass2, spin1y,
python
{ "resource": "" }
q32090
phi_s
train
def phi_s(spin1x, spin1y, spin2x, spin2y): """ Returns the sum of the in-plane perpendicular spins.""" phi1 = phi_from_spinx_spiny(spin1x, spin1y)
python
{ "resource": "" }
q32091
chi_eff_from_spherical
train
def chi_eff_from_spherical(mass1, mass2, spin1_a, spin1_polar, spin2_a, spin2_polar): """Returns the effective
python
{ "resource": "" }
q32092
chi_p_from_spherical
train
def chi_p_from_spherical(mass1, mass2, spin1_a, spin1_azimuthal, spin1_polar, spin2_a, spin2_azimuthal, spin2_polar): """Returns the effective precession spin using spins in spherical coordinates. """ spin1x, spin1y, _ = _spherical_to_cartesian( spin1_a, spin1_azimuthal,...
python
{ "resource": "" }
q32093
primary_spin
train
def primary_spin(mass1, mass2, spin1, spin2): """Returns the dimensionless spin of the primary mass.""" mass1, mass2, spin1, spin2, input_is_array = ensurearray( mass1, mass2, spin1, spin2)
python
{ "resource": "" }
q32094
secondary_spin
train
def secondary_spin(mass1, mass2, spin1, spin2): """Returns the dimensionless spin of the secondary mass.""" mass1, mass2, spin1, spin2, input_is_array = ensurearray( mass1, mass2, spin1, spin2)
python
{ "resource": "" }
q32095
primary_xi
train
def primary_xi(mass1, mass2, spin1x, spin1y, spin2x, spin2y): """Returns the effective precession spin argument for the larger mass. """ spinx = primary_spin(mass1, mass2, spin1x, spin2x)
python
{ "resource": "" }
q32096
secondary_xi
train
def secondary_xi(mass1, mass2, spin1x, spin1y, spin2x, spin2y): """Returns the effective precession spin argument for the smaller mass. """ spinx = secondary_spin(mass1, mass2, spin1x, spin2x)
python
{ "resource": "" }
q32097
xi2_from_mass1_mass2_spin2x_spin2y
train
def xi2_from_mass1_mass2_spin2x_spin2y(mass1, mass2, spin2x, spin2y): """Returns the effective precession spin argument for the smaller mass. This function assumes it's given spins of the secondary mass. """
python
{ "resource": "" }
q32098
chi_perp_from_mass1_mass2_xi2
train
def chi_perp_from_mass1_mass2_xi2(mass1, mass2, xi2): """Returns the in-plane spin from mass1, mass2, and xi2 for the secondary mass. """
python
{ "resource": "" }
q32099
chi_p_from_xi1_xi2
train
def chi_p_from_xi1_xi2(xi1, xi2): """Returns effective precession spin from xi1 and xi2. """ xi1, xi2, input_is_array
python
{ "resource": "" }