:py:mod:`nessai.gw.legacy` ========================== .. py:module:: nessai.gw.legacy .. autoapi-nested-parse:: Legacy version of GWFlowProposal used in the first paper and the realted utilities and priors .. !! processed by numpydoc !! Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: nessai.gw.legacy.LegacyGWFlowProposal Functions ~~~~~~~~~ .. autoapisummary:: nessai.gw.legacy.determine_rescaled_bounds nessai.gw.legacy.angle_to_cartesian nessai.gw.legacy.cartesian_to_angle nessai.gw.legacy.ra_dec_to_cartesian nessai.gw.legacy.cartesian_to_ra_dec nessai.gw.legacy.azimuth_zenith_to_cartesian nessai.gw.legacy.cartesian_to_azimuth_zenith nessai.gw.legacy.zero_one_to_cartesian nessai.gw.legacy.cartesian_to_zero_one nessai.gw.legacy.transform_from_precessing_parameters nessai.gw.legacy.transform_to_precessing_parameters nessai.gw.legacy.rescale_and_logit nessai.gw.legacy.rescale_and_sigmoid nessai.gw.legacy.log_uniform_prior nessai.gw.legacy.log_2d_cartesian_prior nessai.gw.legacy.log_2d_cartesian_prior_sine nessai.gw.legacy.log_3d_cartesian_prior nessai.gw.legacy.log_spin_prior nessai.gw.legacy.log_spin_prior_uniform Attributes ~~~~~~~~~~ .. autoapisummary:: nessai.gw.legacy.logger .. py:data:: logger .. !! processed by numpydoc !! .. py:function:: determine_rescaled_bounds(prior_min, prior_max, x_min, x_max, invert) Determine the values of the prior min and max in the rescaled space. Parameters ---------- prior_min : float Mininum of the prior prior_max : float Maximum of the prior x_min : float New minimum x_max : float New maximum invert : false or {'upper', 'lower', 'both'} Type of inversion .. !! processed by numpydoc !! .. py:function:: angle_to_cartesian(alpha, r=None, scale=1.0) Decompose an angle into a real and imaginary part .. !! processed by numpydoc !! .. py:function:: cartesian_to_angle(x, y, scale=1.0, zero='centre') Reconstruct an angle given the real and imaginary part. Assume the angle is defined on [0, 2 pi] / scale. :Parameters: **x, y** : array_like Cartesian coordinates **scale** : float, optional Rescaling factor used to rescale from [0, 2pi] **zero** : str, {centre, bound} Specifiy is zero should be the central value or lower bound .. !! processed by numpydoc !! .. py:function:: ra_dec_to_cartesian(ra, dec, dL=None) Convert right ascension, declination and (optional) luminosity distance (defined on [0, 1]) to Cartesian coordinates. :Parameters: **ra, dec: array_like** Right ascension and declination **dL: array_like, optional** Corresponding luminosity distance defined on [0, 1]. If None (default) radial componment is drawn froma chi distribution with 3 degrees of freedom :Returns: x, y, z: array_like Cartesian coordinates log_J: array_like Determinant of the log-Jacobian .. !! processed by numpydoc !! .. py:function:: cartesian_to_ra_dec(x, y, z) Reconstruct an angle given the real and imaginary part :Parameters: **x, y, z: array_like** Three dimensional Cartesian coordinates **Returns:** .. **ra, dec: array_like** Right ascension and declination **dl: array_like** Luminosity distance **log_J: array_like** Determinant of the log-Jacobian .. !! processed by numpydoc !! .. py:function:: azimuth_zenith_to_cartesian(azimuth, zenith, dL=None) Convert azimuth, zenith and (optional) luminosity distance (defined on [0, 1]) to Cartesian coordinates. :Parameters: **azimuth, zenith: array_like** Azimuth and zenith **dL: array_like, optional** Corresponding luminosity distance defined on [0, 1]. If None (default) radial componment is drawn froma chi distribution with 3 degrees of freedom :Returns: x, y, z: array_like Cartesian coordinates log_J: array_like Determinant of the log-Jacobian .. !! processed by numpydoc !! .. py:function:: cartesian_to_azimuth_zenith(x, y, z) Reconstruct an angle given the real and imaginary part :Parameters: **x, y, z: array_like** Three dimensional Cartesian coordinates .. !! processed by numpydoc !! .. py:function:: zero_one_to_cartesian(theta, mode='split') Convert a variable defined on [0,1] to an angle on [-pi, pi] and to Cartesian coordinates with a radius drawn from a chi distribution with two degrees of freedom. The lower bound is place at 0 and the upper bound at -pi/pi. :Parameters: **theta: array_like** Array of values bound on [0, 1] :Returns: x, y: array_like Cartesian coordinates log_J: array_like Determinant of the log-Jacobian .. !! processed by numpydoc !! .. py:function:: cartesian_to_zero_one(x, y) Convert Cartesian coordinates to a variable defined on [0, 1] and a corresponding radius. :Parameters: **x, y: array_like** Cartesian coordinates :Returns: theta: array_like Variable defined on [0,1] radius: array_like Corresponding radius log_J: array_like Determinant of log-Jacobian .. !! processed by numpydoc !! .. py:function:: transform_from_precessing_parameters(theta_jn, phi_jl, theta_1, theta_2, phi_12, a_1, a_2, m1, m2, f_ref, phase) .. !! processed by numpydoc !! .. py:function:: transform_to_precessing_parameters(iota, s1x, s1y, s1z, s2x, s2y, s2z, m1, m2, f_ref, phase) .. !! processed by numpydoc !! .. py:function:: rescale_and_logit(x, xmin, xmax) .. !! processed by numpydoc !! .. py:function:: rescale_and_sigmoid(x, xmin, xmax) .. !! processed by numpydoc !! .. py:function:: log_uniform_prior(x, xmin=-1, xmax=1) Unformalised log probability of uniform prior .. !! processed by numpydoc !! .. py:function:: log_2d_cartesian_prior(x, y, k=np.pi) Log probability of Cartesian coordinates for a uniform distibution of angles on [0, k] and a radial component drawn from a chi distribution with two degrees of freedom. .. !! processed by numpydoc !! .. py:function:: log_2d_cartesian_prior_sine(x, y) Log probability of Cartesian coordinates for a sine distibution of angles and a radial component drawn from a chi distribution with two degrees of freedom. .. !! processed by numpydoc !! .. py:function:: log_3d_cartesian_prior(x, y, z) Log probability of 3d Cartesian coordinates for an isotropic distribution of angles and a radial component drawn from a chi distribution with three degrees of freedom. .. !! processed by numpydoc !! .. py:function:: log_spin_prior(s1x, s1y, s1z, s2x, s2y, s2z, k1=0.99, k2=0.99) Log probability of the prior on the components of spin vectors assume the distribution of a_i is uniform. .. !! processed by numpydoc !! .. py:function:: log_spin_prior_uniform(s1x, s1y, s1z, s2x, s2y, s2z, k1=0.99, k2=0.99) Log probability of the prior on the components of spin vectors assume the distribution the components in uniform within the 2-ball. .. !! processed by numpydoc !! .. py:class:: LegacyGWFlowProposal(model, reparameterisations={}, **kwargs) Bases: :py:obj:`nessai.proposal.FlowProposal` A proposal specific to gravitational wave CBC .. !! processed by numpydoc !! .. py:method:: set_reparameterisations(self, reparameterisations) Set the relevant reparamterisation flags .. !! processed by numpydoc !! .. py:method:: setup_angle(self, name, radial_name=False, scale=1.0, zero='bound') Add an angular parameter to the list of reparameterisations .. !! processed by numpydoc !! .. py:method:: inversion_parameters(self) :property: Returns a list of parameters to which an inversion (normal or log) .. !! processed by numpydoc !! .. py:method:: add_inversion(self, name) Setup inversion .. !! processed by numpydoc !! .. py:method:: add_log_inversion(self, name) Setup log inversion .. !! processed by numpydoc !! .. py:method:: add_angle_conversion(self, name, mode='split') .. !! processed by numpydoc !! .. py:method:: configure_time(self) Configure the time parameter if present .. !! processed by numpydoc !! .. py:method:: configure_sky(self) Configure the sky parameters .. !! processed by numpydoc !! .. py:method:: configure_angles(self) Configure angles .. !! processed by numpydoc !! .. py:method:: set_rescaling(self) Set the rescaling functions .. !! processed by numpydoc !! .. py:method:: check_state(self, x) Check the state of the rescaling before training .. !! processed by numpydoc !! .. py:method:: update_rescaled_bounds(self, rescaled_names=None, xmin=None, xmax=None) .. !! processed by numpydoc !! .. py:method:: setup_uniform_distance_parameter(self, scale_factor=1000, **kwargs) Set up the uniform distance parameter dc3 :Parameters: **scale_factor** : float, (optional) Factor used to rescale comoving distance **kwargs** Keyword arguments parsed to `ComovingDistanceConverter` .. !! processed by numpydoc !! .. py:method:: convert_to_dl(self, dc3) Convert from uniform distance parameter dc3 to luminosity distance .. !! processed by numpydoc !! .. py:method:: convert_to_dc3(self, dl) Convert to uniform distance parameter dc3 .. !! processed by numpydoc !! .. py:method:: setup_spin_logit(self, fuzz_factor=0.01) .. !! processed by numpydoc !! .. py:method:: configure_spin_conversion(self, m1=20, m2=20, phase=0, f_ref=20, scale_factor=1, use_cbrt=True) .. !! processed by numpydoc !! .. py:method:: rescale(self, x, compute_radius=False, test=None) Rescale from the x space to the x prime space .. !! processed by numpydoc !! .. py:method:: inverse_rescale(self, x_prime) Rescale from the x prime space to the x space .. !! processed by numpydoc !! .. py:method:: log_prior(self, x) Modified log prior that handles radial parameters .. !! processed by numpydoc !! .. py:method:: compute_rescaled_bounds(self, name) .. !! processed by numpydoc !! .. py:method:: x_prime_log_prior(self, x_prime) Priors redefined in the x_prime space .. !! processed by numpydoc !!