snsim.nb_fun

This module contains functions with numba decorator to speed up the simulation.

Functions

sine_interp(x_new, fun_x, fun_y)

Return the sinus interpolation of a function at x.

R_base(theta, phi, vec)

Give rotation to RA := theta, DEC := phi.

new_coord_on_fields(ra_dec, ra_dec_frame, new_radec)

Compute new coordinates of an object in a list of fields frames.

radec_to_cart_2d(ra, dec)

Compute carthesian vector for given RA Dec coordinates.

radec_to_cart(ra, dec)

Compute carthesian vector for given RA Dec coordinates.

Module Contents

snsim.nb_fun.sine_interp(x_new, fun_x, fun_y)

Return the sinus interpolation of a function at x.

Parameters:
  • x_new (float) – New x where evaluate the function.

  • fun_x (list(float)) – Existing function x.

  • fun_y (list(float)) – Existing function y.

Returns:

The sinus interpolation value of f at x_new.

Return type:

float

snsim.nb_fun.R_base(theta, phi, vec)

Give rotation to RA := theta, DEC := phi. :param theta: RA amplitude of the rotation :type theta: float :param phi: Dec amplitude of the rotation :type phi: float :param vec: Carthesian vector to rotate :type vec: numpy.ndarray(float)

Returns:

Rotated vector.

Return type:

numpy.ndarray(float)

snsim.nb_fun.new_coord_on_fields(ra_dec, ra_dec_frame, new_radec)

Compute new coordinates of an object in a list of fields frames. :param ra_frame: Field Right Ascension. :type ra_frame: numpy.ndarray(float) :param dec_frame: Field Declinaison. :type dec_frame: numpy.ndarray(float) :param vec: The carthesian coordinates of the object. :type vec: numpy.ndarray(float, size = 3)

Returns:

The new coordinates of the obect in each field frame.

Return type:

numpy.ndarray(float, size = (2, ?))

snsim.nb_fun.radec_to_cart_2d(ra, dec)

Compute carthesian vector for given RA Dec coordinates.

Parameters:
Returns:

Carthesian coordinates corresponding to RA Dec coordinates.

Return type:

numpy.ndarray(float)

snsim.nb_fun.radec_to_cart(ra, dec)

Compute carthesian vector for given RA Dec coordinates.

Parameters:
  • ra (float) – Right Ascension.

  • dec (float) – Declinaison.

Returns:

Carthesian coordinates corresponding to RA Dec coordinates.

Return type:

numpy.array(float)