flip.utils#

Attributes#

Classes#

Functions#

Du(k, sigmau)

radec2cart(rcom, ra, dec)

The radec2cart function takes in the comoving distance to a galaxy,

cart2radec(x, y, z)

The cart2radec function converts cartesian coordinates to spherical

return_key(dictionary, string, default_value)

The return_key function takes a dictionary, a string, and a default value.

create_log([log_level])

The create_log function creates a logger object that can be used to log messages.

Module Contents#

flip.utils._C_LIGHT_KMS_#
flip.utils.Du(k, sigmau)[source]#
flip.utils.radec2cart(rcom, ra, dec)[source]#
The radec2cart function takes in the comoving distance to a galaxy,

its right ascension and declination, and returns the x, y, z coordinates of that galaxy.

Parameters:
  • rcom – Convert the ra and dec to cartesian coordinates

  • ra – Calculate the x-coordinate of a point in space

  • dec – Calculate the z coordinate

Returns:

The x, y and z coordinates of each galaxy

flip.utils.cart2radec(x, y, z)[source]#

The cart2radec function converts cartesian coordinates to spherical coordinates. The input is a set of x, y, and z values. The output is the radius (rcom), right ascension (ra), and declination (dec).

Parameters:
  • x – Represent the x-coordinate of a point in space

  • y – Calculate the right ascension

  • z – Calculate the declination

Returns:

The radius, right ascension and declination of a point in cartesian coordinates

flip.utils.return_key(dictionary, string, default_value)[source]#

The return_key function takes a dictionary, a string, and a default value. It returns the value of the key in the dictionary that matches the string if it exists. If not, it returns the default_value.

Parameters:
  • dictionary – Pass in a dictionary to the function

  • string – Specify the key to look up in the dictionary

  • default_value – Return a default value if the key is not in the dictionary

Returns:

A value from a dictionary

flip.utils.create_log(log_level='info')[source]#

The create_log function creates a logger object that can be used to log messages. The function takes one argument, the log_level, which is set to "info" by default. The function returns a Logger object with the specified logging level.

Parameters:

log_level – Set the logging level

Returns:

A logger object

flip.utils._logging_handler = None#
class flip.utils.Logger(name='Python_Report', log_level='info')[source]#

Bases: object

name = 'Python_Report'#
log_level = 'info'#
setup_logging()[source]#

The setup_logging function is used to set up the logging module.

Parameters:

self – Refer to the current instance of a class

Returns:

Nothing

setup_report_logging()[source]#

The setup_report_logging function is used to set up the logging for a report.

Parameters:

self – Represent the instance of the class

Returns:

None

static add(line, level='info')[source]#

The add function takes a line of text and adds it to the log file. It also takes an optional level argument, which can be set to "info", "warning" or "debug". If no level is specified, the default value is used ("info").

Parameters:
  • line – Pass the line of text to be logged

  • level – Determine the type of log message

Returns:

None

static add_array_statistics(arr, char)[source]#

The add_array_statistics function takes in an array and a character, and prints out the min, max, mean, and standard deviation of that array.

Parameters:
  • arr – Store the array that is passed to the function

  • char – Specify which array is being used

Returns:

The minimum, maximum, mean and standard deviation of the array

static close()[source]#

The close function shuts down the logging module.

Args:

Returns:

The return value of the logging