pycbc package
Subpackages
- pycbc.catalog package
- pycbc.coordinates package
- Submodules
- pycbc.coordinates.base module
- pycbc.coordinates.space module
earth_position_ssb()
geo_to_lisa()
geo_to_ssb()
lisa_position_ssb()
lisa_to_geo()
lisa_to_ssb()
localization_to_propagation_vector()
polarization_newframe()
propagation_vector_to_localization()
rotation_matrix_ssb_to_geo()
rotation_matrix_ssb_to_lisa()
ssb_to_geo()
ssb_to_lisa()
t_geo_from_ssb()
t_lisa_from_ssb()
t_ssb_from_t_geo()
t_ssb_from_t_lisa()
- Module contents
cartesian_to_spherical()
cartesian_to_spherical_azimuthal()
cartesian_to_spherical_polar()
cartesian_to_spherical_rho()
earth_position_ssb()
geo_to_lisa()
geo_to_ssb()
lisa_position_ssb()
lisa_to_geo()
lisa_to_ssb()
localization_to_propagation_vector()
polarization_newframe()
propagation_vector_to_localization()
rotation_matrix_ssb_to_geo()
rotation_matrix_ssb_to_lisa()
spherical_to_cartesian()
ssb_to_geo()
ssb_to_lisa()
t_geo_from_ssb()
t_lisa_from_ssb()
t_ssb_from_t_geo()
t_ssb_from_t_lisa()
- pycbc.detector package
- Submodules
- pycbc.detector.ground module
Detector
Detector.antenna_pattern()
Detector.effective_distance()
Detector.get_icrs_pos()
Detector.gmst_estimate()
Detector.lal()
Detector.light_travel_time_to_detector()
Detector.optimal_orientation()
Detector.project_wave()
Detector.set_gmst_reference()
Detector.time_delay_from_detector()
Detector.time_delay_from_earth_center()
Detector.time_delay_from_location()
add_detector_on_earth()
get_available_detectors()
get_available_lal_detectors()
gmst_accurate()
load_detector_config()
overhead_antenna_pattern()
ppdets()
single_arm_frequency_response()
- pycbc.detector.space module
- Module contents
- pycbc.distributions package
- Submodules
- pycbc.distributions.angular module
- pycbc.distributions.arbitrary module
- pycbc.distributions.bounded module
- pycbc.distributions.constraints module
- pycbc.distributions.external module
- pycbc.distributions.fixedsamples module
- pycbc.distributions.gaussian module
- pycbc.distributions.joint module
JointDistribution
JointDistribution.variable_args
JointDistribution.distributions
JointDistribution.constraints
JointDistribution.apply_boundary_conditions()
JointDistribution.bounds
JointDistribution.cdfinv()
JointDistribution.contains()
JointDistribution.cyclic
JointDistribution.name
JointDistribution.rvs()
JointDistribution.well_reflected
JointDistribution.within_constraints()
- pycbc.distributions.mass module
- pycbc.distributions.power_law module
- pycbc.distributions.qnm module
- pycbc.distributions.sky_location module
- pycbc.distributions.spins module
- pycbc.distributions.uniform module
- pycbc.distributions.uniform_log module
- pycbc.distributions.utils module
- Module contents
- pycbc.events package
- Submodules
- pycbc.events.coherent module
- pycbc.events.coinc module
CoincExpireBuffer
LiveCoincTimeslideBackgroundEstimator
LiveCoincTimeslideBackgroundEstimator.add_singles()
LiveCoincTimeslideBackgroundEstimator.background_time
LiveCoincTimeslideBackgroundEstimator.backout_last()
LiveCoincTimeslideBackgroundEstimator.from_cli()
LiveCoincTimeslideBackgroundEstimator.ifar()
LiveCoincTimeslideBackgroundEstimator.insert_args()
LiveCoincTimeslideBackgroundEstimator.pick_best_coinc()
LiveCoincTimeslideBackgroundEstimator.refresh_statistic()
LiveCoincTimeslideBackgroundEstimator.restore_state()
LiveCoincTimeslideBackgroundEstimator.save_state()
LiveCoincTimeslideBackgroundEstimator.set_singles_buffer()
LiveCoincTimeslideBackgroundEstimator.start_refresh_thread()
LiveCoincTimeslideBackgroundEstimator.verify_args()
MultiRingBuffer
MultiRingBuffer.add()
MultiRingBuffer.advance_time()
MultiRingBuffer.check_expired_triggers()
MultiRingBuffer.data()
MultiRingBuffer.discard_last()
MultiRingBuffer.expire_vector()
MultiRingBuffer.filled_time
MultiRingBuffer.nbytes
MultiRingBuffer.num_elements()
MultiRingBuffer.update_valid_start()
MultiRingBuffer.valid_slice()
background_bin_from_string()
cluster_coincs()
cluster_coincs_multiifo()
cluster_over_time()
mean_if_greater_than_zero()
time_coincidence()
time_multi_coincidence()
timeslide_durations()
- pycbc.events.coinc_rate module
- pycbc.events.cuts module
- pycbc.events.eventmgr module
EventManager
EventManager.add_template_events()
EventManager.add_template_params()
EventManager.chisq_threshold()
EventManager.cluster_template_events()
EventManager.consolidate_events()
EventManager.finalize_events()
EventManager.finalize_template_events()
EventManager.from_multi_ifo_interface()
EventManager.keep_loudest_in_interval()
EventManager.keep_near_injection()
EventManager.make_output_dir()
EventManager.new_template()
EventManager.newsnr_threshold()
EventManager.restore_state()
EventManager.save_performance()
EventManager.save_state()
EventManager.write_events()
EventManager.write_to_hdf()
EventManagerCoherent
EventManagerMultiDet
ThresholdCluster
cluster_reduce()
findchirp_cluster_over_window()
threshold()
threshold_and_cluster()
threshold_only()
threshold_real_numpy()
- pycbc.events.eventmgr_cython module
coincbuffer_expireelements()
coincbuffer_numgreater()
findchirp_cluster_over_window_cython()
logsignalrateinternals_compute2detrate()
logsignalrateinternals_computepsignalbins()
timecluster_cython()
timecoincidence_constructfold()
timecoincidence_constructidxs()
timecoincidence_findidxlen()
timecoincidence_getslideint()
- pycbc.events.ranking module
effsnr()
get_newsnr()
get_newsnr_sgveto()
get_newsnr_sgveto_psdvar()
get_newsnr_sgveto_psdvar_scaled()
get_newsnr_sgveto_psdvar_scaled_threshold()
get_newsnr_sgveto_psdvar_threshold()
get_sngls_ranking_from_trigs()
get_snr()
newsnr()
newsnr_sgveto()
newsnr_sgveto_psdvar()
newsnr_sgveto_psdvar_scaled()
newsnr_sgveto_psdvar_scaled_threshold()
newsnr_sgveto_psdvar_threshold()
- pycbc.events.significance module
- pycbc.events.simd_threshold_cython module
- pycbc.events.single module
- pycbc.events.stat module
DQExpFitFgBgKDEStatistic
DQExpFitFgBgNormStatistic
DQExpFitFgBgNormStatistic.assign_dq_rates()
DQExpFitFgBgNormStatistic.assign_template_bins()
DQExpFitFgBgNormStatistic.check_low_latency()
DQExpFitFgBgNormStatistic.find_dq_noise_rate()
DQExpFitFgBgNormStatistic.find_dq_state_by_time()
DQExpFitFgBgNormStatistic.lognoiserate()
DQExpFitFgBgNormStatistic.setup_segments()
DQExpFitFgBgNormStatistic.single()
DQExpFitFgBgNormStatistic.update_file()
ExpFitBgRateStatistic
ExpFitCombinedSNR
ExpFitFgBgKDEStatistic
ExpFitFgBgNormBBHStatistic
ExpFitFgBgNormStatistic
ExpFitFgBgNormStatistic.assign_benchmark_logvol()
ExpFitFgBgNormStatistic.assign_median_sigma()
ExpFitFgBgNormStatistic.coinc_lim_for_thresh()
ExpFitFgBgNormStatistic.lognoiserate()
ExpFitFgBgNormStatistic.rank_stat_coinc()
ExpFitFgBgNormStatistic.rank_stat_single()
ExpFitFgBgNormStatistic.single()
ExpFitFgBgNormStatistic.update_file()
ExpFitStatistic
ExpFitStatistic.assign_fits()
ExpFitStatistic.coinc_OLD()
ExpFitStatistic.coinc_lim_for_thresh()
ExpFitStatistic.coinc_lim_for_thresh_OLD()
ExpFitStatistic.find_fits()
ExpFitStatistic.get_ref_vals()
ExpFitStatistic.lognoiserate()
ExpFitStatistic.rank_stat_coinc()
ExpFitStatistic.rank_stat_single()
ExpFitStatistic.single()
ExpFitStatistic.update_file()
PhaseTDExpFitStatistic
PhaseTDStatistic
QuadratureSumStatistic
Stat
get_statistic()
get_statistic_from_opts()
insert_statistic_option_group()
parse_statistic_keywords_opt()
- pycbc.events.threshold_cpu module
- pycbc.events.threshold_cupy module
- pycbc.events.trigger_fits module
- pycbc.events.triggers module
- pycbc.events.veto module
- Module contents
- pycbc.fft package
- Submodules
- pycbc.fft.backend_cpu module
- pycbc.fft.backend_cupy module
- pycbc.fft.backend_mkl module
- pycbc.fft.backend_support module
- pycbc.fft.class_api module
- pycbc.fft.core module
- pycbc.fft.cupyfft module
- pycbc.fft.fft_callback module
- pycbc.fft.fftw module
FFT
IFFT
execute()
export_double_wisdom_to_filename()
export_single_wisdom_to_filename()
fft()
from_cli()
get_flag()
get_measure_level()
ifft()
import_double_wisdom_from_filename()
import_single_wisdom_from_filename()
import_sys_wisdom()
insert_fft_options()
plan()
set_measure_level()
set_planning_limit()
set_threads_backend()
verify_fft_options()
wisdom_io()
- pycbc.fft.fftw_pruned module
- pycbc.fft.fftw_pruned_cython module
- pycbc.fft.func_api module
- pycbc.fft.mkl module
- pycbc.fft.npfft module
- pycbc.fft.parser_support module
- Module contents
- pycbc.filter package
- Submodules
- pycbc.filter.autocorrelation module
- pycbc.filter.matchedfilter module
LiveBatchMatchedFilter
MatchedFilterControl
MatchedFilterSkyMaxControl
MatchedFilterSkyMaxControlNoPhase
compute_followup_snr_series()
compute_max_snr_over_sky_loc_stat()
compute_max_snr_over_sky_loc_stat_no_phase()
compute_u_val_for_sky_loc_stat()
compute_u_val_for_sky_loc_stat_no_phase()
correlate()
followup_event_significance()
get_cutoff_indices()
make_frequency_series()
match()
matched_filter()
matched_filter_core()
optimized_match()
overlap()
overlap_cplx()
sigma()
sigmasq()
sigmasq_series()
- pycbc.filter.matchedfilter_cpu module
- pycbc.filter.matchedfilter_cupy module
- pycbc.filter.matchedfilter_numpy module
- pycbc.filter.qtransform module
- pycbc.filter.resample module
- pycbc.filter.simd_correlate module
- pycbc.filter.simd_correlate_cython module
- pycbc.filter.zpk module
- Module contents
- pycbc.frame package
- pycbc.inference package
- Subpackages
- pycbc.inference.io package
- Submodules
- pycbc.inference.io.base_hdf module
- pycbc.inference.io.base_mcmc module
- pycbc.inference.io.base_multitemper module
- pycbc.inference.io.base_nested_sampler module
- pycbc.inference.io.base_sampler module
- pycbc.inference.io.dynesty module
- pycbc.inference.io.emcee module
- pycbc.inference.io.emcee_pt module
- pycbc.inference.io.epsie module
- pycbc.inference.io.multinest module
- pycbc.inference.io.nessai module
- pycbc.inference.io.posterior module
- pycbc.inference.io.ptemcee module
- pycbc.inference.io.snowline module
- pycbc.inference.io.txt module
- pycbc.inference.io.ultranest module
- Module contents
- pycbc.inference.jump package
- pycbc.inference.models package
- Submodules
- pycbc.inference.models.analytic module
- pycbc.inference.models.base module
- pycbc.inference.models.base_data module
- pycbc.inference.models.brute_marg module
- pycbc.inference.models.data_utils module
- pycbc.inference.models.gated_gaussian_noise module
- pycbc.inference.models.gaussian_noise module
- pycbc.inference.models.hierarchical module
- pycbc.inference.models.marginalized_gaussian_noise module
- pycbc.inference.models.relbin module
- pycbc.inference.models.relbin_cpu module
- pycbc.inference.models.single_template module
- pycbc.inference.models.tools module
- Module contents
- pycbc.inference.sampler package
- Submodules
- pycbc.inference.sampler.base module
- pycbc.inference.sampler.base_cube module
- pycbc.inference.sampler.base_mcmc module
- pycbc.inference.sampler.base_multitemper module
- pycbc.inference.sampler.dummy module
- pycbc.inference.sampler.dynesty module
- pycbc.inference.sampler.emcee module
- pycbc.inference.sampler.emcee_pt module
- pycbc.inference.sampler.epsie module
- pycbc.inference.sampler.games module
- pycbc.inference.sampler.multinest module
- pycbc.inference.sampler.nessai module
- pycbc.inference.sampler.ptemcee module
- pycbc.inference.sampler.refine module
- pycbc.inference.sampler.snowline module
- pycbc.inference.sampler.ultranest module
- Module contents
- pycbc.inference.io package
- Submodules
- pycbc.inference.burn_in module
- pycbc.inference.entropy module
- pycbc.inference.evidence module
- pycbc.inference.gelman_rubin module
- pycbc.inference.geweke module
- pycbc.inference.option_utils module
- Module contents
- Subpackages
- pycbc.inject package
- Submodules
- pycbc.inject.inject module
CBCHDFInjectionSet
IncoherentFromFileHDFInjectionSet
IncoherentFromFileHDFInjectionSet.apply()
IncoherentFromFileHDFInjectionSet.end_times()
IncoherentFromFileHDFInjectionSet.injtype
IncoherentFromFileHDFInjectionSet.loadts()
IncoherentFromFileHDFInjectionSet.make_strain_from_inj_object()
IncoherentFromFileHDFInjectionSet.required_params
IncoherentFromFileHDFInjectionSet.set_ref_time()
IncoherentFromFileHDFInjectionSet.slice_and_taper()
IncoherentFromFileHDFInjectionSet.supported_approximants()
InjectionSet
RingdownHDFInjectionSet
SGBurstInjectionSet
get_hdf_injtype()
hdf_injtype_from_approximant()
legacy_approximant_name()
projector()
set_sim_data()
- pycbc.inject.injfilterrejector module
- Module contents
- pycbc.io package
- Submodules
- pycbc.io.gracedb module
- pycbc.io.hdf module
DataFromFiles
DictArray
FileData
ForegroundTriggers
ForegroundTriggers.get_active_segments()
ForegroundTriggers.get_bankfile_array()
ForegroundTriggers.get_coincfile_array()
ForegroundTriggers.get_end_time()
ForegroundTriggers.get_ifos()
ForegroundTriggers.get_snglfile_array_dict()
ForegroundTriggers.sort_arr
ForegroundTriggers.template_id
ForegroundTriggers.to_coinc_hdf_object()
ForegroundTriggers.to_coinc_xml_object()
ForegroundTriggers.trig_id
HFile
MultiifoStatmapData
ReadByTemplate
SingleDetTriggers
SingleDetTriggers.and_masks()
SingleDetTriggers.apply_mask()
SingleDetTriggers.approximant
SingleDetTriggers.checkbank()
SingleDetTriggers.effective_spin
SingleDetTriggers.end_time
SingleDetTriggers.eta
SingleDetTriggers.f_lower
SingleDetTriggers.f_seobnrv2_peak
SingleDetTriggers.f_seobnrv4_peak
SingleDetTriggers.get_column()
SingleDetTriggers.get_param_names()
SingleDetTriggers.get_ranking()
SingleDetTriggers.inclination
SingleDetTriggers.mask_size
SingleDetTriggers.mask_to_n_loudest_clustered_events()
SingleDetTriggers.mass1
SingleDetTriggers.mass2
SingleDetTriggers.mchirp
SingleDetTriggers.mtotal
SingleDetTriggers.newsnr
SingleDetTriggers.newsnr_sgveto
SingleDetTriggers.newsnr_sgveto_psdvar
SingleDetTriggers.newsnr_sgveto_psdvar_threshold
SingleDetTriggers.psd_var_val
SingleDetTriggers.rchisq
SingleDetTriggers.sgchisq
SingleDetTriggers.snr
SingleDetTriggers.spin1x
SingleDetTriggers.spin1y
SingleDetTriggers.spin1z
SingleDetTriggers.spin2x
SingleDetTriggers.spin2y
SingleDetTriggers.spin2z
SingleDetTriggers.template_duration
SingleDetTriggers.template_id
SingleDetTriggers.trig_dict()
SingleDetTriggers.u_vals
StatmapData
combine_and_copy()
dump_pickle_to_hdf()
dump_state()
get_all_subkeys()
get_chisq_from_file_choice()
load_hdf5_to_dict()
load_state()
name_all_datasets()
recursively_save_dict_contents_to_group()
save_dict_to_hdf5()
- pycbc.io.ligolw module
- pycbc.io.live module
- pycbc.io.record module
FieldArray
FieldArray.name
FieldArray.add_fields()
FieldArray.add_functions()
FieldArray.add_methods()
FieldArray.add_properties()
FieldArray.add_virtualfields()
FieldArray.addattr()
FieldArray.aliases
FieldArray.append()
FieldArray.del_functions()
FieldArray.fieldnames
FieldArray.fields
FieldArray.from_arrays()
FieldArray.from_kwargs()
FieldArray.from_ligolw_table()
FieldArray.from_records()
FieldArray.functionlib
FieldArray.parse_boolargs()
FieldArray.parse_parameters()
FieldArray.sort()
FieldArray.to_array()
FieldArray.virtualfields
WaveformArray
WaveformArray.chi_eff
WaveformArray.eta
WaveformArray.mchirp
WaveformArray.mtotal
WaveformArray.primary_mass
WaveformArray.q
WaveformArray.remnant_mass
WaveformArray.secondary_mass
WaveformArray.spin1_a
WaveformArray.spin1_azimuthal
WaveformArray.spin1_polar
WaveformArray.spin2_a
WaveformArray.spin2_azimuthal
WaveformArray.spin2_polar
WaveformArray.spin_px
WaveformArray.spin_py
WaveformArray.spin_pz
WaveformArray.spin_sx
WaveformArray.spin_sy
WaveformArray.spin_sz
- Module contents
- pycbc.live package
- pycbc.neutron_stars package
- pycbc.noise package
- pycbc.population package
- Submodules
- pycbc.population.fgmc_functions module
- pycbc.population.fgmc_laguerre module
- pycbc.population.fgmc_plots module
- pycbc.population.live_pastro module
- pycbc.population.live_pastro_utils module
- pycbc.population.population_models module
- pycbc.population.rates_functions module
- pycbc.population.scale_injections module
- Module contents
- pycbc.psd package
- Submodules
- pycbc.psd.analytical module
AdVBNSOptimizedSensitivityP1200087()
AdVDesignSensitivityP1200087()
AdVEarlyHighSensitivityP1200087()
AdVEarlyLowSensitivityP1200087()
AdVLateHighSensitivityP1200087()
AdVLateLowSensitivityP1200087()
AdVMidHighSensitivityP1200087()
AdVMidLowSensitivityP1200087()
AdVO3LowT1800545()
AdVO4IntermediateT1800545()
AdVO4T1800545()
AdvVirgo()
CosmicExplorerP1600143()
CosmicExplorerPessimisticP1600143()
CosmicExplorerWidebandP1600143()
EinsteinTelescopeP1600143()
GEO()
GEOHF()
KAGRA()
KAGRA128MpcT1800545()
KAGRA25MpcT1800545()
KAGRA80MpcT1800545()
KAGRADesignSensitivityT1600593()
KAGRAEarlySensitivityT1600593()
KAGRALateSensitivityT1600593()
KAGRAMidSensitivityT1600593()
KAGRAOpeningSensitivityT1600593()
TAMA()
Virgo()
aLIGO140MpcT1800545()
aLIGO175MpcT1800545()
aLIGOAPlusDesignSensitivityT1800042()
aLIGOAdVO3LowT1800545()
aLIGOAdVO4IntermediateT1800545()
aLIGOAdVO4T1800545()
aLIGOBHBH20Deg()
aLIGOBHBH20DegGWINC()
aLIGOBNSOptimizedSensitivityP1200087()
aLIGODesignSensitivityP1200087()
aLIGODesignSensitivityT1800044()
aLIGOEarlyHighSensitivityP1200087()
aLIGOEarlyLowSensitivityP1200087()
aLIGOHighFrequency()
aLIGOHighFrequencyGWINC()
aLIGOKAGRA128MpcT1800545()
aLIGOKAGRA25MpcT1800545()
aLIGOKAGRA80MpcT1800545()
aLIGOLateHighSensitivityP1200087()
aLIGOLateLowSensitivityP1200087()
aLIGOMidHighSensitivityP1200087()
aLIGOMidLowSensitivityP1200087()
aLIGONSNSOpt()
aLIGONSNSOptGWINC()
aLIGONoSRMHighPower()
aLIGONoSRMLowPower()
aLIGONoSRMLowPowerGWINC()
aLIGOO3LowT1800545()
aLIGOQuantumBHBH20Deg()
aLIGOQuantumHighFrequency()
aLIGOQuantumNSNSOpt()
aLIGOQuantumNoSRMHighPower()
aLIGOQuantumNoSRMLowPower()
aLIGOQuantumZeroDetHighPower()
aLIGOQuantumZeroDetLowPower()
aLIGOThermal()
aLIGOZeroDetHighPower()
aLIGOZeroDetHighPowerGWINC()
aLIGOZeroDetLowPower()
aLIGOZeroDetLowPowerGWINC()
aLIGOaLIGO140MpcT1800545()
aLIGOaLIGO175MpcT1800545()
aLIGOaLIGODesignSensitivityT1800044()
aLIGOaLIGOO3LowT1800545()
eLIGOModel()
eLIGOShot()
flat_unity()
from_string()
get_lalsim_psd_list()
get_psd_model_list()
get_pycbc_psd_list()
iLIGOModel()
iLIGOSRD()
iLIGOSeismic()
iLIGOShot()
iLIGOThermal()
- pycbc.psd.analytical_space module
analytical_csd_lisa_tdi_XY()
analytical_psd_lisa_tdi_AE()
analytical_psd_lisa_tdi_AE_confusion()
analytical_psd_lisa_tdi_T()
analytical_psd_lisa_tdi_XYZ()
analytical_psd_taiji_confusion_noise()
analytical_psd_taiji_tdi_AE()
analytical_psd_taiji_tdi_AE_confusion()
analytical_psd_taiji_tdi_T()
analytical_psd_taiji_tdi_XYZ()
analytical_psd_tianqin_confusion_noise()
analytical_psd_tianqin_tdi_AE()
analytical_psd_tianqin_tdi_AE_confusion()
analytical_psd_tianqin_tdi_T()
analytical_psd_tianqin_tdi_XYZ()
averaged_fplus_sq_approximated()
averaged_lisa_fplus_sq_numerical()
averaged_response_lisa_tdi()
averaged_response_taiji_tdi()
averaged_response_tianqin_tdi()
averaged_tianqin_fplus_sq_numerical()
confusion_fit_lisa()
confusion_fit_taiji()
confusion_fit_tianqin()
lisa_psd_components()
omega_length()
psd_lisa_acc_noise()
psd_lisa_oms_noise()
psd_taiji_acc_noise()
psd_taiji_oms_noise()
psd_tianqin_acc_noise()
psd_tianqin_oms_noise()
semi_analytical_psd_lisa_confusion_noise()
sensitivity_curve_lisa_SciRD()
sensitivity_curve_lisa_confusion()
sensitivity_curve_lisa_semi_analytical()
sensitivity_curve_taiji_analytical()
sensitivity_curve_taiji_confusion()
sensitivity_curve_tianqin_analytical()
sensitivity_curve_tianqin_confusion()
sh_transformed_psd_lisa_tdi_XYZ()
taiji_psd_components()
tianqin_psd_components()
- pycbc.psd.estimate module
- pycbc.psd.read module
- pycbc.psd.variation module
- Module contents
associate_psds_to_multi_ifo_segments()
associate_psds_to_segments()
associate_psds_to_single_ifo_segments()
from_cli()
from_cli_multi_ifos()
from_cli_single_ifo()
generate_overlapping_psds()
insert_psd_option_group()
insert_psd_option_group_multi_ifo()
verify_psd_options()
verify_psd_options_multi_ifo()
- pycbc.results package
- Submodules
- pycbc.results.color module
- pycbc.results.dq module
- pycbc.results.followup module
- pycbc.results.layout module
- pycbc.results.metadata module
- pycbc.results.mpld3_utils module
- pycbc.results.plot module
- pycbc.results.psd module
- pycbc.results.pygrb_plotting_utils module
- pycbc.results.pygrb_postprocessing_utils module
apply_vetoes_to_found_injs()
construct_trials()
extract_ifos()
extract_trig_properties()
get_antenna_dist_factor()
get_coinc_snr()
load_data()
load_segment_dict()
load_time_slides()
max_median_stat()
mc_cal_wf_errs()
pygrb_add_bestnr_cut_opt()
pygrb_add_bestnr_opts()
pygrb_add_injmc_opts()
pygrb_add_null_snr_opts()
pygrb_add_single_snr_cut_opt()
pygrb_add_slide_opts()
pygrb_initialize_plot_parser()
slide_opts_helper()
sort_stat()
sort_trigs()
template_hash_to_id()
- pycbc.results.render module
- pycbc.results.scatter_histograms module
- pycbc.results.snr module
- pycbc.results.str_utils module
- pycbc.results.table_utils module
- pycbc.results.versioning module
- Module contents
- pycbc.strain package
- Submodules
- pycbc.strain.calibration module
- pycbc.strain.gate module
- pycbc.strain.lines module
- pycbc.strain.recalibrate module
- pycbc.strain.strain module
StrainBuffer
StrainBuffer.add_hard_count()
StrainBuffer.advance()
StrainBuffer.check_psd_dist()
StrainBuffer.end_time
StrainBuffer.from_cli()
StrainBuffer.invalidate_psd()
StrainBuffer.near_hwinj()
StrainBuffer.null_advance_strain()
StrainBuffer.overwhitened_data()
StrainBuffer.recalculate_psd()
StrainBuffer.start_time
StrainSegments
StrainSegments.fourier_segments()
StrainSegments.from_cli()
StrainSegments.from_cli_multi_ifos()
StrainSegments.from_cli_single_ifo()
StrainSegments.insert_segment_option_group()
StrainSegments.insert_segment_option_group_multi_ifo()
StrainSegments.required_opts_list
StrainSegments.verify_segment_options()
StrainSegments.verify_segment_options_multi_ifo()
create_memory_and_engine_for_class_based_fft()
detect_loud_glitches()
execute_cached_fft()
execute_cached_ifft()
from_cli()
from_cli_multi_ifos()
from_cli_single_ifo()
gate_data()
insert_strain_option_group()
insert_strain_option_group_multi_ifo()
next_power_of_2()
verify_strain_options()
verify_strain_options_multi_ifo()
- Module contents
- pycbc.tmpltbank package
- Submodules
- pycbc.tmpltbank.bank_conversions module
- pycbc.tmpltbank.bank_output_utils module
- pycbc.tmpltbank.brute_force_methods module
- pycbc.tmpltbank.calc_moments module
- pycbc.tmpltbank.coord_utils module
calc_point_dist()
calc_point_dist_vary()
estimate_mass_range()
find_closest_calculated_frequencies()
find_max_and_min_frequencies()
get_conv_params()
get_cov_params()
get_covaried_params()
get_mu_params()
get_point_distance()
get_random_mass()
get_random_mass_point_particles()
outspiral_loop()
return_nearest_cutoff()
rotate_vector()
test_point_dist()
- pycbc.tmpltbank.lambda_mapping module
- pycbc.tmpltbank.lattice_utils module
- pycbc.tmpltbank.option_utils module
IndentedHelpFormatterWithNL
check_ethinca_against_bank_params()
ethincaParameters
get_options_from_group()
insert_base_bank_options()
insert_ethinca_metric_options()
insert_mass_range_option_group()
insert_metric_calculation_options()
massRangeParameters
metricParameters
verify_ethinca_metric_options()
verify_mass_range_options()
verify_metric_calculation_options()
- pycbc.tmpltbank.partitioned_bank module
PartitionedTmpltbank
PartitionedTmpltbank.add_point_by_chi_coords()
PartitionedTmpltbank.add_point_by_masses()
PartitionedTmpltbank.add_tmpltbank_from_hdf_file()
PartitionedTmpltbank.add_tmpltbank_from_xml_table()
PartitionedTmpltbank.calc_point_distance()
PartitionedTmpltbank.calc_point_distance_vary()
PartitionedTmpltbank.check_bin_existence()
PartitionedTmpltbank.find_point_bin()
PartitionedTmpltbank.get_freq_map_and_normalizations()
PartitionedTmpltbank.get_point_from_bins_and_idx()
PartitionedTmpltbank.output_all_points()
PartitionedTmpltbank.test_point_distance()
PartitionedTmpltbank.test_point_distance_vary()
- pycbc.tmpltbank.sky_grid module
- Module contents
- pycbc.types package
- Submodules
- pycbc.types.aligned module
- pycbc.types.array module
Array
Array.abs_arg_max()
Array.abs_max_loc()
Array.almost_equal_elem()
Array.almost_equal_norm()
Array.astype()
Array.clear()
Array.conj()
Array.copy()
Array.cumsum()
Array.data
Array.dot()
Array.dtype
Array.fill()
Array.imag()
Array.inner()
Array.itemsize
Array.kind
Array.lal()
Array.max()
Array.max_loc()
Array.min()
Array.multiply_and_add()
Array.nbytes
Array.ndim
Array.numpy()
Array.precision
Array.ptr
Array.real()
Array.resize()
Array.roll()
Array.save()
Array.shape
Array.squared_norm()
Array.sum()
Array.take()
Array.trim_zeros()
Array.vdot()
Array.view()
Array.weighted_inner()
check_same_len_precision()
common_kind()
complex_same_precision_as()
empty()
force_precision_to_match()
load_array()
real_same_precision_as()
zeros()
- pycbc.types.array_cpu module
- pycbc.types.array_cupy module
- pycbc.types.config module
DeepCopyableConfigParser
InterpolatingConfigParser
InterpolatingConfigParser.add_options_to_section()
InterpolatingConfigParser.check_duplicate_options()
InterpolatingConfigParser.from_cli()
InterpolatingConfigParser.get_opt_tag()
InterpolatingConfigParser.get_opt_tags()
InterpolatingConfigParser.get_subsections()
InterpolatingConfigParser.has_option_tag()
InterpolatingConfigParser.has_option_tags()
InterpolatingConfigParser.interpolate_string()
InterpolatingConfigParser.perform_extended_interpolation()
InterpolatingConfigParser.populate_shared_sections()
InterpolatingConfigParser.read_ini_file()
InterpolatingConfigParser.sanitize_newline()
InterpolatingConfigParser.sanity_check_subsections()
InterpolatingConfigParser.split_multi_sections()
- pycbc.types.frequencyseries module
FrequencySeries
FrequencySeries.almost_equal_elem()
FrequencySeries.almost_equal_norm()
FrequencySeries.at_frequency()
FrequencySeries.cyclic_time_shift()
FrequencySeries.delta_f
FrequencySeries.delta_t
FrequencySeries.duration
FrequencySeries.end_time
FrequencySeries.epoch
FrequencySeries.get_delta_f()
FrequencySeries.get_epoch()
FrequencySeries.get_sample_frequencies()
FrequencySeries.lal()
FrequencySeries.match()
FrequencySeries.plot()
FrequencySeries.sample_frequencies
FrequencySeries.sample_rate
FrequencySeries.save()
FrequencySeries.start_time
FrequencySeries.to_frequencyseries()
FrequencySeries.to_timeseries()
load_frequencyseries()
- pycbc.types.optparse module
DictOptionAction
DictWithDefaultReturn
MultiDetDictOptionAction
MultiDetMultiColonOptionAction
MultiDetOptionAction
MultiDetOptionActionSpecial
MultiDetOptionAppendAction
angle_as_radians()
convert_to_process_params_dict()
copy_opts_for_single_ifo()
ensure_one_opt()
ensure_one_opt_multi_ifo()
nonnegative_float()
nonnegative_int()
positive_float()
positive_int()
required_opts()
required_opts_multi_ifo()
- pycbc.types.timeseries module
TimeSeries
TimeSeries.add_into()
TimeSeries.almost_equal_elem()
TimeSeries.almost_equal_norm()
TimeSeries.append_zeros()
TimeSeries.at_time()
TimeSeries.at_times()
TimeSeries.crop()
TimeSeries.cyclic_time_shift()
TimeSeries.delta_f
TimeSeries.delta_t
TimeSeries.detrend()
TimeSeries.duration
TimeSeries.end_time
TimeSeries.epoch_close()
TimeSeries.filter_psd()
TimeSeries.fir_zero_filter()
TimeSeries.gate()
TimeSeries.get_delta_t()
TimeSeries.get_duration()
TimeSeries.get_end_time()
TimeSeries.get_sample_rate()
TimeSeries.get_sample_times()
TimeSeries.highpass_fir()
TimeSeries.inject()
TimeSeries.lal()
TimeSeries.lowpass_fir()
TimeSeries.match()
TimeSeries.notch_fir()
TimeSeries.plot()
TimeSeries.prepend_zeros()
TimeSeries.psd()
TimeSeries.qtransform()
TimeSeries.resample()
TimeSeries.sample_rate
TimeSeries.sample_rate_close()
TimeSeries.sample_times
TimeSeries.save()
TimeSeries.save_to_wav()
TimeSeries.start_time
TimeSeries.time_slice()
TimeSeries.to_astropy()
TimeSeries.to_frequencyseries()
TimeSeries.to_timeseries()
TimeSeries.whiten()
load_timeseries()
- Module contents
- pycbc.vetoes package
- Submodules
- pycbc.vetoes.autochisq module
- pycbc.vetoes.bank_chisq module
- pycbc.vetoes.chisq module
- pycbc.vetoes.chisq_cpu module
- pycbc.vetoes.chisq_cupy module
- pycbc.vetoes.sgchisq module
- Module contents
- pycbc.waveform package
- Submodules
- pycbc.waveform.bank module
FilterBank
FilterBankSkyMax
LiveFilterBank
TemplateBank
TemplateBank.table
TemplateBank.has_compressed_waveforms
TemplateBank.indoc
TemplateBank.filehandler
TemplateBank.extra_args
TemplateBank.approximant()
TemplateBank.end_frequency()
TemplateBank.ensure_hash()
TemplateBank.ensure_standard_filter_columns()
TemplateBank.parameters
TemplateBank.parse_approximant()
TemplateBank.template_thinning()
TemplateBank.write_to_hdf()
add_approximant_arg()
boolargs_from_apprxstr()
find_variable_start_frequency()
parse_approximant_arg()
sigma_cached()
tuple_to_hash()
- pycbc.waveform.compress module
CompressedWaveform
CompressedWaveform.load_to_memory
CompressedWaveform.interpolation
CompressedWaveform.tolerance
CompressedWaveform.mismatch
CompressedWaveform.precision
CompressedWaveform.amplitude
CompressedWaveform.clear_cache()
CompressedWaveform.decompress()
CompressedWaveform.from_hdf()
CompressedWaveform.phase
CompressedWaveform.sample_points
CompressedWaveform.write_to_hdf()
compress_waveform()
fd_decompress()
inline_linear_interp()
mchirp_compression()
rough_time_estimate()
spa_compression()
vecdiff()
- pycbc.waveform.decompress_cpu module
- pycbc.waveform.decompress_cpu_cython module
- pycbc.waveform.generator module
BaseCBCGenerator
BaseFDomainDetFrameGenerator
BaseFDomainDetFrameGenerator.detectors
BaseFDomainDetFrameGenerator.detector_names
BaseFDomainDetFrameGenerator.current_params
BaseFDomainDetFrameGenerator.rframe_generator
BaseFDomainDetFrameGenerator.frozen_location_args
BaseFDomainDetFrameGenerator.variable_args
BaseFDomainDetFrameGenerator.epoch
BaseFDomainDetFrameGenerator.generate()
BaseFDomainDetFrameGenerator.location_args
BaseFDomainDetFrameGenerator.select_rframe_generator()
BaseFDomainDetFrameGenerator.set_epoch()
BaseFDomainDetFrameGenerator.static_args
BaseGenerator
FDomainCBCGenerator
FDomainCBCModesGenerator
FDomainDetFrameGenerator
FDomainDetFrameGenerator.detectors
FDomainDetFrameGenerator.detector_names
FDomainDetFrameGenerator.epoch
FDomainDetFrameGenerator.current_params
FDomainDetFrameGenerator.rframe_generator
FDomainDetFrameGenerator.frozen_location_args
FDomainDetFrameGenerator.variable_args
FDomainDetFrameGenerator.generate()
FDomainDetFrameGenerator.location_args
FDomainDetFrameGenerator.select_rframe_generator()
FDomainDetFrameModesGenerator
FDomainDetFrameModesGenerator.detectors
FDomainDetFrameModesGenerator.detector_names
FDomainDetFrameModesGenerator.epoch
FDomainDetFrameModesGenerator.current_params
FDomainDetFrameModesGenerator.rframe_generator
FDomainDetFrameModesGenerator.frozen_location_args
FDomainDetFrameModesGenerator.variable_args
FDomainDetFrameModesGenerator.generate()
FDomainDetFrameModesGenerator.location_args
FDomainDetFrameModesGenerator.select_rframe_generator()
FDomainDetFrameTwoPolGenerator
FDomainDetFrameTwoPolGenerator.detectors
FDomainDetFrameTwoPolGenerator.detector_names
FDomainDetFrameTwoPolGenerator.epoch
FDomainDetFrameTwoPolGenerator.current_params
FDomainDetFrameTwoPolGenerator.rframe_generator
FDomainDetFrameTwoPolGenerator.frozen_location_args
FDomainDetFrameTwoPolGenerator.variable_args
FDomainDetFrameTwoPolGenerator.generate()
FDomainDetFrameTwoPolGenerator.location_args
FDomainDetFrameTwoPolGenerator.select_rframe_generator()
FDomainDetFrameTwoPolNoRespGenerator
FDomainDetFrameTwoPolNoRespGenerator.detectors
FDomainDetFrameTwoPolNoRespGenerator.detector_names
FDomainDetFrameTwoPolNoRespGenerator.epoch
FDomainDetFrameTwoPolNoRespGenerator.current_params
FDomainDetFrameTwoPolNoRespGenerator.rframe_generator
FDomainDetFrameTwoPolNoRespGenerator.frozen_location_args
FDomainDetFrameTwoPolNoRespGenerator.variable_args
FDomainDetFrameTwoPolNoRespGenerator.generate()
FDomainDetFrameTwoPolNoRespGenerator.select_rframe_generator()
FDomainDirectDetFrameGenerator
FDomainFreqTauRingdownGenerator
FDomainMassSpinRingdownGenerator
TDomainCBCGenerator
TDomainCBCModesGenerator
TDomainFreqTauRingdownGenerator
TDomainMassSpinRingdownGenerator
TDomainSupernovaeGenerator
get_fd_generator()
get_td_generator()
select_waveform_generator()
select_waveform_modes_generator()
- pycbc.waveform.multiband module
- pycbc.waveform.nltides module
- pycbc.waveform.parameters module
Parameter
ParameterList
ParameterList.asdict
ParameterList.aslist
ParameterList.default_dict()
ParameterList.defaults()
ParameterList.description_dict
ParameterList.descriptions
ParameterList.docstr()
ParameterList.dtype_dict
ParameterList.dtypes
ParameterList.label_dict
ParameterList.labels
ParameterList.names
ParameterList.nodefaults
- pycbc.waveform.plugin module
- pycbc.waveform.premerger module
- pycbc.waveform.pycbc_phenomC_tmplt module
- pycbc.waveform.ringdown module
Kerr_factor()
fd_damped_sinusoid()
fd_output_vector()
format_lmns()
get_fd_from_final_mass_spin()
get_fd_from_freqtau()
get_td_from_final_mass_spin()
get_td_from_freqtau()
lm_amps_phases()
lm_arbitrary_harmonics()
lm_deltaf()
lm_deltat()
lm_ffinal()
lm_freqs_taus()
lm_tfinal()
multimode_base()
parse_mode()
props()
qnm_freq_decay()
qnm_time_decay()
spher_harms()
td_damped_sinusoid()
td_output_vector()
- pycbc.waveform.sinegauss module
- pycbc.waveform.spa_tmplt module
- pycbc.waveform.spa_tmplt_cpu module
- pycbc.waveform.spa_tmplt_cupy module
- pycbc.waveform.supernovae module
- pycbc.waveform.utils module
amplitude_from_frequencyseries()
amplitude_from_polarizations()
apply_fd_time_shift()
apply_fseries_time_shift()
ceilpow2()
coalign_waveforms()
fd_taper()
fd_to_td()
frequency_from_polarizations()
phase_from_frequencyseries()
phase_from_polarizations()
taper_timeseries()
td_taper()
time_from_frequencyseries()
- pycbc.waveform.utils_cpu module
- pycbc.waveform.utils_cupy module
- pycbc.waveform.waveform module
FailedWaveformError
NoWaveformError
fd_approximants()
filter_approximants()
get_fd_det_waveform()
get_fd_det_waveform_sequence()
get_fd_waveform()
get_fd_waveform_from_td()
get_fd_waveform_sequence()
get_sgburst_waveform()
get_td_det_waveform_from_fd_det()
get_td_waveform()
get_td_waveform_from_fd()
get_template_amplitude_norm()
get_two_pol_waveform_filter()
get_waveform_end_frequency()
get_waveform_filter()
get_waveform_filter_length_in_time()
get_waveform_filter_norm()
print_fd_approximants()
print_sgburst_approximants()
print_td_approximants()
sgburst_approximants()
td_approximants()
td_waveform_to_fd_waveform()
waveform_norm_exists()
- pycbc.waveform.waveform_modes module
- Module contents
- pycbc.workflow package
- Submodules
- pycbc.workflow.coincidence module
CensorForeground
MergeExecutable
PyCBCAddStatmap
PyCBCBank2HDFExecutable
PyCBCCombineStatmap
PyCBCDistributeBackgroundBins
PyCBCExcludeZerolag
PyCBCFindCoincExecutable
PyCBCFindSnglsExecutable
PyCBCFitByTemplateExecutable
PyCBCFitOverParamExecutable
PyCBCHDFInjFindExecutable
PyCBCSnglsStatMapExecutable
PyCBCSnglsStatMapInjExecutable
PyCBCStatMapExecutable
PyCBCStatMapInjExecutable
PyCBCTrig2HDFExecutable
convert_bank_to_hdf()
convert_trig_to_hdf()
find_injections_in_hdf_coinc()
get_ordered_ifo_list()
make_foreground_censored_veto()
merge_single_detector_hdf_files()
rerank_coinc_followup()
select_files_by_ifo_combination()
setup_combine_statmap()
setup_exclude_zerolag()
setup_interval_coinc()
setup_interval_coinc_inj()
setup_sngls()
setup_sngls_inj()
setup_sngls_statmap()
setup_sngls_statmap_inj()
setup_statmap()
setup_statmap_inj()
setup_trigger_fitting()
- pycbc.workflow.configparser_test module
- pycbc.workflow.configuration module
- pycbc.workflow.core module
CalledProcessErrorMod
Executable
Executable.ALL_TRIGGERS
Executable.DO_NOT_KEEP
Executable.FINAL_RESULT
Executable.INTERMEDIATE_PRODUCT
Executable.KEEP_BUT_RAISE_WARNING
Executable.MERGED_TRIGGERS
Executable.add_ini_profile()
Executable.add_opt()
Executable.create_node()
Executable.current_retention_level
Executable.file_input_options
Executable.get_opt()
Executable.get_transformation()
Executable.has_opt()
Executable.ifo
Executable.time_dependent_options
Executable.update_current_retention_level()
Executable.update_current_tags()
Executable.update_output_directory()
File
FileList
FileList.categorize_by_attr()
FileList.convert_to_lal_cache()
FileList.dump()
FileList.entry_class
FileList.find_all_output_in_range()
FileList.find_output()
FileList.find_output_at_time()
FileList.find_output_in_range()
FileList.find_output_with_ifo()
FileList.find_output_with_tag()
FileList.find_output_without_tag()
FileList.find_outputs_in_range()
FileList.get_times_covered_by_files()
FileList.load()
FileList.to_file_object()
Node
SegFile
Workflow
add_workflow_settings_cli()
configparser_value_to_file()
get_full_analysis_chunk()
get_random_label()
make_analysis_dir()
make_external_call()
resolve_td_option()
resolve_url_to_file()
- pycbc.workflow.datafind module
convert_cachelist_to_filelist()
datafind_keep_unique_backups()
get_missing_segs_from_frame_file_cache()
get_science_segs_from_datafind_outs()
get_segment_summary_times()
log_datafind_command()
run_datafind_instance()
setup_datafind_from_pregenerated_lcf_files()
setup_datafind_runtime_cache_multi_calls_perifo()
setup_datafind_runtime_cache_single_call_perifo()
setup_datafind_runtime_frames_multi_calls_perifo()
setup_datafind_runtime_frames_single_call_perifo()
setup_datafind_workflow()
- pycbc.workflow.dq module
- pycbc.workflow.grb_utils module
PycbcGrbInjFinderExecutable
PycbcGrbTrigClusterExecutable
PycbcGrbTrigCombinerExecutable
build_segment_filelist()
fermi_core_tail_model()
generate_tc_prior()
get_sky_grid_scale()
make_gating_node()
make_pygrb_info_table()
make_pygrb_injs_tables()
make_pygrb_plot()
make_skygrid_node()
set_grb_start_end()
setup_pygrb_minifollowups()
setup_pygrb_pp_workflow()
setup_pygrb_results_workflow()
- pycbc.workflow.inference_followups module
create_fits_file()
create_posterior_files()
get_diagnostic_plots()
get_plot_group()
make_diagnostic_plots()
make_inference_acceptance_rate_plot()
make_inference_dynesty_run_plot()
make_inference_dynesty_trace_plot()
make_inference_inj_recovery_plot()
make_inference_plot()
make_inference_plot_mcmc_history()
make_inference_posterior_plot()
make_inference_pp_plot()
make_inference_pp_table()
make_inference_prior_plot()
make_inference_samples_plot()
make_inference_skymap()
make_inference_summary_table()
make_posterior_workflow()
- pycbc.workflow.injection module
- pycbc.workflow.jobsetup module
JobSegmenter
LalappsInspinjExecutable
LigolwAddExecutable
PyCBCInspiralExecutable
PyCBCMultiInspiralExecutable
PyCBCTmpltbankExecutable
PycbcConditionStrainExecutable
PycbcCreateInjectionsExecutable
PycbcHDFSplitInjExecutable
PycbcInferenceExecutable
PycbcSplitBankExecutable
PycbcSplitBankXmlExecutable
PycbcSplitInspinjExecutable
identify_needed_data()
int_gps_time_to_str()
multi_ifo_coherent_job_setup()
select_generic_executable()
select_matchedfilter_class()
select_tmpltbank_class()
sngl_ifo_job_setup()
- pycbc.workflow.matched_filter module
- pycbc.workflow.minifollowups module
PlotQScanExecutable
SingleTemplateExecutable
SingleTimeFreqExecutable
get_single_template_params()
grouper()
make_coinc_info()
make_inj_info()
make_plot_waveform_plot()
make_qscan_plot()
make_single_template_files()
make_single_template_plots()
make_singles_timefreq()
make_skipped_html()
make_sngl_ifo()
make_trigger_timeseries()
make_upload_files()
setup_foreground_minifollowups()
setup_injection_minifollowups()
setup_single_det_minifollowups()
setup_upload_prep_minifollowups()
- pycbc.workflow.pegasus_sites module
- pycbc.workflow.pegasus_workflow module
- pycbc.workflow.plotting module
PlotExecutable
excludestr()
make_binned_hist()
make_coinc_snrchi_plot()
make_dq_flag_trigger_rate_plot()
make_dq_segment_table()
make_foreground_table()
make_foundmissed_plot()
make_gating_plot()
make_ifar_plot()
make_inj_table()
make_range_plot()
make_results_web_page()
make_seg_plot()
make_seg_table()
make_segments_plot()
make_sensitivity_plot()
make_single_hist()
make_singles_plot()
make_snrchi_plot()
make_snrifar_plot()
make_snrratehist_plot()
make_spectrum_plot()
make_template_bin_table()
make_template_plot()
make_throughput_plot()
make_veto_table()
requirestr()
- pycbc.workflow.psd module
- pycbc.workflow.psdfiles module
- pycbc.workflow.segment module
- pycbc.workflow.splittable module
- pycbc.workflow.tmpltbank module
- pycbc.workflow.versioning module
- Module contents
Submodules
pycbc.bin_utils module
- class pycbc.bin_utils.BinnedArray(bins, array=None, dtype='double')[source]
Bases:
object
A convenience wrapper, using the NDBins class to provide access to the elements of an array object. Technical reasons preclude providing a subclass of the array object, so the array data is made available as the “array” attribute of this class.
Examples:
Note that even for 1 dimensional arrays the index must be a tuple.
>>> x = BinnedArray(NDBins((LinearBins(0, 10, 5),))) >>> x.array array([ 0., 0., 0., 0., 0.]) >>> x[0,] += 1 >>> x[0.5,] += 1 >>> x.array array([ 2., 0., 0., 0., 0.]) >>> x.argmax() (1.0,)
Note the relationship between the binning limits, the bin centres, and the co-ordinates of the BinnedArray
>>> x = BinnedArray(NDBins((LinearBins(-0.5, 1.5, 2), LinearBins(-0.5, 1.5, 2)))) >>> x.bins.centres() (array([ 0., 1.]), array([ 0., 1.])) >>> x[0, 0] = 0 >>> x[0, 1] = 1 >>> x[1, 0] = 2 >>> x[1, 1] = 4 >>> x.array array([[ 0., 1.], [ 2., 4.]]) >>> x[0, 0] 0.0 >>> x[0, 1] 1.0 >>> x[1, 0] 2.0 >>> x[1, 1] 4.0 >>> x.argmin() (0.0, 0.0) >>> x.argmax() (1.0, 1.0)
- argmax()[source]
Return the co-ordinates of the bin centre containing the maximum value. Same as numpy.argmax(), converting the indexes to bin co-ordinates.
- class pycbc.bin_utils.BinnedRatios(bins, dtype='double')[source]
Bases:
object
Like BinnedArray, but provides a numerator array and a denominator array. The incnumerator() method increments a bin in the numerator by the given weight, and the incdenominator() method increments a bin in the denominator by the given weight. There are no methods provided for setting or decrementing either, but the they are accessible as the numerator and denominator attributes, which are both BinnedArray objects.
- class pycbc.bin_utils.Bins(minv, maxv, n)[source]
Bases:
object
Parent class for 1-dimensional binnings.
Not intended to be used directly, but to be subclassed for use in real bins classes.
- class pycbc.bin_utils.IrregularBins(boundaries)[source]
Bases:
Bins
Bins with arbitrary, irregular spacing. We only require strict monotonicity of the bin boundaries. N boundaries define N-1 bins.
Example:
>>> x = IrregularBins([0.0, 11.0, 15.0, numpy.inf]) >>> len(x) 3 >>> x[1] 0 >>> x[1.5] 0 >>> x[13] 1 >>> x[25] 2 >>> x[4:17] slice(0, 3, None) >>> IrregularBins([0.0, 15.0, 11.0]) Traceback (most recent call last): ... ValueError: non-monotonic boundaries provided >>> y = IrregularBins([0.0, 11.0, 15.0, numpy.inf]) >>> x == y True
- class pycbc.bin_utils.LinearBins(minv, maxv, n)[source]
Bases:
Bins
Linearly-spaced bins. There are n bins of equal size, the first bin starts on the lower bound and the last bin ends on the upper bound inclusively.
Example:
>>> x = LinearBins(1.0, 25.0, 3) >>> x.lower() array([ 1., 9., 17.]) >>> x.upper() array([ 9., 17., 25.]) >>> x.centres() array([ 5., 13., 21.]) >>> x[1] 0 >>> x[1.5] 0 >>> x[10] 1 >>> x[25] 2 >>> x[0:27] Traceback (most recent call last): ... IndexError: 0 >>> x[1:25] slice(0, 3, None) >>> x[:25] slice(0, 3, None) >>> x[10:16.9] slice(1, 2, None) >>> x[10:17] slice(1, 3, None) >>> x[10:] slice(1, 3, None)
- class pycbc.bin_utils.LinearPlusOverflowBins(minv, maxv, n)[source]
Bases:
Bins
Linearly-spaced bins with overflow at the edges.
There are n-2 bins of equal size. The bin 1 starts on the lower bound and bin n-2 ends on the upper bound. Bins 0 and n-1 are overflow going from -infinity to the lower bound and from the upper bound to +infinity respectively. Must have n >= 3.
Example:
>>> x = LinearPlusOverflowBins(1.0, 25.0, 5) >>> x.centres() array([-inf, 5., 13., 21., inf]) >>> x.lower() array([-inf, 1., 9., 17., 25.]) >>> x.upper() array([ 1., 9., 17., 25., inf]) >>> x[float("-inf")] 0 >>> x[0] 0 >>> x[1] 1 >>> x[10] 2 >>> x[24.99999999] 3 >>> x[25] 4 >>> x[100] 4 >>> x[float("+inf")] 4 >>> x[float("-inf"):9] slice(0, 3, None) >>> x[9:float("+inf")] slice(2, 5, None)
- class pycbc.bin_utils.LogarithmicBins(minv, maxv, n)[source]
Bases:
Bins
Logarithmically-spaced bins.
There are n bins, each of whose upper and lower bounds differ by the same factor. The first bin starts on the lower bound, and the last bin ends on the upper bound inclusively.
Example:
>>> x = LogarithmicBins(1.0, 25.0, 3) >>> x[1] 0 >>> x[5] 1 >>> x[25] 2
- class pycbc.bin_utils.LogarithmicPlusOverflowBins(minv, maxv, n)[source]
Bases:
Bins
Logarithmically-spaced bins plus one bin at each end that goes to zero and positive infinity respectively. There are n-2 bins each of whose upper and lower bounds differ by the same factor. Bin 1 starts on the lower bound, and bin n-2 ends on the upper bound inclusively. Bins 0 and n-1 are overflow bins extending from 0 to the lower bound and from the upper bound to +infinity respectively. Must have n >= 3.
Example:
>>> x = LogarithmicPlusOverflowBins(1.0, 25.0, 5) >>> x[0] 0 >>> x[1] 1 >>> x[5] 2 >>> x[24.999] 3 >>> x[25] 4 >>> x[100] 4 >>> x.lower() array([ 0. , 1. , 2.92401774, 8.54987973, 25. ]) >>> x.upper() array([ 1. , 2.92401774, 8.54987973, 25. , inf]) >>> x.centres() array([ 0. , 1.70997595, 5. , 14.62008869, inf])
- class pycbc.bin_utils.NDBins(*args)[source]
Bases:
tuple
Multi-dimensional co-ordinate binning. An instance of this object is used to convert a tuple of co-ordinates into a tuple of bin indices. This can be used to allow the contents of an array object to be accessed with real-valued coordinates.
NDBins is a subclass of the tuple builtin, and is initialized with an iterable of instances of subclasses of Bins. Each Bins subclass instance describes the binning to apply in the corresponding co-ordinate direction, and the number of them sets the dimensions of the binning.
Example:
>>> x = NDBins((LinearBins(1, 25, 3), LogarithmicBins(1, 25, 3))) >>> x[1, 1] (0, 0) >>> x[1.5, 1] (0, 0) >>> x[10, 1] (1, 0) >>> x[1, 5] (0, 1) >>> x[1, 1:5] (0, slice(0, 2, None)) >>> x.centres() (array([ 5., 13., 21.]), array([ 1.70997595, 5. , 14.62008869]))
Note that the co-ordinates to be converted must be a tuple, even if it is only a 1-dimensional co-ordinate.
- centres()[source]
Return a tuple of arrays, where each array contains the locations of the bin centres for the corresponding dimension.
pycbc.boundaries module
This modules provides utilities for manipulating parameter boundaries. Namely, classes are offered that will map values to a specified domain using either cyclic boundaries or reflected boundaries.
- class pycbc.boundaries.Bounds(min_bound=-inf, max_bound=inf, btype_min='closed', btype_max='open', cyclic=False)[source]
Bases:
object
Creates and stores bounds using the given values.
The type of boundaries used can be set using the btype_(min|max) parameters. These arguments set what kind of boundary is used at the minimum and maximum bounds. Specifically, if btype_min (btype_max) is set to:
“open”: the minimum (maximum) boundary will be an instance of OpenBound. This means that a value must be > (<) the bound for it to be considered within the bounds.
“closed”: the minimum (maximum) boundary will be an instance of ClosedBound. This means that a value must be >= (<=) the bound for it to be considered within the bounds.
“reflected”: the minimum (maximum) boundary will be an isntance of ReflectedBound. This means that a value will be reflected to the right (left) if apply_conditions is used on the value. For more details see apply_conditions.
If the cyclic keyword is set to True, then apply_conditions will cause values to be wrapped around to the minimum (maximum) bound if the value is > (<=) the maximum (minimum) bound. For more details see apply_conditions.
Values can be checked whether or not they occur within the bounds using in; e.g., 6 in bounds. This is done without applying any boundary conditions. To apply conditions, then check whether the value is in bounds, use the contains_conditioned method.
The default is for the minimum bound to be “closed” and the maximum bound to be “open”, i.e., a right-open interval.
- Parameters:
min_bound ({-numpy.inf, float}) – The value of the lower bound. Default is -inf.
max_bound ({numpy.inf, float}) – The value of the upper bound. Default is inf.
btype_min ({'open', string}) – The type of the lower bound; options are “closed”, “open”, or “reflected”. Default is “closed”.
btype_min – The type of the lower bound; options are “closed”, “open”, or “reflected”. Default is “open”.
cyclic ({False, bool}) – Whether or not to make the bounds cyclic; default is False. If True, both the minimum and maximum bounds must be finite.
Examples
Create a right-open interval between -1 and 1 and test whether various values are within them: >>> bounds = Bounds(-1., 1.) >>> -1 in bounds True >>> 0 in bounds True >>> 1 in bounds False
Create an open interval between -1 and 1 and test the same values: >>> bounds = Bounds(-1, 1, btype_min=”open”) >>> -1 in bounds False >>> 0 in bounds True >>> 1 in bounds False
Create cyclic bounds between -1 and 1 and plot the effect of conditioning on points between -10 and 10: >>> bounds = Bounds(-1, 1, cyclic=True) >>> x = numpy.linspace(-10, 10, num=1000) >>> conditioned_x = bounds.apply_conditions(x) >>> fig = pyplot.figure() >>> ax = fig.add_subplot(111) >>> ax.plot(x, x, c=’b’, lw=2, label=’input’) >>> ax.plot(conditioned_x, x, c=’r’, lw=1) >>> ax.vlines([-1., 1.], x.min(), x.max(), color=’k’, linestyle=’–‘) >>> ax.set_title(‘cyclic bounds between x=-1,1’) >>> fig.show()
Create a reflected bound at -1 and plot the effect of conditioning: >>> bounds = Bounds(-1, 1, btype_min=’reflected’) >>> x = numpy.linspace(-10, 10, num=1000) >>> conditioned_x = bounds.apply_conditions(x) >>> fig = pyplot.figure() >>> ax = fig.add_subplot(111) >>> ax.plot(x, x, c=’b’, lw=2, label=’input’) >>> ax.plot(conditioned_x, x, c=’r’, lw=1) >>> ax.vlines([-1., 1.], x.min(), x.max(), color=’k’, linestyle=’–‘) >>> ax.set_title(‘reflected right at x=-1’) >>> fig.show()
Create a reflected bound at 1 and plot the effect of conditioning: >>> bounds = Bounds(-1, 1, btype_max=’reflected’) >>> x = numpy.linspace(-10, 10, num=1000) >>> conditioned_x = bounds.apply_conditions(x) >>> fig = pyplot.figure() >>> ax = fig.add_subplot(111) >>> ax.plot(x, x, c=’b’, lw=2, label=’input’) >>> ax.plot(conditioned_x, x, c=’r’, lw=1) >>> ax.vlines([-1., 1.], x.min(), x.max(), color=’k’, linestyle=’–‘) >>> ax.set_title(‘reflected left at x=1’) >>> fig.show()
Create reflected bounds at -1 and 1 and plot the effect of conditioning: >>> bounds = Bounds(-1, 1, btype_min=’reflected’, btype_max=’reflected’) >>> x = numpy.linspace(-10, 10, num=1000) >>> conditioned_x = bounds.apply_conditions(x) >>> fig = pyplot.figure() >>> ax = fig.add_subplot(111) >>> ax.plot(x, x, c=’b’, lw=2, label=’input’) >>> ax.plot(conditioned_x, x, c=’r’, lw=1) >>> ax.vlines([-1., 1.], x.min(), x.max(), color=’k’, linestyle=’–‘) >>> ax.set_title(‘reflected betewen x=-1,1’) >>> fig.show()
- apply_conditions(value)[source]
Applies any boundary conditions to the given value.
The value is manipulated according based on the following conditions:
If self.cyclic is True then value is wrapped around to the minimum (maximum) bound if value is >= self.max (< self.min) bound. For example, if the minimum and maximum bounds are 0, 2*pi and value = 5*pi, then the returned value will be pi.
If self.min is a reflected boundary then value will be reflected to the right if it is < self.min. For example, if self.min = 10 and value = 3, then the returned value will be 17.
If self.max is a reflected boundary then value will be reflected to the left if it is > self.max. For example, if self.max = 20 and value = 27, then the returned value will be 13.
If self.min and self.max are both reflected boundaries, then value will be reflected between the two boundaries until it falls within the bounds. The first reflection occurs off of the maximum boundary. For example, if self.min = 10, self.max = 20, and value = 42, the returned value will be 18 ( the first reflection yields -2, the second 22, and the last 18).
If neither bounds are reflected and cyclic is False, then the value is just returned as-is.
- contains_conditioned(value)[source]
Runs apply_conditions on the given value before testing whether it is in bounds. Note that if cyclic is True, or both bounds are reflected, than this will always return True.
- property max
The maximum bound
- Type:
_bounds instance
- property min
The minimum bound
- Type:
_bounds instance
- class pycbc.boundaries.ClosedBound(x=0, /)[source]
Bases:
_Bound
Sets larger and smaller functions to be >= and <=, respectively.
- larger(other)[source]
A function to determine whether or not other is larger than the bound. This raises a NotImplementedError; classes that inherit from this must define it.
- name = 'closed'
- class pycbc.boundaries.OpenBound(x=0, /)[source]
Bases:
_Bound
Sets larger and smaller functions to be > and <, respectively.
- name = 'open'
- class pycbc.boundaries.ReflectedBound(x=0, /)[source]
Bases:
ClosedBound
Inherits from ClosedBound, adding reflection functions.
- name = 'reflected'
- pycbc.boundaries.apply_cyclic(value, bounds)[source]
Given a value, applies cyclic boundary conditions between the minimum and maximum bounds.
- pycbc.boundaries.reflect_well(value, bounds)[source]
Given some boundaries, reflects the value until it falls within both boundaries. This is done iteratively, reflecting left off of the boundaries.max, then right off of the boundaries.min, etc.
- Parameters:
value (float) – The value to apply the reflected boundaries to.
bounds (Bounds instance) – Boundaries to reflect between. Both bounds.min and bounds.max must be instances of ReflectedBound, otherwise an AttributeError is raised.
- Returns:
The value after being reflected between the two bounds.
- Return type:
pycbc.conversions module
This module provides a library of functions that calculate waveform parameters from other parameters. All exposed functions in this module’s namespace return one parameter given a set of inputs.
- pycbc.conversions.chi_a(mass1, mass2, spin1z, spin2z)[source]
Returns the aligned mass-weighted spin difference from mass1, mass2, spin1z, and spin2z.
- pycbc.conversions.chi_eff(mass1, mass2, spin1z, spin2z)[source]
Returns the effective spin from mass1, mass2, spin1z, and spin2z.
- pycbc.conversions.chi_eff_from_spherical(mass1, mass2, spin1_a, spin1_polar, spin2_a, spin2_polar)[source]
Returns the effective spin using spins in spherical coordinates.
- pycbc.conversions.chi_p(mass1, mass2, spin1x, spin1y, spin2x, spin2y)[source]
Returns the effective precession spin from mass1, mass2, spin1x, spin1y, spin2x, and spin2y.
- pycbc.conversions.chi_p_from_spherical(mass1, mass2, spin1_a, spin1_azimuthal, spin1_polar, spin2_a, spin2_azimuthal, spin2_polar)[source]
Returns the effective precession spin using spins in spherical coordinates.
- pycbc.conversions.chi_p_from_xi1_xi2(xi1, xi2)[source]
Returns effective precession spin from xi1 and xi2.
- pycbc.conversions.chi_perp_from_mass1_mass2_xi2(mass1, mass2, xi2)[source]
Returns the in-plane spin from mass1, mass2, and xi2 for the secondary mass.
- pycbc.conversions.chi_perp_from_spinx_spiny(spinx, spiny)[source]
Returns the in-plane spin from the x/y components of the spin.
- pycbc.conversions.chirp_distance(dist, mchirp, ref_mass=1.4)[source]
Returns the chirp distance given the luminosity distance and chirp mass.
- pycbc.conversions.delta_lambda_tilde(mass1, mass2, lambda1, lambda2)[source]
Delta lambda tilde parameter defined as equation 15 in https://journals.aps.org/prd/pdf/10.1103/PhysRevD.91.043002
- pycbc.conversions.det_tc(detector_name, ra, dec, tc, ref_frame='geocentric', relative=False)[source]
Returns the coalescence time of a signal in the given detector.
- Parameters:
detector_name (string) – The name of the detector, e.g., ‘H1’.
ra (float) – The right ascension of the signal, in radians.
dec (float) – The declination of the signal, in radians.
tc (float) – The GPS time of the coalescence of the signal in the ref_frame.
ref_frame ({'geocentric', string}) – The reference frame that the given coalescence time is defined in. May specify ‘geocentric’, or a detector name; default is ‘geocentric’.
- Returns:
The GPS time of the coalescence in detector detector_name.
- Return type:
- pycbc.conversions.dquadmon_from_lambda(lambdav)[source]
Return the quadrupole moment of a neutron star given its lambda
We use the relations defined here. https://arxiv.org/pdf/1302.4499.pdf. Note that the convention we use is that:
\[\mathrm{dquadmon} = \bar{Q} - 1.\]Where \(\bar{Q}\) (dimensionless) is the reduced quadrupole moment.
- pycbc.conversions.eta_from_mass1_mass2(mass1, mass2)[source]
Returns the symmetric mass ratio from mass1 and mass2.
- pycbc.conversions.eta_from_q(q)[source]
Returns the symmetric mass ratio from the given mass ratio.
This is given by:
\[\eta = \frac{q}{(1+q)^2}.\]Note that the mass ratio may be either < 1 or > 1.
- pycbc.conversions.eta_from_tau0_tau3(tau0, tau3, f_lower)[source]
Returns symmetric mass ratio from \(\tau_0, \tau_3\).
- pycbc.conversions.final_mass_from_f0_tau(f0, tau, l=2, m=2)[source]
Returns the final mass (in solar masses) based on the given frequency and damping time.
Note
Currently, only (l,m) = (2,2), (3,3), (4,4), (2,1) are supported. Any other indices will raise a
KeyError
.- Parameters:
- Returns:
The mass of the final black hole. If the combination of frequency and damping times give an unphysical result,
numpy.nan
will be returned.- Return type:
float or array
- pycbc.conversions.final_mass_from_initial(mass1, mass2, spin1x=0.0, spin1y=0.0, spin1z=0.0, spin2x=0.0, spin2y=0.0, spin2z=0.0, approximant='SEOBNRv4PHM', f_ref=-1)[source]
Estimates the final mass from the given initial parameters.
This uses the fits used by either the NRSur7dq4 or EOBNR models for converting from initial parameters to final, depending on the
approximant
argument.- Parameters:
mass1 (float) – The mass of one of the components, in solar masses.
mass2 (float) – The mass of the other component, in solar masses.
spin1x (float, optional) – The dimensionless x-component of the spin of mass1. Default is 0.
spin1y (float, optional) – The dimensionless y-component of the spin of mass1. Default is 0.
spin1z (float, optional) – The dimensionless z-component of the spin of mass1. Default is 0.
spin2x (float, optional) – The dimensionless x-component of the spin of mass2. Default is 0.
spin2y (float, optional) – The dimensionless y-component of the spin of mass2. Default is 0.
spin2z (float, optional) – The dimensionless z-component of the spin of mass2. Default is 0.
approximant (str, optional) – The waveform approximant to use for the fit function. If “NRSur7dq4”, the NRSur7dq4Remnant fit in lalsimulation will be used. If “SEOBNRv4”, the
XLALSimIMREOBFinalMassSpin
function in lalsimulation will be used. Otherwise,XLALSimIMREOBFinalMassSpinPrec
from lalsimulation will be used, with the approximant name passed as the approximant in that function (“SEOBNRv4PHM” will work with this function). Default is “SEOBNRv4PHM”.f_ref (float, optional) – The reference frequency for the spins. Only used by the NRSur7dq4 fit. Default (-1) will use the default reference frequency for the approximant.
- Returns:
The final mass, in solar masses.
- Return type:
- pycbc.conversions.final_spin_from_f0_tau(f0, tau, l=2, m=2)[source]
Returns the final spin based on the given frequency and damping time.
Note
Currently, only (l,m) = (2,2), (3,3), (4,4), (2,1) are supported. Any other indices will raise a
KeyError
.- Parameters:
- Returns:
The spin of the final black hole. If the combination of frequency and damping times give an unphysical result,
numpy.nan
will be returned.- Return type:
float or array
- pycbc.conversions.final_spin_from_initial(mass1, mass2, spin1x=0.0, spin1y=0.0, spin1z=0.0, spin2x=0.0, spin2y=0.0, spin2z=0.0, approximant='SEOBNRv4PHM', f_ref=-1)[source]
Estimates the final spin from the given initial parameters.
This uses the fits used by either the NRSur7dq4 or EOBNR models for converting from initial parameters to final, depending on the
approximant
argument.- Parameters:
mass1 (float) – The mass of one of the components, in solar masses.
mass2 (float) – The mass of the other component, in solar masses.
spin1x (float, optional) – The dimensionless x-component of the spin of mass1. Default is 0.
spin1y (float, optional) – The dimensionless y-component of the spin of mass1. Default is 0.
spin1z (float, optional) – The dimensionless z-component of the spin of mass1. Default is 0.
spin2x (float, optional) – The dimensionless x-component of the spin of mass2. Default is 0.
spin2y (float, optional) – The dimensionless y-component of the spin of mass2. Default is 0.
spin2z (float, optional) – The dimensionless z-component of the spin of mass2. Default is 0.
approximant (str, optional) – The waveform approximant to use for the fit function. If “NRSur7dq4”, the NRSur7dq4Remnant fit in lalsimulation will be used. If “SEOBNRv4”, the
XLALSimIMREOBFinalMassSpin
function in lalsimulation will be used. Otherwise,XLALSimIMREOBFinalMassSpinPrec
from lalsimulation will be used, with the approximant name passed as the approximant in that function (“SEOBNRv4PHM” will work with this function). Default is “SEOBNRv4PHM”.f_ref (float, optional) – The reference frequency for the spins. Only used by the NRSur7dq4 fit. Default (-1) will use the default reference frequency for the approximant.
- Returns:
The dimensionless final spin.
- Return type:
- pycbc.conversions.freq_from_final_mass_spin(final_mass, final_spin, l=2, m=2, n=0)[source]
Returns QNM frequency for the given mass and spin and mode.
- Parameters:
final_mass (float or array) – Mass of the black hole (in solar masses).
final_spin (float or array) – Dimensionless spin of the final black hole.
l (int or array, optional) – l-index of the harmonic. Default is 2.
m (int or array, optional) – m-index of the harmonic. Default is 2.
n (int or array) – Overtone(s) to generate, where n=0 is the fundamental mode. Default is 0.
- Returns:
The frequency of the QNM(s), in Hz.
- Return type:
float or array
- pycbc.conversions.freqlmn_from_other_lmn(f0, tau, current_l, current_m, new_l, new_m)[source]
Returns the QNM frequency (in Hz) of a chosen new (l,m) mode from the given current (l,m) mode.
- Parameters:
f0 (float or array) – Frequency of the current QNM (in Hz).
tau (float or array) – Damping time of the current QNM (in seconds).
current_l (int, optional) – l-index of the current QNM.
current_m (int, optional) – m-index of the current QNM.
new_l (int, optional) – l-index of the new QNM to convert to.
new_m (int, optional) – m-index of the new QNM to convert to.
- Returns:
The frequency of the new (l, m) QNM mode. If the combination of frequency and damping time provided for the current (l, m) QNM mode correspond to an unphysical Kerr black hole mass and/or spin,
numpy.nan
will be returned.- Return type:
float or array
- pycbc.conversions.invq_from_mass1_mass2(mass1, mass2)[source]
Returns the inverse mass ratio m2/m1, where m1 >= m2.
- pycbc.conversions.lambda1_from_delta_lambda_tilde_lambda_tilde(delta_lambda_tilde, lambda_tilde, mass1, mass2)[source]
Returns lambda1 parameter by using delta lambda tilde, lambda tilde, mass1, and mass2.
- pycbc.conversions.lambda2_from_delta_lambda_tilde_lambda_tilde(delta_lambda_tilde, lambda_tilde, mass1, mass2)[source]
Returns lambda2 parameter by using delta lambda tilde, lambda tilde, mass1, and mass2.
- pycbc.conversions.lambda_from_mass_tov_file(mass, tov_file, distance=0.0)[source]
Return the lambda parameter(s) corresponding to the input mass(es) interpolating from the mass-Lambda data for a particular EOS read in from an ASCII file.
- pycbc.conversions.lambda_tilde(mass1, mass2, lambda1, lambda2)[source]
The effective lambda parameter
The mass-weighted dominant effective lambda parameter defined in https://journals.aps.org/prd/pdf/10.1103/PhysRevD.91.043002
- pycbc.conversions.mass1_from_mass2_eta(mass2, eta, force_real=True)[source]
Returns the primary mass from the secondary mass and symmetric mass ratio.
- pycbc.conversions.mass1_from_mchirp_eta(mchirp, eta)[source]
Returns the primary mass from the chirp mass and symmetric mass ratio.
- pycbc.conversions.mass1_from_mchirp_q(mchirp, q)[source]
Returns the primary mass from the given chirp mass and mass ratio.
- pycbc.conversions.mass1_from_mtotal_eta(mtotal, eta)[source]
Returns the primary mass from the total mass and symmetric mass ratio.
- pycbc.conversions.mass1_from_mtotal_q(mtotal, q)[source]
Returns a component mass from the given total mass and mass ratio.
If the mass ratio q is >= 1, the returned mass will be the primary (heavier) mass. If q < 1, the returned mass will be the secondary (lighter) mass.
- pycbc.conversions.mass1_from_tau0_tau3(tau0, tau3, f_lower)[source]
Returns the primary mass from the given \(\tau_0, \tau_3\).
- pycbc.conversions.mass2_from_mass1_eta(mass1, eta, force_real=True)[source]
Returns the secondary mass from the primary mass and symmetric mass ratio.
- pycbc.conversions.mass2_from_mchirp_eta(mchirp, eta)[source]
Returns the primary mass from the chirp mass and symmetric mass ratio.
- pycbc.conversions.mass2_from_mchirp_q(mchirp, q)[source]
Returns the secondary mass from the given chirp mass and mass ratio.
- pycbc.conversions.mass2_from_mtotal_eta(mtotal, eta)[source]
Returns the secondary mass from the total mass and symmetric mass ratio.
- pycbc.conversions.mass2_from_mtotal_q(mtotal, q)[source]
Returns a component mass from the given total mass and mass ratio.
If the mass ratio q is >= 1, the returned mass will be the secondary (lighter) mass. If q < 1, the returned mass will be the primary (heavier) mass.
- pycbc.conversions.mass2_from_tau0_tau3(tau0, tau3, f_lower)[source]
Returns the secondary mass from the given \(\tau_0, \tau_3\).
- pycbc.conversions.mchirp_from_mass1_mass2(mass1, mass2)[source]
Returns the chirp mass from mass1 and mass2.
- pycbc.conversions.mchirp_from_tau0(tau0, f_lower)[source]
Returns chirp mass from \(\tau_0\) and the given frequency.
- pycbc.conversions.mtotal_from_mass1_mass2(mass1, mass2)[source]
Returns the total mass from mass1 and mass2.
- pycbc.conversions.mtotal_from_mchirp_eta(mchirp, eta)[source]
Returns the total mass from the chirp mass and symmetric mass ratio.
- pycbc.conversions.mtotal_from_tau0_tau3(tau0, tau3, f_lower, in_seconds=False)[source]
Returns total mass from \(\tau_0, \tau_3\).
- pycbc.conversions.nltides_gw_phase_diff_isco(f_low, f0, amplitude, n, m1, m2)[source]
Calculate the gravitational-wave phase shift bwtween f_low and f_isco due to non-linear tides.
- Parameters:
f_low (float) – Frequency from which to compute phase. If the other arguments are passed as numpy arrays then the value of f_low is duplicated for all elements in the array
f0 (float or numpy.array) – Frequency that NL effects switch on
amplitude (float or numpy.array) – Amplitude of effect
n (float or numpy.array) – Growth dependence of effect
m1 (float or numpy.array) – Mass of component 1
m2 (float or numpy.array) – Mass of component 2
- Returns:
delta_phi – Phase in radians
- Return type:
float or numpy.array
- pycbc.conversions.optimal_dec_from_detector(detector_name, tc)[source]
For a given detector and GPS time, return the optimal orientation (directly overhead of the detector) in declination.
- pycbc.conversions.optimal_ra_from_detector(detector_name, tc)[source]
For a given detector and GPS time, return the optimal orientation (directly overhead of the detector) in right ascension.
- pycbc.conversions.phi1_from_phi_a_phi_s(phi_a, phi_s)[source]
Returns the angle between the x-component axis and the in-plane spin for the primary mass from phi_s and phi_a.
- pycbc.conversions.phi2_from_phi_a_phi_s(phi_a, phi_s)[source]
Returns the angle between the x-component axis and the in-plane spin for the secondary mass from phi_s and phi_a.
- pycbc.conversions.phi_a(mass1, mass2, spin1x, spin1y, spin2x, spin2y)[source]
Returns the angle between the in-plane perpendicular spins.
- pycbc.conversions.phi_from_spinx_spiny(spinx, spiny)[source]
Returns the angle between the x-component axis and the in-plane spin.
- pycbc.conversions.phi_s(spin1x, spin1y, spin2x, spin2y)[source]
Returns the sum of the in-plane perpendicular spins.
- pycbc.conversions.primary_mass(mass1, mass2)[source]
Returns the larger of mass1 and mass2 (p = primary).
- pycbc.conversions.primary_spin(mass1, mass2, spin1, spin2)[source]
Returns the dimensionless spin of the primary mass.
- pycbc.conversions.primary_xi(mass1, mass2, spin1x, spin1y, spin2x, spin2y)[source]
Returns the effective precession spin argument for the larger mass.
- pycbc.conversions.q_from_mass1_mass2(mass1, mass2)[source]
Returns the mass ratio m1/m2, where m1 >= m2.
- pycbc.conversions.remnant_mass_from_mass1_mass2_cartesian_spin_eos(mass1, mass2, spin1x=0.0, spin1y=0.0, spin1z=0.0, eos='2H', spin2x=0.0, spin2y=0.0, spin2z=0.0, swap_companions=False, ns_bh_mass_boundary=None, extrapolate=False)[source]
Function that determines the remnant disk mass of an NS-BH system using the fit to numerical-relativity results discussed in Foucart, Hinderer & Nissanke, PRD 98, 081501(R) (2018). The BH spin may be misaligned with the orbital angular momentum. In such cases the ISSO is approximated following the approach of Stone, Loeb & Berger, PRD 87, 084053 (2013), which was originally devised for a previous NS-BH remnant mass fit of Foucart, PRD 86, 124007 (2012). Note: NS spin is assumed to be 0!
- Parameters:
mass1 (float) – The mass of the black hole, in solar masses.
mass2 (float) – The mass of the neutron star, in solar masses.
spin1x (float, optional) – The dimensionless x-component of the spin of mass1. Default = 0.
spin1y (float, optional) – The dimensionless y-component of the spin of mass1. Default = 0.
spin1z (float, optional) – The dimensionless z-component of the spin of mass1. Default = 0.
eos (str, optional) – Name of the equation of state being adopted. Default is ‘2H’.
spin2x (float, optional) – The dimensionless x-component of the spin of mass2. Default = 0.
spin2y (float, optional) – The dimensionless y-component of the spin of mass2. Default = 0.
spin2z (float, optional) – The dimensionless z-component of the spin of mass2. Default = 0.
swap_companions (boolean, optional) – If mass2 > mass1, swap mass and spin of object 1 and 2 prior to applying the fitting formula (otherwise fail). Default is False.
ns_bh_mass_boundary (float, optional) – If mass2 is greater than this value, the neutron star is effectively treated as a black hole and the returned value is 0. For consistency with the eos, set this to the maximum mass allowed by the eos; set a lower value for a more stringent cut. Default is None.
extrapolate (boolean, optional) – Invoke extrapolation of NS baryonic mass and NS compactness in scipy.interpolate.interp1d at low masses. If ns_bh_mass_boundary is provided, it is applied at high masses, otherwise the equation of state prescribes the maximum possible mass2. Default is False.
- Returns:
remnant_mass – The remnant mass in solar masses
- Return type:
- pycbc.conversions.remnant_mass_from_mass1_mass2_spherical_spin_eos(mass1, mass2, spin1_a=0.0, spin1_polar=0.0, eos='2H', spin2_a=0.0, spin2_polar=0.0, swap_companions=False, ns_bh_mass_boundary=None, extrapolate=False)[source]
Function that determines the remnant disk mass of an NS-BH system using the fit to numerical-relativity results discussed in Foucart, Hinderer & Nissanke, PRD 98, 081501(R) (2018). The BH spin may be misaligned with the orbital angular momentum. In such cases the ISSO is approximated following the approach of Stone, Loeb & Berger, PRD 87, 084053 (2013), which was originally devised for a previous NS-BH remnant mass fit of Foucart, PRD 86, 124007 (2012). Note: The NS spin does not play any role in this fit!
- Parameters:
mass1 (float) – The mass of the black hole, in solar masses.
mass2 (float) – The mass of the neutron star, in solar masses.
spin1_a (float, optional) – The dimensionless magnitude of the spin of mass1. Default = 0.
spin1_polar (float, optional) – The tilt angle of the spin of mass1. Default = 0 (aligned w L).
eos (str, optional) – Name of the equation of state being adopted. Default is ‘2H’.
spin2_a (float, optional) – The dimensionless magnitude of the spin of mass2. Default = 0.
spin2_polar (float, optional) – The tilt angle of the spin of mass2. Default = 0 (aligned w L).
swap_companions (boolean, optional) – If mass2 > mass1, swap mass and spin of object 1 and 2 prior to applying the fitting formula (otherwise fail). Default is False.
ns_bh_mass_boundary (float, optional) – If mass2 is greater than this value, the neutron star is effectively treated as a black hole and the returned value is 0. For consistency with the eos, set this to the maximum mass allowed by the eos; set a lower value for a more stringent cut. Default is None.
extrapolate (boolean, optional) – Invoke extrapolation of NS baryonic mass and NS compactness in scipy.interpolate.interp1d at low masses. If ns_bh_mass_boundary is provided, it is applied at high masses, otherwise the equation of state prescribes the maximum possible mass2. Default is False.
- Returns:
remnant_mass – The remnant mass in solar masses
- Return type:
- pycbc.conversions.secondary_mass(mass1, mass2)[source]
Returns the smaller of mass1 and mass2 (s = secondary).
- pycbc.conversions.secondary_spin(mass1, mass2, spin1, spin2)[source]
Returns the dimensionless spin of the secondary mass.
- pycbc.conversions.secondary_xi(mass1, mass2, spin1x, spin1y, spin2x, spin2y)[source]
Returns the effective precession spin argument for the smaller mass.
- pycbc.conversions.snr_from_loglr(loglr)[source]
Returns SNR computed from the given log likelihood ratio(s). This is defined as sqrt(2*loglr).If the log likelihood ratio is < 0, returns 0.
- pycbc.conversions.spin1x_from_xi1_phi_a_phi_s(xi1, phi_a, phi_s)[source]
Returns x-component spin for primary mass.
- pycbc.conversions.spin1y_from_xi1_phi_a_phi_s(xi1, phi_a, phi_s)[source]
Returns y-component spin for primary mass.
- pycbc.conversions.spin1z_from_mass1_mass2_chi_eff_chi_a(mass1, mass2, chi_eff, chi_a)[source]
Returns spin1z.
- pycbc.conversions.spin2x_from_mass1_mass2_xi2_phi_a_phi_s(mass1, mass2, xi2, phi_a, phi_s)[source]
Returns x-component spin for secondary mass.
- pycbc.conversions.spin2y_from_mass1_mass2_xi2_phi_a_phi_s(mass1, mass2, xi2, phi_a, phi_s)[source]
Returns y-component spin for secondary mass.
- pycbc.conversions.spin2z_from_mass1_mass2_chi_eff_chi_a(mass1, mass2, chi_eff, chi_a)[source]
Returns spin2z.
- pycbc.conversions.spin_from_pulsar_freq(mass, radius, freq)[source]
Returns the dimensionless spin of a pulsar.
Assumes the pulsar is a solid sphere when computing the moment of inertia.
- pycbc.conversions.tau0_from_mass1_mass2(mass1, mass2, f_lower)[source]
Returns \(\tau_0\) from the component masses and given frequency.
- pycbc.conversions.tau0_from_mchirp(mchirp, f_lower)[source]
Returns \(\tau_0\) from the chirp mass and the given frequency.
- pycbc.conversions.tau0_from_mtotal_eta(mtotal, eta, f_lower)[source]
Returns \(\tau_0\) from the total mass, symmetric mass ratio, and the given frequency.
- pycbc.conversions.tau3_from_mass1_mass2(mass1, mass2, f_lower)[source]
Returns \(\tau_3\) from the component masses and given frequency.
- pycbc.conversions.tau3_from_mtotal_eta(mtotal, eta, f_lower)[source]
Returns \(\tau_0\) from the total mass, symmetric mass ratio, and the given frequency.
- pycbc.conversions.tau_from_final_mass_spin(final_mass, final_spin, l=2, m=2, n=0)[source]
Returns QNM damping time for the given mass and spin and mode.
- Parameters:
final_mass (float or array) – Mass of the black hole (in solar masses).
final_spin (float or array) – Dimensionless spin of the final black hole.
l (int or array, optional) – l-index of the harmonic. Default is 2.
m (int or array, optional) – m-index of the harmonic. Default is 2.
n (int or array) – Overtone(s) to generate, where n=0 is the fundamental mode. Default is 0.
- Returns:
The damping time of the QNM(s), in seconds.
- Return type:
float or array
- pycbc.conversions.taulmn_from_other_lmn(f0, tau, current_l, current_m, new_l, new_m)[source]
Returns the QNM damping time (in seconds) of a chosen new (l,m) mode from the given current (l,m) mode.
- Parameters:
f0 (float or array) – Frequency of the current QNM (in Hz).
tau (float or array) – Damping time of the current QNM (in seconds).
current_l (int, optional) – l-index of the current QNM.
current_m (int, optional) – m-index of the current QNM.
new_l (int, optional) – l-index of the new QNM to convert to.
new_m (int, optional) – m-index of the new QNM to convert to.
- Returns:
The daming time of the new (l, m) QNM mode. If the combination of frequency and damping time provided for the current (l, m) QNM mode correspond to an unphysical Kerr black hole mass and/or spin,
numpy.nan
will be returned.- Return type:
float or array
pycbc.cosmology module
This modules provides functions for computing cosmological quantities, such as
redshift. This is mostly a wrapper around astropy.cosmology
.
Note: in all functions, distance
is short hand for luminosity_distance
.
Any other distance measure is explicitly named; e.g., comoving_distance
.
- pycbc.cosmology.cosmological_quantity_from_redshift(z, quantity, strip_unit=True, **kwargs)[source]
Returns the value of a cosmological quantity (e.g., age) at a redshift.
- Parameters:
z (float) – The redshift.
quantity (str) – The name of the quantity to get. The name may be any attribute of
astropy.cosmology.FlatLambdaCDM
.strip_unit (bool, optional) – Just return the value of the quantity, sans units. Default is True.
**kwargs – All other keyword args are passed to
get_cosmology()
to select a cosmology. If none provided, will useDEFAULT_COSMOLOGY
.
- Returns:
The value of the quantity at the requested value. If
strip_unit
isTrue
, will return the value. Otherwise, will return the value with units.- Return type:
float or astropy.units.quantity
- pycbc.cosmology.distance_from_comoving_volume(vc, interp=True, **kwargs)[source]
Returns the luminosity distance from the given comoving volume.
- Parameters:
vc (float) – The comoving volume, in units of cubed Mpc.
interp (bool, optional) – If true, this will setup an interpolator between distance and comoving volume the first time this function is called. This is useful when making many successive calls to this function (such as when using this function in a transform for parameter estimation). However, setting up the interpolator the first time takes O(10)s of seconds. If you will only be making a single call to this function, or will only run it on an array with < ~100000 elements, it is faster to not use the interpolator (i.e., set
interp=False
). Default isTrue
.**kwargs – All other keyword args are passed to
get_cosmology()
to select a cosmology. If none provided, will useDEFAULT_COSMOLOGY
.
- Returns:
The luminosity distance at the given comoving volume.
- Return type:
- pycbc.cosmology.redshift(distance, **kwargs)[source]
Returns the redshift associated with the given luminosity distance.
If the requested cosmology is one of the pre-defined ones in
astropy.cosmology.parameters.available
,DistToZ
is used to provide a fast interpolation. This takes a few seconds to setup on the first call.
- pycbc.cosmology.redshift_from_comoving_volume(vc, interp=True, **kwargs)[source]
Returns the redshift from the given comoving volume.
- Parameters:
vc (float) – The comoving volume, in units of cubed Mpc.
interp (bool, optional) – If true, this will setup an interpolator between redshift and comoving volume the first time this function is called. This is useful when making many successive calls to this function (and is necessary when using this function in a transform when doing parameter estimation). However, setting up the interpolator the first time takes O(10)s of seconds. If you will only be making a single call to this function, or will only run it on an array with < ~100000 elements, it is faster to not use the interpolator (i.e., set
interp=False
). Default isTrue
.**kwargs – All other keyword args are passed to
get_cosmology()
to select a cosmology. If none provided, will useDEFAULT_COSMOLOGY
.
- Returns:
The redshift at the given comoving volume.
- Return type:
pycbc.dq module
Utilities to query archival instrument status information of gravitational-wave detectors from public sources and/or dqsegdb.
- pycbc.dq.parse_flag_str(flag_str)[source]
Parse a dq flag query string
- Parameters:
flag_str (str) – String to be parsed
- Returns:
flags (list of strings) – List of reduced name strings which can be passed to lower level query commands
signs (dict) – Dict of bools indicating if the flag should add positively to the segmentlist
ifos (dict) – Ifo specified for the given flag
bounds (dict) – The boundary of a given flag
padding (dict) – Any padding that should be applied to the segments for a given flag
- pycbc.dq.parse_veto_definer(veto_def_filename, ifos)[source]
Parse a veto definer file from the filename and return a dictionary indexed by ifo and veto definer category level.
- Parameters:
- Returns:
parsed_definition – Returns a dictionary first indexed by ifo, then category level, and finally a list of veto definitions.
- Return type:
- pycbc.dq.query_cumulative_flags(ifo, segment_names, start_time, end_time, source='any', server='https://segments.ligo.org', veto_definer=None, bounds=None, padding=None, override_ifos=None, cache=False)[source]
Return the times where any flag is active
- Parameters:
ifo (string or dict) – The interferometer to query (H1, L1). If a dict, an element for each flag name must be provided.
segment_name (list of strings) – The status flag to query from GWOSC.
start_time (int) – The starting gps time to begin querying from GWOSC
end_time (int) – The end gps time of the query
source (str, Optional) – Choice between “GWOSC” or “dqsegdb”. If dqsegdb, the server option may also be given. The default is to try GWOSC first then try dqsegdb.
server (str, Optional) – The server path. Only used with dqsegdb atm.
veto_definer (str, Optional) – The path to a veto definer to define groups of flags which themselves define a set of segments.
bounds (dict, Optional) – Dict containing start-end tuples keyed by the flag name which indicate places which should have a distinct time period to be active.
padding (dict, Optional) – Dict keyed by the flag name. Each element is a tuple
(start_pad
boundaries. (end_pad) which indicates how to change the segment)
override_ifos (dict, Optional) – A dict keyed by flag_name to override the ifo option on a per flag basis.
- Returns:
segments – List of segments
- Return type:
ligo.segments.segmentlist
- pycbc.dq.query_dqsegdb2(detector, flag_name, start_time, end_time, server)[source]
Utility function for better error reporting when calling dqsegdb2.
- pycbc.dq.query_flag(ifo, segment_name, start_time, end_time, source='any', server='https://segments.ligo.org', veto_definer=None, cache=False)[source]
Return the times where the flag is active
- Parameters:
ifo (string) – The interferometer to query (H1, L1).
segment_name (string) – The status flag to query from GWOSC.
start_time (int) – The starting gps time to begin querying from GWOSC
end_time (int) – The end gps time of the query
source (str, Optional) – Choice between “GWOSC” or “dqsegdb”. If dqsegdb, the server option may also be given. The default is to try GWOSC first then try dqsegdb.
server (str, Optional) – The server path. Only used with dqsegdb atm.
veto_definer (str, Optional) – The path to a veto definer to define groups of flags which themselves define a set of segments.
cache (bool) – If true cache the query. Default is not to cache
- Returns:
segments – List of segments
- Return type:
ligo.segments.segmentlist
- pycbc.dq.query_str(ifo, flag_str, start_time, end_time, source='any', server='https://segments.ligo.org', veto_definer=None)[source]
Query for flags based on a special str syntax
- Parameters:
ifo (str) – The ifo to query for (may be overridden in syntax)
flag_str (str) – Specification of how to do the query. Ex. +H1:DATA:1<-8,8>[0,100000000] would return H1 time for the DATA available flag with version 1. It would then apply an 8 second padding and only return times within the chosen range 0,1000000000.
start_time (int) – The start gps time. May be overridden for individual flags with the flag str bounds syntax
end_time (int) – The end gps time. May be overridden for individual flags with the flag str bounds syntax
source (str, Optional) – Choice between “GWOSC” or “dqsegdb”. If dqsegdb, the server option may also be given. The default is to try GWOSC first then try dqsegdb.
server (str, Optional) – The server path. Only used with dqsegdb atm.
veto_definer (str, Optional) – The path to a veto definer to define groups of flags which themselves define a set of segments.
- Returns:
segs – A list of segments corresponding to the flag query string
- Return type:
segmentlist
pycbc.libutils module
This module provides a simple interface for loading a shared library via ctypes, allowing it to be specified in an OS-independent way and searched for preferentially according to the paths that pkg-config specifies.
- pycbc.libutils.get_ctypes_library(libname, packages, mode=0)[source]
This function takes a library name, specified in architecture-independent fashion (i.e. omitting any prefix such as ‘lib’ or suffix such as ‘so’ or ‘dylib’ or version number) and a list of packages that may provide that library, and according first to LD_LIBRARY_PATH, then the results of pkg-config, and falling back to the system search path, will try to return a CDLL ctypes object. If ‘mode’ is given it will be used when loading the library.
- pycbc.libutils.get_libpath_from_dirlist(libname, dirs)[source]
This function tries to find the architecture-independent library given by libname in the first available directory in the list dirs. ‘Architecture-independent’ means omitting any prefix such as ‘lib’ or suffix such as ‘so’ or ‘dylib’ or version number. Within the first directory in which a matching pattern can be found, the lexicographically first such file is returned, as a string giving the full path name. The only supported OSes at the moment are posix and mac, and this function does not attempt to determine which is being run. So if for some reason your directory has both ‘.so’ and ‘.dylib’ libraries, who knows what will happen. If the library cannot be found, None is returned.
- pycbc.libutils.import_optional(library_name)[source]
Try to import library but and return stub if not found
- Parameters:
library_name (str) – The name of the python library to import
- Returns:
library – Either returns the library if importing is sucessful or it returns a stub which raises an import error and message when accessed.
- Return type:
library or stub
- pycbc.libutils.pkg_config(pkg_libraries)[source]
Use pkg-config to query for the location of libraries, library directories, and header directories
- Parameters:
pkg_libries (list) – A list of packages as strings
- Returns:
libraries(list), library_dirs(list), include_dirs(list)
- pycbc.libutils.pkg_config_header_strings(pkg_libraries)[source]
Returns a list of header strings that could be passed to a compiler
- pycbc.libutils.pkg_config_libdirs(packages)[source]
Returns a list of all library paths that pkg-config says should be included when linking against the list of packages given as ‘packages’. An empty return list means that the package may be found in the standard system locations, irrespective of pkg-config.
pycbc.mchirp_area module
Functions to compute the area corresponding to different CBC on the m1 & m2 plane when given a central mchirp value and uncertainty. It also includes a function that calculates the source frame when given the detector frame mass and redshift.
- pycbc.mchirp_area.calc_areas(trig_mc_det, mass_limits, mass_bdary, z, mass_gap, mass_gap_separate)[source]
Computes the area inside the lines of the second component mass as a function of the first component mass for the two extreme values of mchirp: mchirp +/- mchirp_uncertainty, for each region of the source classifying diagram.
- pycbc.mchirp_area.calc_probabilities(mchirp, snr, eff_distance, src_args)[source]
Computes the different probabilities that a candidate event belongs to each CBC source category taking as arguments the chirp mass, the coincident SNR and the effective distance, and estimating the chirp mass uncertainty, the luminosity distance (and its uncertainty) and the redshift (and its uncertainty). Probability is estimated to be directly proportional to the area of the corresponding CBC region.
- pycbc.mchirp_area.get_area(trig_mc, lim_h1, lim_h2, lim_v1, lim_v2)[source]
Returns the area under the chirp mass contour in a region of the m1-m2 plane (m1 > m2).
- Parameters:
trig_mc (sequence of two values) – first represents central estimate of mchirp in source frame, second its uncertainty
lim_h1 (floats or the string 'diagonal') – upper and lower horizontal limits of the region (limits on m2)
lim_h2 (floats or the string 'diagonal') – upper and lower horizontal limits of the region (limits on m2)
lim_v1 (floats) – right and left vertical limits of the region (limits on m1)
lim_v2 (floats) – right and left vertical limits of the region (limits on m1)
- Returns:
area
- Return type:
- pycbc.mchirp_area.intmc(mc, x_min, x_max)[source]
Returns the integral of m2 over m1 between x_min and x_max, assuming that mchirp is fixed.
- pycbc.mchirp_area.redshift_estimation(distance, distance_std, lal_cosmology)[source]
Takes values of distance and its uncertainty and returns a dictionary with estimates of the redshift and its uncertainty. If the argument ‘lal_cosmology’ is True, it uses Planck15 cosmology model as defined in lalsuite instead of the astropy default. Constants for lal_cosmology taken from Planck15_lal_cosmology() in https://git.ligo.org/lscsoft/pesummary/-/blob/master/pesummary/gw/ cosmology.py.
pycbc.opt module
This module defines optimization flags and determines hardware features that some other modules and packages may use in addition to some optimized utilities.
- class pycbc.opt.LimitedSizeDict(*args, **kwds)[source]
Bases:
OrderedDict
Fixed sized dict for FIFO caching
- pycbc.opt.insert_optimization_option_group(parser)[source]
Adds the options used to specify optimization-specific options.
- Parameters:
parser (object) – OptionParser instance
pycbc.pnutils module
This module contains convenience pN functions. This includes calculating conversions between quantities.
- pycbc.pnutils.A0(f_lower)[source]
used in calculating chirp times: see Cokelaer, arxiv.org:0706.4437 appendix 1, also lalinspiral/python/sbank/tau0tau3.py
- pycbc.pnutils.energy_coefficients(m1, m2, s1z=0, s2z=0, phase_order=-1, spin_order=-1)[source]
Return the energy coefficients. This assumes that the system has aligned spins only.
- pycbc.pnutils.eta_mass1_to_mass2(eta, mass1, return_mass_heavier=False, force_real=True)[source]
This function takes values for eta and one component mass and returns the second component mass. Similar to mchirp_mass1_to_mass2 this requires finding the roots of a quadratic equation. Basically:
eta m2^2 + (2 eta - 1)m1 m2 + eta m1^2 = 0
This has two solutions which correspond to mass1 being the heavier mass or it being the lighter mass. By default the value corresponding to mass1 > mass2 is returned. Use the return_mass_heavier kwarg to invert this behaviour.
- pycbc.pnutils.f_BKLISCO(m1, m2)[source]
Mass ratio dependent ISCO derived from estimates of the final spin of a merged black hole in a paper by Buonanno, Kidder, Lehner (arXiv:0709.3839). See also arxiv:0801.4297v2 eq.(5)
- pycbc.pnutils.f_ERD(M)[source]
Effective RingDown frequency studied in Pan et al. (arXiv:0704.1964) found to give good fit between stationary-phase templates and numerical relativity waveforms [NB equal-mass & nonspinning!] Equal to 1.07*omega_220/2*pi
- pycbc.pnutils.f_FRD(m1, m2)[source]
Fundamental RingDown frequency calculated from the Berti, Cardoso and Will (gr-qc/0512160) value for the omega_220 QNM frequency using mass-ratio dependent fits to the final BH mass and spin from Buonanno et al. (arXiv:0706.3732) : see also InspiralBankGeneration.c
- pycbc.pnutils.f_LRD(m1, m2)[source]
Lorentzian RingDown frequency = 1.2*FRD which captures part of the Lorentzian tail from the decay of the QNMs
- pycbc.pnutils.f_LightRing(M)[source]
Gravitational wave frequency corresponding to the light-ring orbit, equal to 1/(3**(3/2) pi M) : see InspiralBankGeneration.c
- pycbc.pnutils.f_SchwarzISCO(M)[source]
Innermost stable circular orbit (ISCO) for a test particle orbiting a Schwarzschild black hole
- pycbc.pnutils.frequency_cutoff_from_name(name, m1, m2, s1z, s2z)[source]
Returns the result of evaluating the frequency cutoff function specified by ‘name’ on a template with given parameters.
- Parameters:
name (string) – Name of the cutoff function
m1 (float or numpy.array) – First component mass in solar masses
m2 (float or numpy.array) – Second component mass in solar masses
s1z (float or numpy.array) – First component dimensionless spin S_1/m_1^2 projected onto L
s2z (float or numpy.array) – Second component dimensionless spin S_2/m_2^2 projected onto L
- Returns:
f – Frequency in Hz
- Return type:
float or numpy.array
- pycbc.pnutils.get_beta_sigma_from_aligned_spins(eta, spin1z, spin2z)[source]
Calculate the various PN spin combinations from the masses and spins. See <http://arxiv.org/pdf/0810.5336v3.pdf>.
- Parameters:
- Returns:
beta (float or numpy.array) – The 1.5PN spin combination
sigma (float or numpy.array) – The 2PN spin combination
gamma (float or numpy.array) – The 2.5PN spin combination
chis (float or numpy.array) – (spin1z + spin2z) / 2.
- pycbc.pnutils.get_final_freq(approx, m1, m2, s1z, s2z)[source]
Returns the final (highest) frequency for a given approximant using given template parameters.
NOTE: TaylorTx and TaylorFx are currently all given an ISCO cutoff !!
- Parameters:
approx (string) – Name of the approximant e.g. ‘EOBNRv2’
m1 (float or numpy.array) – First component mass in solar masses
m2 (float or numpy.array) – Second component mass in solar masses
s1z (float or numpy.array) – First component dimensionless spin S_1/m_1^2 projected onto L
s2z (float or numpy.array) – Second component dimensionless spin S_2/m_2^2 projected onto L
- Returns:
f – Frequency in Hz
- Return type:
float or numpy.array
- pycbc.pnutils.get_freq(freqfunc, m1, m2, s1z, s2z)[source]
Returns the LALSimulation function which evaluates the frequency for the given frequency function and template parameters.
- Parameters:
freqfunc (string) – Name of the frequency function to use, e.g., ‘fEOBNRv2RD’
m1 (float or numpy.array) – First component mass in solar masses
m2 (float or numpy.array) – Second component mass in solar masses
s1z (float or numpy.array) – First component dimensionless spin S_1/m_1^2 projected onto L
s2z (float or numpy.array) – Second component dimensionless spin S_2/m_2^2 projected onto L
- Returns:
f – Frequency in Hz
- Return type:
float or numpy.array
- pycbc.pnutils.get_inspiral_tf(tc, mass1, mass2, spin1, spin2, f_low, n_points=100, pn_2order=7, approximant='TaylorF2')[source]
Compute the time-frequency evolution of an inspiral signal.
Return a tuple of time and frequency vectors tracking the evolution of an inspiral signal in the time-frequency plane.
- pycbc.pnutils.hybridEnergy(v, m1, m2, chi1, chi2, qm1, qm2)[source]
Return hybrid MECO energy.
Return the hybrid energy [eq. (6)] whose minimum defines the hybrid MECO up to 3.5PN (including the 3PN spin-spin)
- Parameters:
m1 (float) – Mass of the primary object in solar masses.
m2 (float) – Mass of the secondary object in solar masses.
chi1 (float) – Dimensionless spin of the primary object.
chi2 (float) – Dimensionless spin of the secondary object.
qm1 (float) – Quadrupole-monopole term of the primary object (1 for black holes).
qm2 (float) – Quadrupole-monopole term of the secondary object (1 for black holes).
- Returns:
h_E – The hybrid energy as a function of v
- Return type:
- pycbc.pnutils.hybrid_meco_frequency(m1, m2, chi1, chi2, qm1=None, qm2=None)[source]
Return the frequency of the hybrid MECO
- Parameters:
m1 (float) – Mass of the primary object in solar masses.
m2 (float) – Mass of the secondary object in solar masses.
chi1 (float) – Dimensionless spin of the primary object.
chi2 (float) – Dimensionless spin of the secondary object.
qm1 ({None, float}, optional) – Quadrupole-monopole term of the primary object (1 for black holes). If None, will be set to qm1 = 1.
qm2 ({None, float}, optional) – Quadrupole-monopole term of the secondary object (1 for black holes). If None, will be set to qm2 = 1.
- Returns:
f – The frequency (in Hz) of the hybrid MECO
- Return type:
- pycbc.pnutils.hybrid_meco_velocity(m1, m2, chi1, chi2, qm1=None, qm2=None)[source]
Return the velocity of the hybrid MECO
- Parameters:
m1 (float) – Mass of the primary object in solar masses.
m2 (float) – Mass of the secondary object in solar masses.
chi1 (float) – Dimensionless spin of the primary object.
chi2 (float) – Dimensionless spin of the secondary object.
qm1 ({None, float}, optional) – Quadrupole-monopole term of the primary object (1 for black holes). If None, will be set to qm1 = 1.
qm2 ({None, float}, optional) – Quadrupole-monopole term of the secondary object (1 for black holes). If None, will be set to qm2 = 1.
- Returns:
v – The velocity (dimensionless) of the hybrid MECO
- Return type:
- pycbc.pnutils.jframe_to_l0frame(mass1, mass2, f_ref, phiref=0.0, thetajn=0.0, phijl=0.0, spin1_a=0.0, spin2_a=0.0, spin1_polar=0.0, spin2_polar=0.0, spin12_deltaphi=0.0)[source]
Converts J-frame parameters into L0 frame.
- Parameters:
mass1 (float) – The mass of the first component object in the binary (in solar masses)
mass2 (float) – The mass of the second component object in the binary (in solar masses)
f_ref (float) – The reference frequency.
thetajn (float) – Angle between the line of sight and the total angular momentume J.
phijl (float) – Azimuthal angle of L on its cone about J.
spin1_a (float) – The dimensionless spin magnitude \(|\vec{{s}}_1/m^2_1|\).
spin2_a (float) – The dimensionless spin magnitude \(|\vec{{s}}_2/m^2_2|\).
spin1_polar (float) – Angle between L and the spin magnitude of the larger object.
spin2_polar (float) – Angle betwen L and the spin magnitude of the smaller object.
spin12_deltaphi (float) – Difference between the azimuthal angles of the spin of the larger object (S1) and the spin of the smaller object (S2).
- Returns:
Dictionary of:
- inclinationfloat
Inclination (rad), defined as the angle between the orbital angular momentum L and the line-of-sight at the reference frequency.
- spin1xfloat
The x component of the first binary component’s dimensionless spin.
- spin1yfloat
The y component of the first binary component’s dimensionless spin.
- spin1zfloat
The z component of the first binary component’s dimensionless spin.
- spin2xfloat
The x component of the second binary component’s dimensionless spin.
- spin2yfloat
The y component of the second binary component’s dimensionless spin.
- spin2zfloat
The z component of the second binary component’s dimensionless spin.
- Return type:
- pycbc.pnutils.kerr_lightring(v, chi)[source]
Return the function whose first root defines the Kerr light ring
- pycbc.pnutils.l0frame_to_jframe(mass1, mass2, f_ref, phiref=0.0, inclination=0.0, spin1x=0.0, spin1y=0.0, spin1z=0.0, spin2x=0.0, spin2y=0.0, spin2z=0.0)[source]
Converts L0-frame parameters to J-frame.
- Parameters:
mass1 (float) – The mass of the first component object in the binary (in solar masses)
mass2 (float) – The mass of the second component object in the binary (in solar masses)
f_ref (float) – The reference frequency.
phiref (float) – The orbital phase at
f_ref
.inclination (float) – Inclination (rad), defined as the angle between the orbital angular momentum L and the line-of-sight at the reference frequency.
spin1x (float) – The x component of the first binary component’s dimensionless spin.
spin1y (float) – The y component of the first binary component’s dimensionless spin.
spin1z (float) – The z component of the first binary component’s dimensionless spin.
spin2x (float) – The x component of the second binary component’s dimensionless spin.
spin2y (float) – The y component of the second binary component’s dimensionless spin.
spin2z (float) – The z component of the second binary component’s dimensionless spin.
- Returns:
Dictionary of:
- thetajnfloat
Angle between the line of sight and the total angular momentume J.
- phijlfloat
Azimuthal angle of L on its cone about J.
- spin1_afloat
The dimensionless spin magnitude \(|\vec{{s}}_1/m^2_1|\).
- spin2_afloat
The dimensionless spin magnitude \(|\vec{{s}}_2/m^2_2|\).
- spin1_polarfloat
Angle between L and the spin magnitude of the larger object.
- spin2_polarfloat
Angle betwen L and the spin magnitude of the smaller object.
- spin12_deltaphifloat
Difference between the azimuthal angles of the spin of the larger object (S1) and the spin of the smaller object (S2).
- Return type:
- pycbc.pnutils.mchirp_mass1_to_mass2(mchirp, mass1)[source]
This function takes a value of mchirp and one component mass and returns the second component 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:
m2^3 - a(m2 + m1) = 0
where
a = Mc^5 / m1^3
this has 3 solutions but only one will be real.
- pycbc.pnutils.mchirp_q_to_mass1_mass2(mchirp, q)[source]
This function takes a value of mchirp and the mass ratio mass1/mass2 and returns the two component masses.
The map from q to eta is
eta = (mass1*mass2)/(mass1+mass2)**2 = (q)/(1+q)**2
Then we can map from (mchirp,eta) to (mass1,mass2).
- pycbc.pnutils.meco_velocity(m1, m2, chi1, chi2)[source]
Returns the velocity of the minimum energy cutoff for 3.5pN (2.5pN spin)
- Parameters:
- Returns:
v – Velocity (dimensionless)
- Return type:
- pycbc.pnutils.nearest_larger_binary_number(input_len)[source]
Return the nearest binary number larger than input_len.
- pycbc.pnutils.t4_cutoff_velocity(m1, m2, chi1, chi2)
Returns the velocity of the minimum energy cutoff for 3.5pN (2.5pN spin)
- Parameters:
- Returns:
v – Velocity (dimensionless)
- Return type:
pycbc.pool module
Tools for creating pools of worker processes
- class pycbc.pool.BroadcastPool(processes=None, initializer=None, initargs=(), context=None, **kwds)[source]
Bases:
Pool
Multiprocessing pool with a broadcast method
- allmap(fcn, args)[source]
Do a function call on every worker with different arguments
- Parameters:
fcn (funtion) – Function to call.
args (tuple) – The arguments for Pool.map
pycbc.rate module
- pycbc.rate.compute_efficiency(f_dist, m_dist, dbins)[source]
Compute the efficiency as a function of distance for the given sets of found and missed injection distances. Note that injections that do not fit into any dbin get lost :(
- pycbc.rate.compute_lower_limit(mu_in, post, alpha=0.9)[source]
Returns the lower limit mu_low of confidence level alpha for a posterior distribution post on the given parameter mu. The posterior need not be normalized.
- pycbc.rate.compute_upper_limit(mu_in, post, alpha=0.9)[source]
Returns the upper limit mu_high of confidence level alpha for a posterior distribution post on the given parameter mu. The posterior need not be normalized.
- pycbc.rate.compute_volume_vs_mass(found, missed, mass_bins, bin_type, dbins=None)[source]
Compute the average luminosity an experiment was sensitive to
Assumes that luminosity is uniformly distributed in space. Input is the sets of found and missed injections.
- pycbc.rate.confidence_interval_min_width(mu, post, alpha=0.9)[source]
Returns the minimal-width confidence interval [mu_low, mu_high] of confidence level alpha for a posterior distribution post on the parameter mu.
- pycbc.rate.filter_injections_by_mass(injs, mbins, bin_num, bin_type, bin_num2=None)[source]
For a given set of injections (sim_inspiral rows), return the subset of injections that fall within the given mass range.
- pycbc.rate.hpd_coverage(mu, pdf, thresh)[source]
Integrates a pdf over mu taking only bins where the mean over the bin is above a given threshold This gives the coverage of the HPD interval for the given threshold.
- pycbc.rate.hpd_credible_interval(mu_in, post, alpha=0.9, tolerance=0.001)[source]
Returns the minimum and maximum rate values of the HPD (Highest Posterior Density) credible interval for a posterior post defined at the sample values mu_in. Samples need not be uniformly spaced and posterior need not be normalized.
Will not return a correct credible interval if the posterior is multimodal and the correct interval is not contiguous; in this case will over-cover by including the whole range from minimum to maximum mu.
- pycbc.rate.hpd_threshold(mu_in, post, alpha, tol)[source]
For a PDF post over samples mu_in, find a density threshold such that the region having higher density has coverage of at least alpha, and less than alpha plus a given tolerance.
pycbc.scheme module
This modules provides python contexts that set the default behavior for PyCBC objects.
- class pycbc.scheme.CUDAScheme(device_num=0)[source]
Bases:
Scheme
Context that sets PyCBC objects to use a CUDA processing scheme.
- class pycbc.scheme.ChooseBySchemeDict[source]
Bases:
dict
This class represents a dictionary whose purpose is to chose objects based on their processing scheme. The keys are intended to be processing schemes.
- class pycbc.scheme.Scheme[source]
Bases:
object
Context that sets PyCBC objects to use CPU processing.
- pycbc.scheme.from_cli(opt)[source]
Parses the command line options and returns a processing scheme.
pycbc.sensitivity module
This module contains utilities for calculating search sensitivity
- pycbc.sensitivity.chirp_volume_montecarlo(found_d, missed_d, found_mchirp, missed_mchirp, distribution_param, distribution, limits_param, min_param, max_param)[source]
- pycbc.sensitivity.compute_search_efficiency_in_bins(found, total, ndbins, sim_to_bins_function=<function <lambda>>)[source]
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 indexing the ndbins.
- pycbc.sensitivity.compute_search_volume_in_bins(found, total, ndbins, sim_to_bins_function)[source]
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_bins_function must maps an object to a tuple indexing the ndbins.
- pycbc.sensitivity.volume_binned_pylal(f_dist, m_dist, bins=15)[source]
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:
volume (float) – Volume estimate
volume_error (float) – The standard error in the volume
- pycbc.sensitivity.volume_montecarlo(found_d, missed_d, found_mchirp, missed_mchirp, distribution_param, distribution, limits_param, min_param=None, max_param=None)[source]
Compute sensitive volume and standard error via direct Monte Carlo integral
Injections should be made over a range of distances such that sensitive volume due to signals closer than D_min is negligible, and efficiency at distances above D_max is negligible TODO : Replace this function by Collin’s formula given in Usman et al. ? OR get that coded as a new function?
- Parameters:
found_d (numpy.ndarray) – The distances of found injections
missed_d (numpy.ndarray) – The distances of missed injections
found_mchirp (numpy.ndarray) – Chirp mass of found injections
missed_mchirp (numpy.ndarray) – Chirp mass of missed injections
distribution_param (string) – Parameter D of the injections used to generate a distribution over distance, may be ‘distance’, ‘chirp_distance’.
distribution (string) – form of the distribution over the parameter, may be ‘log’ (uniform in log D) ‘uniform’ (uniform in D) ‘distancesquared’ (uniform in D**2) ‘volume’ (uniform in D**3)
limits_param (string) – Parameter Dlim specifying limits inside which injections were made may be ‘distance’, ‘chirp distance’
min_param (float) – minimum value of Dlim at which injections were made; only used for log distribution, then if None the minimum actually injected value will be used
max_param (float) – maximum value of Dlim out to which injections were made; if None the maximum actually injected value will be used
- Returns:
volume (float) – Volume estimate
volume_error (float) – The standard error in the volume
- pycbc.sensitivity.volume_shell(f_dist, m_dist)[source]
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) – Volume estimate
volume_error (float) – The standard error in the volume
pycbc.transforms module
This modules provides classes and functions for transforming parameters.
- class pycbc.transforms.AlignTotalSpin[source]
Bases:
BaseTransform
Converts angles from total angular momentum J frame to orbital angular momentum L (waveform) frame
- name = 'align_total_spin'
- transform(maps)[source]
Rigidly rotate binary so that the total angular momentum has the given inclination (iota) instead of the orbital angular momentum. Return the new inclination, s1, and s2. s1 and s2 are dimensionless spin. Note: the spins are assumed to be given in the frame defined by the orbital angular momentum.
- class pycbc.transforms.AlignedMassSpinToCartesianSpin[source]
Bases:
BaseTransform
Converts mass-weighted spins to cartesian z-axis spins.
- inverse
alias of
CartesianSpinToAlignedMassSpin
- inverse_transform(maps)[source]
This function transforms from component masses and cartesian spins to mass-weighted spin parameters aligned with the angular momentum.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- name = 'aligned_mass_spin_to_cartesian_spin'
- class pycbc.transforms.BaseTransform[source]
Bases:
object
A base class for transforming between two sets of parameters.
- static format_output(old_maps, new_maps)[source]
This function takes the returned dict from transform and converts it to the same datatype as the input.
- Parameters:
old_maps ({FieldArray, dict}) – The mapping object to add new maps to.
new_maps (dict) – A dict with key as parameter name and value is numpy.array.
- Returns:
The old_maps object with new keys from new_maps.
- Return type:
{FieldArray, dict}
- classmethod from_config(cp, section, outputs, skip_opts=None, additional_opts=None)[source]
Initializes a transform from the given section.
- Parameters:
cp (pycbc.workflow.WorkflowConfigParser) – A parsed configuration file that contains the transform options.
section (str) – Name of the section in the configuration file.
outputs (str) – The names of the parameters that are output by this transformation, separated by VARARGS_DELIM. These must appear in the “tag” part of the section header.
skip_opts (list, optional) – Do not read options in the given list.
additional_opts (dict, optional) – Any additional arguments to pass to the class. If an option is provided that also exists in the config file, the value provided will be used instead of being read from the file.
- Returns:
An instance of the class.
- Return type:
cls
- inverse = None
- inverse_transform(maps)[source]
The inverse conversions of transform. This function transforms from outputs to inputs.
- name = None
- class pycbc.transforms.CartesianSpin1ToSphericalSpin1[source]
Bases:
CartesianToSpherical
The inverse of SphericalSpin1ToCartesianSpin1.
Deprecation Warning: This will be removed in a future update. Use
CartesianToSpherical
with spin-parameter names passed in instead.- name = 'cartesian_spin_1_to_spherical_spin_1'
- class pycbc.transforms.CartesianSpin2ToSphericalSpin2[source]
Bases:
CartesianToSpherical
The inverse of SphericalSpin2ToCartesianSpin2.
Deprecation Warning: This will be removed in a future update. Use
CartesianToSpherical
with spin-parameter names passed in instead.- name = 'cartesian_spin_2_to_spherical_spin_2'
- class pycbc.transforms.CartesianSpinToAlignedMassSpin[source]
Bases:
AlignedMassSpinToCartesianSpin
The inverse of AlignedMassSpinToCartesianSpin.
- inverse
alias of
AlignedMassSpinToCartesianSpin
- inverse_jacobian(maps)
The Jacobian for the inputs to outputs transformation.
- inverse_transform(maps)
This function transforms from aligned mass-weighted spins to cartesian spins aligned along the z-axis.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- jacobian(maps)
The Jacobian for the outputs to inputs transformation.
- name = 'cartesian_spin_to_aligned_mass_spin'
- transform(maps)
This function transforms from component masses and cartesian spins to mass-weighted spin parameters aligned with the angular momentum.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- class pycbc.transforms.CartesianSpinToChiP[source]
Bases:
BaseTransform
Converts cartesian spins to chi_p.
- name = 'cartesian_spin_to_chi_p'
- class pycbc.transforms.CartesianSpinToPrecessionMassSpin[source]
Bases:
PrecessionMassSpinToCartesianSpin
The inverse of PrecessionMassSpinToCartesianSpin.
- inverse
alias of
PrecessionMassSpinToCartesianSpin
- inverse_jacobian(maps)
The Jacobian for the inputs to outputs transformation.
- inverse_transform(maps)
This function transforms from mass-weighted spins to caretsian spins in the x-y plane.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- jacobian(maps)
The Jacobian for the outputs to inputs transformation.
- name = 'cartesian_spin_to_precession_mass_spin'
- transform(maps)
This function transforms from component masses and cartesian spins to mass-weighted spin parameters perpendicular with the angular momentum.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- class pycbc.transforms.CartesianToSpherical(*args)[source]
Bases:
SphericalToCartesian
Converts spherical coordinates to cartesian.
- Parameters:
- inverse
alias of
SphericalToCartesian
- inverse_jacobian(maps)
The Jacobian for the inputs to outputs transformation.
- inverse_transform(maps)
This function transforms from spherical to cartesian spins.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
>>> import numpy >>> from pycbc import transforms >>> t = transforms.SphericalToCartesian('x', 'y', 'z', 'a', 'phi', 'theta') >>> t.transform({'a': numpy.array([0.1]), 'phi': numpy.array([0.1]), 'theta': numpy.array([0.1])}) {'a': array([ 0.1]), 'phi': array([ 0.1]), 'theta': array([ 0.1]), 'x': array([ 0.00993347]), 'y': array([ 0.00099667]), 'z': array([ 0.09950042])}
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- jacobian(maps)
The Jacobian for the outputs to inputs transformation.
- name = 'cartesian_to_spherical'
- class pycbc.transforms.ChiPToCartesianSpin[source]
Bases:
CartesianSpinToChiP
The inverse of CartesianSpinToChiP.
- inverse
alias of
CartesianSpinToChiP
- inverse_jacobian(maps)
The Jacobian for the inputs to outputs transformation.
- inverse_transform(maps)
This function transforms from component masses and caretsian spins to chi_p.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- jacobian(maps)
The Jacobian for the outputs to inputs transformation.
- name = 'cartesian_spin_to_chi_p'
- transform(maps)
The inverse conversions of transform. This function transforms from outputs to inputs.
- class pycbc.transforms.ChirpDistanceToDistance(ref_mass=1.4)[source]
Bases:
BaseTransform
Converts chirp distance to luminosity distance, given the chirp mass.
- inverse
alias of
DistanceToChirpDistance
- inverse_jacobian(maps)[source]
Returns the Jacobian for transforming luminosity distance to chirp distance, given the chirp mass.
- inverse_transform(maps)[source]
This function transforms from luminosity distance to chirp distance, given the chirp mass.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
>>> import numpy as np >>> from pycbc import transforms >>> t = transforms.ChirpDistanceToDistance() >>> t.inverse_transform({'distance': np.array([40.]), 'mchirp': np.array([1.2])}) {'distance': array([ 40.]), 'chirp_distance': array([ 40.52073522]), 'mchirp': array([ 1.2])}
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- jacobian(maps)[source]
Returns the Jacobian for transforming chirp distance to luminosity distance, given the chirp mass.
- name = 'chirp_distance_to_distance'
- transform(maps)[source]
This function transforms from chirp distance to luminosity distance, given the chirp mass.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
>>> import numpy as np >>> from pycbc import transforms >>> t = transforms.ChirpDistanceToDistance() >>> t.transform({'chirp_distance': np.array([40.]), 'mchirp': np.array([1.2])}) {'mchirp': array([ 1.2]), 'chirp_distance': array([ 40.]), 'distance': array([ 39.48595679])}
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- class pycbc.transforms.CustomTransform(input_args, output_args, transform_functions, jacobian=None)[source]
Bases:
BaseTransform
Allows for any transform to be defined.
- Parameters:
input_args ((list of) str) – The names of the input parameters.
output_args ((list of) str) – The names of the output parameters.
transform_functions (dict) – Dictionary mapping input args to a string giving a function call; e.g.,
{'q': 'q_from_mass1_mass2(mass1, mass2)'}
.jacobian (str, optional) – String giving a jacobian function. The function must be in terms of the input arguments.
Examples
Create a custom transform that converts mass1, mass2 to mtotal, q:
>>> t = transforms.CustomTransform(['mass1', 'mass2'], ['mtotal', 'q'], {'mtotal': 'mass1+mass2', 'q': 'mass1/mass2'}, '(mass1 + mass2) / mass2**2')
Evaluate a pair of masses:
>>> t.transform({'mass1': 10., 'mass2': 5.}) {'mass1': 10.0, 'mass2': 5.0, 'mtotal': 15.0, 'q': 2.0}
The Jacobian for the same pair of masses:
>>> t.jacobian({'mass1': 10., 'mass2': 5.}) 0.59999999999999998
- classmethod from_config(cp, section, outputs)[source]
Loads a CustomTransform from the given config file.
Example section:
[{section}-outvar1+outvar2] name = custom inputs = inputvar1, inputvar2 outvar1 = func1(inputs) outvar2 = func2(inputs) jacobian = func(inputs)
- name = 'custom'
- transform(maps)[source]
Applies the transform functions to the given maps object.
- Parameters:
maps (dict, or FieldArray)
- Returns:
A map object containing the transformed variables, along with the original variables. The type of the output will be the same as the input.
- Return type:
dict or FieldArray
- class pycbc.transforms.CustomTransformMultiOutputs(input_args, output_args, transform_functions, jacobian=None)[source]
Bases:
CustomTransform
Allows for any transform to be defined. Based on CustomTransform, but also supports multi-returning value functions.
- Parameters:
input_args ((list of) str) – The names of the input parameters.
output_args ((list of) str) – The names of the output parameters.
transform_functions (dict) – Dictionary mapping input args to a string giving a function call; e.g.,
{'q': 'q_from_mass1_mass2(mass1, mass2)'}
.jacobian (str, optional) – String giving a jacobian function. The function must be in terms of the input arguments.
- classmethod from_config(cp, section, outputs)[source]
Loads a CustomTransformMultiOutputs from the given config file.
Example section:
[{section}-outvar1+outvar2] name = custom_multi inputs = inputvar1, inputvar2 outvar1, outvar2 = func1(inputs) jacobian = func2(inputs)
- name = 'custom_multi'
- transform(maps)[source]
Applies the transform functions to the given maps object. :param maps: :type maps: dict, or FieldArray
- Returns:
A map object containing the transformed variables, along with the original variables. The type of the output will be the same as the input.
- Return type:
dict or FieldArray
- class pycbc.transforms.DistanceToChirpDistance(ref_mass=1.4)[source]
Bases:
ChirpDistanceToDistance
The inverse of ChirpDistanceToDistance.
- inverse
alias of
ChirpDistanceToDistance
- inverse_jacobian(maps)
Returns the Jacobian for transforming chirp distance to luminosity distance, given the chirp mass.
- inverse_transform(maps)
This function transforms from chirp distance to luminosity distance, given the chirp mass.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
>>> import numpy as np >>> from pycbc import transforms >>> t = transforms.ChirpDistanceToDistance() >>> t.transform({'chirp_distance': np.array([40.]), 'mchirp': np.array([1.2])}) {'mchirp': array([ 1.2]), 'chirp_distance': array([ 40.]), 'distance': array([ 39.48595679])}
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- jacobian(maps)
Returns the Jacobian for transforming luminosity distance to chirp distance, given the chirp mass.
- name = 'distance_to_chirp_distance'
- transform(maps)
This function transforms from luminosity distance to chirp distance, given the chirp mass.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
>>> import numpy as np >>> from pycbc import transforms >>> t = transforms.ChirpDistanceToDistance() >>> t.inverse_transform({'distance': np.array([40.]), 'mchirp': np.array([1.2])}) {'distance': array([ 40.]), 'chirp_distance': array([ 40.52073522]), 'mchirp': array([ 1.2])}
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- class pycbc.transforms.DistanceToRedshift[source]
Bases:
BaseTransform
Converts distance to redshift.
- inverse = None
- name = 'distance_to_redshift'
- transform(maps)[source]
This function transforms from distance to redshift.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
>>> import numpy >>> from pycbc import transforms >>> t = transforms.DistanceToRedshift() >>> t.transform({'distance': numpy.array([1000])}) {'distance': array([1000]), 'redshift': 0.19650987609144363}
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- class pycbc.transforms.Exponent(inputvar, outputvar)[source]
Bases:
Log
Applies an exponent transform to an inputvar parameter.
This is the inverse of the log transform.
- Parameters:
- inverse_jacobian(maps)
Computes the Jacobian of \(y = \log(x)\).
This is:
\[\frac{\mathrm{d}y}{\mathrm{d}x} = \frac{1}{x}.\]- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
The value of the jacobian at the given point(s).
- Return type:
- inverse_transform(maps)
Computes \(\log(x)\).
- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
out – A map between the transformed variable name and value(s), along with the original variable name and value(s).
- Return type:
dict or FieldArray
- jacobian(maps)
Computes the Jacobian of \(y = e^{x}\).
This is:
\[\frac{\mathrm{d}y}{\mathrm{d}x} = e^{x}.\]- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
The value of the jacobian at the given point(s).
- Return type:
- name = 'exponent'
- transform(maps)
Computes \(y = e^{x}\).
- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
out – A map between the transformed variable name and value(s), along with the original variable name and value(s).
- Return type:
dict or FieldArray
- class pycbc.transforms.GEOToLISA(tc_lisa_param=None, longitude_lisa_param=None, latitude_lisa_param=None, polarization_lisa_param=None, tc_geo_param=None, longitude_geo_param=None, latitude_geo_param=None, polarization_geo_param=None)[source]
Bases:
LISAToGEO
The inverse of LISAToGEO.
- inverse_transform(maps)
This function transforms arrival time, sky localization, and polarization angle in the LISA frame to the corresponding values in the geocentric frame.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- name = 'geo_to_lisa'
- transform(maps)
This function transforms arrival time, sky localization, and polarization angle in the geocentric frame to the corresponding values in the LISA frame.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- class pycbc.transforms.GEOToSSB(tc_geo_param=None, longitude_geo_param=None, latitude_geo_param=None, polarization_geo_param=None, tc_ssb_param=None, longitude_ssb_param=None, latitude_ssb_param=None, polarization_ssb_param=None)[source]
Bases:
BaseTransform
Converts arrival time, sky localization, and polarization angle in the geocentric frame to the corresponding values in the SSB frame.
- default_params_name = {'default_latitude_geo': 'dec', 'default_latitude_ssb': 'eclipticlatitude', 'default_longitude_geo': 'ra', 'default_longitude_ssb': 'eclipticlongitude', 'default_polarization_geo': 'polarization', 'default_polarization_ssb': 'polarization', 'default_tc_geo': 'tc', 'default_tc_ssb': 'tc'}
- classmethod from_config(cp, section, outputs)[source]
Initializes a transform from the given section.
- Parameters:
cp (pycbc.workflow.WorkflowConfigParser) – A parsed configuration file that contains the transform options.
section (str) – Name of the section in the configuration file.
outputs (str) – The names of the parameters that are output by this transformation, separated by VARARGS_DELIM. These must appear in the “tag” part of the section header.
skip_opts (list, optional) – Do not read options in the given list.
additional_opts (dict, optional) – Any additional arguments to pass to the class. If an option is provided that also exists in the config file, the value provided will be used instead of being read from the file.
- Returns:
An instance of the class.
- Return type:
cls
- inverse_transform(maps)[source]
This function transforms arrival time, sky localization, and polarization angle in the SSB frame to the corresponding values in the geocentric frame.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- name = 'geo_to_ssb'
- transform(maps)[source]
This function transforms arrival time, sky localization, and polarization angle in the geocentric frame to the corresponding values in the SSB frame.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- class pycbc.transforms.LISAToGEO(tc_lisa_param=None, longitude_lisa_param=None, latitude_lisa_param=None, polarization_lisa_param=None, tc_geo_param=None, longitude_geo_param=None, latitude_geo_param=None, polarization_geo_param=None)[source]
Bases:
BaseTransform
Converts arrival time, sky localization, and polarization angle in the LISA frame to the corresponding values in the geocentric frame.
- default_params_name = {'default_latitude_geo': 'dec', 'default_latitude_lisa': 'eclipticlatitude', 'default_longitude_geo': 'ra', 'default_longitude_lisa': 'eclipticlongitude', 'default_polarization_geo': 'polarization', 'default_polarization_lisa': 'polarization', 'default_tc_geo': 'tc', 'default_tc_lisa': 'tc'}
- classmethod from_config(cp, section, outputs)[source]
Initializes a transform from the given section.
- Parameters:
cp (pycbc.workflow.WorkflowConfigParser) – A parsed configuration file that contains the transform options.
section (str) – Name of the section in the configuration file.
outputs (str) – The names of the parameters that are output by this transformation, separated by VARARGS_DELIM. These must appear in the “tag” part of the section header.
skip_opts (list, optional) – Do not read options in the given list.
additional_opts (dict, optional) – Any additional arguments to pass to the class. If an option is provided that also exists in the config file, the value provided will be used instead of being read from the file.
- Returns:
An instance of the class.
- Return type:
cls
- inverse_transform(maps)[source]
This function transforms arrival time, sky localization, and polarization angle in the geocentric frame to the corresponding values in the LISA frame.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- name = 'lisa_to_geo'
- transform(maps)[source]
This function transforms arrival time, sky localization, and polarization angle in the LISA frame to the corresponding values in the geocentric frame.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- class pycbc.transforms.LISAToSSB(tc_lisa_param=None, longitude_lisa_param=None, latitude_lisa_param=None, polarization_lisa_param=None, tc_ssb_param=None, longitude_ssb_param=None, latitude_ssb_param=None, polarization_ssb_param=None)[source]
Bases:
BaseTransform
Converts arrival time, sky localization, and polarization angle in the LISA frame to the corresponding values in the SSB frame.
- default_params_name = {'default_latitude_lisa': 'eclipticlatitude', 'default_latitude_ssb': 'eclipticlatitude', 'default_longitude_lisa': 'eclipticlongitude', 'default_longitude_ssb': 'eclipticlongitude', 'default_polarization_lisa': 'polarization', 'default_polarization_ssb': 'polarization', 'default_tc_lisa': 'tc', 'default_tc_ssb': 'tc'}
- classmethod from_config(cp, section, outputs)[source]
Initializes a transform from the given section.
- Parameters:
cp (pycbc.workflow.WorkflowConfigParser) – A parsed configuration file that contains the transform options.
section (str) – Name of the section in the configuration file.
outputs (str) – The names of the parameters that are output by this transformation, separated by VARARGS_DELIM. These must appear in the “tag” part of the section header.
skip_opts (list, optional) – Do not read options in the given list.
additional_opts (dict, optional) – Any additional arguments to pass to the class. If an option is provided that also exists in the config file, the value provided will be used instead of being read from the file.
- Returns:
An instance of the class.
- Return type:
cls
- inverse_transform(maps)[source]
This function transforms arrival time, sky localization, and polarization angle in the SSB frame to the corresponding values in the LISA frame.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- name = 'lisa_to_ssb'
- transform(maps)[source]
This function transforms arrival time, sky localization, and polarization angle in the LISA frame to the corresponding values in the SSB frame.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- class pycbc.transforms.LambdaFromMultipleTOVFiles(mass_param, lambda_param, map_file, distance=None, redshift_mass=True, file_columns=None)[source]
Bases:
BaseTransform
Uses multiple equation of states.
- Parameters:
mass_param (str) – The name of the mass parameter to transform.
lambda_param (str) – The name of the tidal deformability parameter that mass_param is to be converted to interpolating from the data in the mass-Lambda file.
mass_lambda_file (str) – Path of the mass-Lambda data file. The first column in the data file should contain mass values, and the second column Lambda values.
distance (float, optional) – The distance (in Mpc) of the source. Used to redshift the mass. If None, then a distance must be provided to the transform.
file_columns (list of str, optional) – The names and order of columns in the
mass_lambda_file
. Must contain at least ‘mass’ and ‘lambda’. If not provided, will assume the order is (‘radius’, ‘mass’, ‘lambda’).
- property distance
Returns the fixed distance to transform mass samples from detector to source frame if one is specified.
- classmethod from_config(cp, section, outputs)[source]
Initializes a transform from the given section.
- Parameters:
cp (pycbc.workflow.WorkflowConfigParser) – A parsed configuration file that contains the transform options.
section (str) – Name of the section in the configuration file.
outputs (str) – The names of the parameters that are output by this transformation, separated by VARARGS_DELIM. These must appear in the “tag” part of the section header.
skip_opts (list, optional) – Do not read options in the given list.
additional_opts (dict, optional) – Any additional arguments to pass to the class. If an option is provided that also exists in the config file, the value provided will be used instead of being read from the file.
- Returns:
An instance of the class.
- Return type:
cls
- get_eos(eos_index)[source]
Gets the EOS for the given index.
If the index is not in range returns None.
- property lambda_param
Returns the output lambda parameter.
- property map_file
Returns the mass data read from the mass-Lambda data file for an EOS.
- property mass_param
Returns the input mass parameter.
- name = 'lambda_from_multiple_tov_files'
- class pycbc.transforms.LambdaFromTOVFile(mass_param, lambda_param, mass_lambda_file, distance=None, redshift_mass=True, file_columns=None)[source]
Bases:
BaseTransform
Transforms mass values corresponding to Lambda values for a given EOS interpolating from the mass-Lambda data for that EOS read in from an external ASCII file.
The interpolation of the mass-Lambda data is a one-dimensional piecewise linear interpolation. If the
redshift_mass
keyword argument isTrue
(the default), the mass values to be transformed are assumed to be detector frame masses. In that case, a distance should be provided along with the mass for transformation to the source frame mass before the Lambda values are extracted from the interpolation. If the transform is read in from a config file, an example code block would be:[{section}-lambda1] name = lambda_from_tov_file mass_param = mass1 lambda_param = lambda1 distance = 40 mass_lambda_file = {filepath}
If this transform is used in a parameter estimation analysis where distance is a variable parameter, the distance to be used will vary with each draw. In that case, the example code block will be:
[{section}-lambda1] name = lambda_from_tov_file mass_param = mass1 lambda_param = lambda1 mass_lambda_file = filepath
If your prior is in terms of the source-frame masses (
srcmass
), then you can shut off the redshifting by addingdo-not-redshift-mass
to the config file. In this case you do not need to worry about a distance. Example:[{section}-lambda1] name = lambda_from_tov_file mass_param = srcmass1 lambda_param = lambda1 mass_lambda_file = filepath do-not-redshift-mass =
- Parameters:
mass_param (str) – The name of the mass parameter to transform.
lambda_param (str) – The name of the tidal deformability parameter that mass_param is to be converted to interpolating from the data in the mass-Lambda file.
mass_lambda_file (str) – Path of the mass-Lambda data file. The first column in the data file should contain mass values, and the second column Lambda values.
distance (float, optional) – The distance (in Mpc) of the source. Used to redshift the mass. Needed if
redshift_mass
is True and no distance parameter exists If None, then a distance must be provided to the transform.redshift_mass (bool, optional) – Redshift the mass parameters when computing the lambdas. Default is False.
file_columns (list of str, optional) – The names and order of columns in the
mass_lambda_file
. Must contain at least ‘mass’ and ‘lambda’. If not provided, will assume the order is (‘mass’, ‘lambda’).
- property data
- property distance
Returns the fixed distance to transform mass samples from detector to source frame if one is specified.
- classmethod from_config(cp, section, outputs)[source]
Initializes a transform from the given section.
- Parameters:
cp (pycbc.workflow.WorkflowConfigParser) – A parsed configuration file that contains the transform options.
section (str) – Name of the section in the configuration file.
outputs (str) – The names of the parameters that are output by this transformation, separated by VARARGS_DELIM. These must appear in the “tag” part of the section header.
skip_opts (list, optional) – Do not read options in the given list.
additional_opts (dict, optional) – Any additional arguments to pass to the class. If an option is provided that also exists in the config file, the value provided will be used instead of being read from the file.
- Returns:
An instance of the class.
- Return type:
cls
- property lambda_data
Returns the Lambda data read from the mass-Lambda data file for an EOS.
- static lambda_from_tov_data(m_src, mass_data, lambda_data)[source]
Returns Lambda corresponding to a given mass interpolating from the TOV data.
- property lambda_param
Returns the output lambda parameter.
- property mass_data
Returns the mass data read from the mass-Lambda data file for an EOS.
- property mass_param
Returns the input mass parameter.
- name = 'lambda_from_tov_file'
- transform(maps)[source]
Computes the transformation of mass to Lambda.
- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
out – A map between the transformed variable name and value(s), along with the original variable name and value(s).
- Return type:
dict or FieldArray
- class pycbc.transforms.Log(inputvar, outputvar)[source]
Bases:
BaseTransform
Applies a log transform from an inputvar parameter to an outputvar parameter. This is the inverse of the exponent transform.
- Parameters:
- property inputvar
Returns the input parameter.
- inverse_jacobian(maps)[source]
Computes the Jacobian of \(y = e^{x}\).
This is:
\[\frac{\mathrm{d}y}{\mathrm{d}x} = e^{x}.\]- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
The value of the jacobian at the given point(s).
- Return type:
- inverse_transform(maps)[source]
Computes \(y = e^{x}\).
- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
out – A map between the transformed variable name and value(s), along with the original variable name and value(s).
- Return type:
dict or FieldArray
- jacobian(maps)[source]
Computes the Jacobian of \(y = \log(x)\).
This is:
\[\frac{\mathrm{d}y}{\mathrm{d}x} = \frac{1}{x}.\]- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
The value of the jacobian at the given point(s).
- Return type:
- name = 'log'
- property outputvar
Returns the output parameter.
- transform(maps)[source]
Computes \(\log(x)\).
- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
out – A map between the transformed variable name and value(s), along with the original variable name and value(s).
- Return type:
dict or FieldArray
- class pycbc.transforms.Logistic(inputvar, outputvar, codomain=(0.0, 1.0))[source]
Bases:
Logit
Applies a logistic transform from an input parameter to an output parameter. This is the inverse of the logit transform.
Typically, the output of the logistic function has range \(\in [0,1)\). However, the codomain argument can be used to expand this to any finite real interval.
- Parameters:
- property bounds
Returns the range of the output parameter.
- classmethod from_config(cp, section, outputs, skip_opts=None, additional_opts=None)[source]
Initializes a Logistic transform from the given section.
The section must specify an input and output variable name. The codomain of the output may be specified using min-{output}, max-{output}. Example:
[{section}-q] name = logistic inputvar = logitq outputvar = q min-q = 1 max-q = 8
- Parameters:
cp (pycbc.workflow.WorkflowConfigParser) – A parsed configuration file that contains the transform options.
section (str) – Name of the section in the configuration file.
outputs (str) – The names of the parameters that are output by this transformation, separated by VARARGS_DELIM. These must appear in the “tag” part of the section header.
skip_opts (list, optional) – Do not read options in the given list.
additional_opts (dict, optional) – Any additional arguments to pass to the class. If an option is provided that also exists in the config file, the value provided will be used instead of being read from the file.
- Returns:
An instance of the class.
- Return type:
cls
- inverse_jacobian(maps)
Computes the Jacobian of \(y = \mathrm{logit}(x; a,b)\).
This is:
\[\frac{\mathrm{d}y}{\mathrm{d}x} = \frac{b -a}{(x-a)(b-x)},\]where \(x \in (a, b)\).
- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
The value of the jacobian at the given point(s).
- Return type:
- inverse_transform(maps)
Computes \(\mathrm{logit}(x; a, b)\).
The domain \(a, b\) of \(x\) are given by the class’s bounds.
- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
out – A map between the transformed variable name and value(s), along with the original variable name and value(s).
- Return type:
dict or FieldArray
- jacobian(maps)
Computes the Jacobian of \(y = \mathrm{logistic}(x; a,b)\).
This is:
\[\frac{\mathrm{d}y}{\mathrm{d}x} = \frac{e^x (b-a)}{(1+e^y)^2},\]where \(y \in (a, b)\).
- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
The value of the jacobian at the given point(s).
- Return type:
- name = 'logistic'
- transform(maps)
Computes \(y = \mathrm{logistic}(x; a,b)\).
The codomain \(a, b\) of \(y\) are given by the class’s bounds.
- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
out – A map between the transformed variable name and value(s), along with the original variable name and value(s).
- Return type:
dict or FieldArray
- class pycbc.transforms.Logit(inputvar, outputvar, domain=(0.0, 1.0))[source]
Bases:
BaseTransform
Applies a logit transform from an inputvar parameter to an outputvar parameter. This is the inverse of the logistic transform.
Typically, the input of the logit function is assumed to have domain \(\in (0, 1)\). However, the domain argument can be used to expand this to any finite real interval.
- Parameters:
- property bounds
Returns the domain of the input parameter.
- classmethod from_config(cp, section, outputs, skip_opts=None, additional_opts=None)[source]
Initializes a Logit transform from the given section.
The section must specify an input and output variable name. The domain of the input may be specified using min-{input}, max-{input}. Example:
[{section}-logitq] name = logit inputvar = q outputvar = logitq min-q = 1 max-q = 8
- Parameters:
cp (pycbc.workflow.WorkflowConfigParser) – A parsed configuration file that contains the transform options.
section (str) – Name of the section in the configuration file.
outputs (str) – The names of the parameters that are output by this transformation, separated by VARARGS_DELIM. These must appear in the “tag” part of the section header.
skip_opts (list, optional) – Do not read options in the given list.
additional_opts (dict, optional) – Any additional arguments to pass to the class. If an option is provided that also exists in the config file, the value provided will be used instead of being read from the file.
- Returns:
An instance of the class.
- Return type:
cls
- property inputvar
Returns the input parameter.
- inverse_jacobian(maps)[source]
Computes the Jacobian of \(y = \mathrm{logistic}(x; a,b)\).
This is:
\[\frac{\mathrm{d}y}{\mathrm{d}x} = \frac{e^x (b-a)}{(1+e^y)^2},\]where \(y \in (a, b)\).
- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
The value of the jacobian at the given point(s).
- Return type:
- inverse_transform(maps)[source]
Computes \(y = \mathrm{logistic}(x; a,b)\).
The codomain \(a, b\) of \(y\) are given by the class’s bounds.
- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
out – A map between the transformed variable name and value(s), along with the original variable name and value(s).
- Return type:
dict or FieldArray
- jacobian(maps)[source]
Computes the Jacobian of \(y = \mathrm{logit}(x; a,b)\).
This is:
\[\frac{\mathrm{d}y}{\mathrm{d}x} = \frac{b -a}{(x-a)(b-x)},\]where \(x \in (a, b)\).
- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
The value of the jacobian at the given point(s).
- Return type:
- static logistic(x, a=0.0, b=1.0)[source]
Computes the logistic function with range \(\in (a, b)\).
This is given by:
\[\mathrm{logistic}(x; a, b) = \frac{a + b e^x}{1 + e^x}.\]Note that this is also the inverse of the logit function with domain \((a, b)\).
- static logit(x, a=0.0, b=1.0)[source]
Computes the logit function with domain \(x \in (a, b)\).
This is given by:
\[\mathrm{logit}(x; a, b) = \log\left(\frac{x-a}{b-x}\right).\]Note that this is also the inverse of the logistic function with range \((a, b)\).
- name = 'logit'
- property outputvar
Returns the output parameter.
- transform(maps)[source]
Computes \(\mathrm{logit}(x; a, b)\).
The domain \(a, b\) of \(x\) are given by the class’s bounds.
- Parameters:
maps (dict or FieldArray) – A dictionary or FieldArray which provides a map between the parameter name of the variable to transform and its value(s).
- Returns:
out – A map between the transformed variable name and value(s), along with the original variable name and value(s).
- Return type:
dict or FieldArray
- class pycbc.transforms.Mass1Mass2ToMchirpEta[source]
Bases:
MchirpEtaToMass1Mass2
The inverse of MchirpEtaToMass1Mass2.
- inverse
alias of
MchirpEtaToMass1Mass2
- inverse_jacobian(maps)
Returns the Jacobian for transforming mchirp and eta to mass1 and mass2.
- inverse_transform(maps)
This function transforms from chirp mass and symmetric mass ratio to component masses.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
>>> import numpy >>> from pycbc import transforms >>> t = transforms.MchirpEtaToMass1Mass2() >>> t.transform({'mchirp': numpy.array([10.]), 'eta': numpy.array([0.25])}) {'mass1': array([ 16.4375183]), 'mass2': array([ 8.21875915]), 'mchirp': array([ 10.]), 'eta': array([ 0.25])}
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- jacobian(maps)
Returns the Jacobian for transforming mass1 and mass2 to mchirp and eta.
- name = 'mass1_mass2_to_mchirp_eta'
- transform(maps)
This function transforms from component masses to chirp mass and symmetric mass ratio.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
>>> import numpy >>> from pycbc import transforms >>> t = transforms.MchirpQToMass1Mass2() >>> t.inverse_transform({'mass1': numpy.array([8.2]), 'mass2': numpy.array([8.2])}) {'mass1': array([ 8.2]), 'mass2': array([ 8.2]), 'mchirp': array([ 9.97717521]), 'eta': 0.25}
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- class pycbc.transforms.Mass1Mass2ToMchirpQ(mass1_param=None, mass2_param=None, mchirp_param=None, q_param=None)[source]
Bases:
MchirpQToMass1Mass2
The inverse of MchirpQToMass1Mass2.
- inverse
alias of
MchirpQToMass1Mass2
- inverse_jacobian(maps)
Returns the Jacobian for transforming mchirp and q to mass1 and mass2.
- inverse_transform(maps)
This function transforms from chirp mass and mass ratio to component masses.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
>>> import numpy >>> from pycbc import transforms >>> t = transforms.MchirpQToMass1Mass2() >>> t.transform({'mchirp': numpy.array([10.]), 'q': numpy.array([2.])}) {'mass1': array([ 16.4375183]), 'mass2': array([ 8.21875915]), 'mchirp': array([ 10.]), 'q': array([ 2.])}
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- jacobian(maps)
Returns the Jacobian for transforming mass1 and mass2 to mchirp and q.
- name = 'mass1_mass2_to_mchirp_q'
- transform(maps)
This function transforms from component masses to chirp mass and mass ratio.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
>>> import numpy >>> from pycbc import transforms >>> t = transforms.MchirpQToMass1Mass2() >>> t.inverse_transform({'mass1': numpy.array([16.4]), 'mass2': numpy.array([8.2])}) {'mass1': array([ 16.4]), 'mass2': array([ 8.2]), 'mchirp': array([ 9.97717521]), 'q': 2.0}
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- class pycbc.transforms.MchirpEtaToMass1Mass2[source]
Bases:
BaseTransform
Converts chirp mass and symmetric mass ratio to component masses.
- inverse_jacobian(maps)[source]
Returns the Jacobian for transforming mass1 and mass2 to mchirp and eta.
- inverse_transform(maps)[source]
This function transforms from component masses to chirp mass and symmetric mass ratio.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
>>> import numpy >>> from pycbc import transforms >>> t = transforms.MchirpQToMass1Mass2() >>> t.inverse_transform({'mass1': numpy.array([8.2]), 'mass2': numpy.array([8.2])}) {'mass1': array([ 8.2]), 'mass2': array([ 8.2]), 'mchirp': array([ 9.97717521]), 'eta': 0.25}
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- name = 'mchirp_eta_to_mass1_mass2'
- transform(maps)[source]
This function transforms from chirp mass and symmetric mass ratio to component masses.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
>>> import numpy >>> from pycbc import transforms >>> t = transforms.MchirpEtaToMass1Mass2() >>> t.transform({'mchirp': numpy.array([10.]), 'eta': numpy.array([0.25])}) {'mass1': array([ 16.4375183]), 'mass2': array([ 8.21875915]), 'mchirp': array([ 10.]), 'eta': array([ 0.25])}
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- class pycbc.transforms.MchirpQToMass1Mass2(mass1_param=None, mass2_param=None, mchirp_param=None, q_param=None)[source]
Bases:
BaseTransform
Converts chirp mass and mass ratio to component masses.
- inverse
alias of
Mass1Mass2ToMchirpQ
- inverse_jacobian(maps)[source]
Returns the Jacobian for transforming mass1 and mass2 to mchirp and q.
- inverse_transform(maps)[source]
This function transforms from component masses to chirp mass and mass ratio.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
>>> import numpy >>> from pycbc import transforms >>> t = transforms.MchirpQToMass1Mass2() >>> t.inverse_transform({'mass1': numpy.array([16.4]), 'mass2': numpy.array([8.2])}) {'mass1': array([ 16.4]), 'mass2': array([ 8.2]), 'mchirp': array([ 9.97717521]), 'q': 2.0}
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- name = 'mchirp_q_to_mass1_mass2'
- transform(maps)[source]
This function transforms from chirp mass and mass ratio to component masses.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
>>> import numpy >>> from pycbc import transforms >>> t = transforms.MchirpQToMass1Mass2() >>> t.transform({'mchirp': numpy.array([10.]), 'q': numpy.array([2.])}) {'mass1': array([ 16.4375183]), 'mass2': array([ 8.21875915]), 'mchirp': array([ 10.]), 'q': array([ 2.])}
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- class pycbc.transforms.PrecessionMassSpinToCartesianSpin[source]
Bases:
BaseTransform
Converts mass-weighted spins to cartesian x-y plane spins.
- inverse
alias of
CartesianSpinToPrecessionMassSpin
- inverse_transform(maps)[source]
This function transforms from component masses and cartesian spins to mass-weighted spin parameters perpendicular with the angular momentum.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- name = 'precession_mass_spin_to_cartesian_spin'
- class pycbc.transforms.SSBToGEO(tc_geo_param=None, longitude_geo_param=None, latitude_geo_param=None, polarization_geo_param=None, tc_ssb_param=None, longitude_ssb_param=None, latitude_ssb_param=None, polarization_ssb_param=None)[source]
Bases:
GEOToSSB
The inverse of GEOToSSB.
- inverse_transform(maps)
This function transforms arrival time, sky localization, and polarization angle in the geocentric frame to the corresponding values in the SSB frame.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- name = 'ssb_to_geo'
- transform(maps)
This function transforms arrival time, sky localization, and polarization angle in the SSB frame to the corresponding values in the geocentric frame.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- class pycbc.transforms.SSBToLISA(tc_lisa_param=None, longitude_lisa_param=None, latitude_lisa_param=None, polarization_lisa_param=None, tc_ssb_param=None, longitude_ssb_param=None, latitude_ssb_param=None, polarization_ssb_param=None)[source]
Bases:
LISAToSSB
The inverse of LISAToSSB.
- inverse_transform(maps)
This function transforms arrival time, sky localization, and polarization angle in the LISA frame to the corresponding values in the SSB frame.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- name = 'ssb_to_lisa'
- transform(maps)
This function transforms arrival time, sky localization, and polarization angle in the SSB frame to the corresponding values in the LISA frame.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- class pycbc.transforms.SphericalSpin1ToCartesianSpin1[source]
Bases:
SphericalToCartesian
Converts spherical spin parameters (radial and two angles) to catesian spin parameters. This class only transforms spins for the first component mass.
Deprecation Warning: This will be removed in a future update. Use
SphericalToCartesian
with spin-parameter names passed in instead.- inverse
alias of
CartesianSpin1ToSphericalSpin1
- name = 'spherical_spin_1_to_cartesian_spin_1'
- class pycbc.transforms.SphericalSpin2ToCartesianSpin2[source]
Bases:
SphericalToCartesian
Converts spherical spin parameters (radial and two angles) to catesian spin parameters. This class only transforms spins for the first component mass.
Deprecation Warning: This will be removed in a future update. Use
SphericalToCartesian
with spin-parameter names passed in instead.- inverse
alias of
CartesianSpin2ToSphericalSpin2
- name = 'spherical_spin_2_to_cartesian_spin_2'
- class pycbc.transforms.SphericalToCartesian(x, y, z, radial, azimuthal, polar)[source]
Bases:
BaseTransform
Converts spherical coordinates to cartesian.
- Parameters:
- inverse
alias of
CartesianToSpherical
- inverse_transform(maps)[source]
This function transforms from cartesian to spherical spins.
- Parameters:
maps (a mapping object)
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- name = 'spherical_to_cartesian'
- transform(maps)[source]
This function transforms from spherical to cartesian spins.
- Parameters:
maps (a mapping object)
Examples
Convert a dict of numpy.array:
>>> import numpy >>> from pycbc import transforms >>> t = transforms.SphericalToCartesian('x', 'y', 'z', 'a', 'phi', 'theta') >>> t.transform({'a': numpy.array([0.1]), 'phi': numpy.array([0.1]), 'theta': numpy.array([0.1])}) {'a': array([ 0.1]), 'phi': array([ 0.1]), 'theta': array([ 0.1]), 'x': array([ 0.00993347]), 'y': array([ 0.00099667]), 'z': array([ 0.09950042])}
- Returns:
out – A dict with key as parameter name and value as numpy.array or float of transformed values.
- Return type:
- pycbc.transforms.apply_transforms(samples, transforms, inverse=False)[source]
Applies a list of BaseTransform instances on a mapping object.
- Parameters:
samples ({FieldArray, dict}) – Mapping object to apply transforms to.
transforms (list) – List of BaseTransform instances to apply. Nested transforms are assumed to be in order for forward transforms.
inverse (bool, optional) – Apply inverse transforms. In this case transforms will be applied in the opposite order. Default is False.
- Returns:
samples – Mapping object with transforms applied. Same type as input.
- Return type:
{FieldArray, dict}
- pycbc.transforms.compute_jacobian(samples, transforms, inverse=False)[source]
Computes the jacobian of the list of transforms at the given sample points.
- Parameters:
- Returns:
The product of the jacobians of all fo the transforms.
- Return type:
- pycbc.transforms.get_common_cbc_transforms(requested_params, variable_args, valid_params=None)[source]
Determines if any additional parameters from the InferenceFile are needed to get derived parameters that user has asked for.
First it will try to add any base parameters that are required to calculate the derived parameters. Then it will add any sampling parameters that are required to calculate the base parameters needed.
- Parameters:
- Returns:
requested_params (list) – Updated list of parameters that user wants.
all_c (list) – List of BaseTransforms to apply.
- pycbc.transforms.order_transforms(transforms)[source]
Orders transforms to ensure proper chaining.
For example, if transforms = [B, A, C], and A produces outputs needed by B, the transforms will be re-rorderd to [A, B, C].
- Parameters:
transforms (list) – List of transform instances to order.
Outputs
-------
list – List of transformed ordered such that forward transforms can be carried out without error.
- pycbc.transforms.read_transforms_from_config(cp, section='transforms')[source]
Returns a list of PyCBC transform instances for a section in the given configuration file.
If the transforms are nested (i.e., the output of one transform is the input of another), the returned list will be sorted by the order of the nests.
- Parameters:
cp (WorflowConfigParser) – An open config file to read.
section ({"transforms", string}) – Prefix on section names from which to retrieve the transforms.
- Returns:
A list of the parsed transforms.
- Return type:
pycbc.version module
Module contents
PyCBC contains a toolkit for CBC gravitational wave analysis
- class pycbc.LogFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]
Bases:
Formatter
Format the logging appropriately This will return the log time in the ISO 6801 standard, but with millisecond precision https://en.wikipedia.org/wiki/ISO_8601 e.g. 2022-11-18T09:53:01.554+00:00
- converter()
timestamp[, tz] -> tz’s local time from POSIX timestamp.
- formatTime(record, datefmt=None)[source]
Return the creation time of the specified LogRecord as formatted text.
This method should be called from format() by a formatter which wants to make use of a formatted time. This method can be overridden in formatters to provide for any specific requirement, but the basic behaviour is as follows: if datefmt (a string) is specified, it is used with time.strftime() to format the creation time of the record. Otherwise, an ISO8601-like (or RFC 3339-like) format is used. The resulting string is returned. This function uses a user-configurable function to convert the creation time to a tuple. By default, time.localtime() is used; to change this for a particular formatter instance, set the ‘converter’ attribute to a function with the same signature as time.localtime() or time.gmtime(). To change it for all formatters, for example if you want all logging times to be shown in GMT, set the ‘converter’ attribute in the Formatter class.
- pycbc.add_common_pycbc_options(parser)[source]
Common utility to add standard options to each PyCBC executable.
- Parameters:
parser (argparse.ArgumentParser) – The argument parser to which the options will be added
- pycbc.init_logging(verbose=False, default_level=0, to_file=None, format='%(asctime)s %(levelname)s : %(message)s')[source]
Common utility for setting up logging in PyCBC.
Installs a signal handler such that verbosity can be activated at run-time by sending a SIGUSR1 to the process.
- Parameters:
verbose (bool or int, optional) – What level to set the verbosity level to. Accepts either a boolean or an integer representing the level to set. If True/False will set to
logging.INFO
/logging.WARN
. For higher logging levels, pass an integer representing the level to set. (1 = INFO, 2 = DEBUG).default_level (int, optional) – The default level, to be added to any verbose option if it is an integer, or set to this value if it is None or False
to_file (filepath) – Set up logging to a file instead of the stderr. File will be overwritten if it already exists.
format (str, optional) – The format to use for logging messages.