utils Package

utils Package

seek.utils.format_date(date, fmt='%Y-%m-%d')[source]

Format datetime object into specific format string.

Parameters:
  • date – datetime object
  • fmt – format definition
Returns:

formatted string

seek.utils.load_file(path, **kwargs)[source]

Load text file within the main code directory.

Parameters:path – path of file within the main code directory
Returns:array generated from text file
seek.utils.parse_datetime(s, fmt='%Y-%m-%d-%H:%M:%S')[source]

Parse datetime object with specific format.

Parameters:
  • s – datetime string
  • fmt – format definition
Returns:

parsed datetime object

filter Module

Created on Jan 23, 2015

author: jakeret

seek.utils.filter.gaussian_filter(V, mask, M=40, N=20, sigma_m=0.5, sigma_n=0.5)[source]

Applies a gaussian filter (smoothing) to the given array taking into account masked values :param V: the value array to be smoothed :param mask: boolean array defining masked values :param M: kernel window size in axis=1 :param N: kernel window size in axis=0 :param sigma_m: kernel sigma in axis=1 :param sigma_n: kernel sigma in axis=0

Returns vs:the filtered array

plotting Module

sphere Module

Created on Dec 22, 2014

author: jakeret

seek.utils.sphere.altaz_to_ra_dec(date, az, alt, obs=None, params=None)[source]

Convert Azimuth/Elevation/time to RA/DEC coordinates.

Parameters:
  • date – date and time
  • az – Azimuth coordinate
  • alt – Elevation coordinate
  • obs – pyephem observer
  • params – context parameters
Returns:

RA/DEC coordinates

seek.utils.sphere.get_observer(params)[source]

Define pyephem observer.

Parameters:params – telescope parameters from context
Returns:pyephem observer

tod_utils Module

Created on Aug 18, 2015

author: jakeret

seek.utils.tod_utils.get_empty_mask(shape)[source]
seek.utils.tod_utils.smooth(tod, factor, axis=1)[source]

Smoothes a tod by the given factor. E.g. (axis=1):

[[1,1,2,2,3,3], -- factor 2 --> [[1,2,3],
[4,4,5,5,6,6]]                  [4,5,6]]
Parameters:
  • tod – the data to be smoothed
  • factor – the factor to use for the integration
seek.utils.tod_utils.spectral_kurtosis_mask(p_phase0, p_phase1, p2_phase0, p2_phase1, M, offset)[source]

Creates a mask using the spectral kurtosis for the given arrays

Parameters:
  • p_phase0 – array of P values for phase0
  • p_phase1 – array of P values for phase1
  • p2_phase0 – array of P^2 values for phase0
  • p2_phase1 – array of P^2 values for phase1
  • M – number of accumulations
  • offset – P_select 0
Returns mask:

boolean array containing the mask