Citlali
Loading...
Searching...
No Matches
Classes | Namespaces | Enumerations | Functions
utils.h File Reference
#include <time.h>
#include <vector>
#include <numeric>
#include <complex>
#include <fftw3.h>
#include <Eigen/Core>
#include <unsupported/Eigen/FFT>
#include <unsupported/Eigen/Splines>
#include <tula/grppi.h>
#include <tula/algorithm/ei_stats.h>
#include <citlali/core/utils/constants.h>
Include dependency graph for utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  engine_utils::SplineFunction
 
struct  engine_utils::scoped_timeit
 An RAII class to report the lifetime of itself. More...
 

Namespaces

namespace  engine_utils
 

Enumerations

enum  engine_utils::FFTDirection { engine_utils::forward = 0 , engine_utils::inverse = 1 }
 
enum  engine_utils::SmoothType { engine_utils::boxcar = 0 , engine_utils::edge_truncate = 1 }
 

Functions

static const int engine_utils::parseLine (char *line)
 
static const int engine_utils::get_phys_memory ()
 
static const double engine_utils::planck_nu (const double freq_Hz, const double T_K)
 
static const double engine_utils::mJy_beam_to_uK (const double flux_mjy_beam, const double freq_Hz, const double fwhm)
 
static const std::string engine_utils::current_date_time ()
 
static const std::string engine_utils::unix_to_utc (double &t)
 
template<typename DerivedA , typename DerivedB >
void engine_utils::utc_to_unix (Eigen::DenseBase< DerivedA > &tel_utc, Eigen::DenseBase< DerivedB > &ut_date)
 
static long long engine_utils::modified_julian_date_to_unix (double jd)
 
static double engine_utils::unix_to_modified_julian_date (double unix_time)
 
template<typename Derived >
auto engine_utils::make_meshgrid (const Eigen::DenseBase< Derived > &x, const Eigen::DenseBase< Derived > &y)
 
template<FFTDirection direction, typename Derived >
auto engine_utils::fft (Eigen::DenseBase< Derived > &in, std::string parallel_policy)
 
template<FFTDirection direction, typename Derived , typename fftw_plan_t >
auto engine_utils::fft2 (Eigen::DenseBase< Derived > &in, fftw_plan_t &plan, fftw_complex *a, fftw_complex *b)
 
template<class F , class... Ts, std::size_t... Is>
void engine_utils::for_each_in_tuple (const std::tuple< Ts... > &tuple, F func, std::index_sequence< Is... >)
 
template<class F , class... Ts>
void engine_utils::for_each_in_tuple (const std::tuple< Ts... > &tuple, F func)
 
template<typename Derived >
std::vector< std::tuple< double, int > > engine_utils::sorter (Eigen::DenseBase< Derived > &vec)
 
template<typename DerivedA >
auto engine_utils::calc_std_dev (Eigen::DenseBase< DerivedA > &data)
 
template<typename DerivedA , typename DerivedB >
auto engine_utils::calc_std_dev (Eigen::DenseBase< DerivedA > &data, Eigen::DenseBase< DerivedB > &flag)
 
template<typename DerivedA >
auto engine_utils::calc_rms (Eigen::DenseBase< DerivedA > &data)
 
template<typename DerivedA , typename DerivedB >
auto engine_utils::calc_rms (Eigen::DenseBase< DerivedA > &data, Eigen::DenseBase< DerivedB > &flag)
 
template<typename Derived >
double engine_utils::calc_mad (Eigen::DenseBase< Derived > &data)
 
static auto engine_utils::hanning_window (Eigen::Index n_rows, Eigen::Index n_cols)
 
static double engine_utils::pivot_select (std::vector< double > input, int index)
 
template<typename Derived >
double engine_utils::find_weight_threshold (Eigen::DenseBase< Derived > &weight, double cov)
 
template<typename Derived >
auto engine_utils::set_cov_cov_ranges (const Eigen::DenseBase< Derived > &weight, const double weight_threshold)
 
template<SmoothType smooth_type, typename DerivedA , typename DerivedB >
void engine_utils::smooth (Eigen::DenseBase< DerivedA > &in, Eigen::DenseBase< DerivedB > &out, int w)
 
template<typename DerivedA , typename DerivedB >
auto engine_utils::calc_2D_psd (Eigen::DenseBase< DerivedA > &data, Eigen::DenseBase< DerivedB > &y, Eigen::DenseBase< DerivedB > &x, int smooth_window, std::string parallel_policy)
 
template<typename Derived >
auto engine_utils::calc_hist (Eigen::DenseBase< Derived > &data, int n_bins)
 
template<typename Derived >
auto engine_utils::shift_1D (Eigen::DenseBase< Derived > &in, std::vector< Eigen::Index > shift_indices)
 
template<typename Derived >
auto engine_utils::shift_2D (Eigen::DenseBase< Derived > &in, std::vector< Eigen::Index > shift_indices)
 
template<typename Derived >
void engine_utils::fix_periodic_boundary (Eigen::DenseBase< Derived > &data, double low, double high, double upper_limit)
 
auto engine_utils::now ()
 Return the current time.
 
auto engine_utils::elapsed_since (const std::chrono::time_point< std::chrono::high_resolution_clock > &t0)
 Return the time elapsed since given time.
 
template<typename Derived >
Eigen::VectorXd engine_utils::compute_numerical_derivative (const Eigen::DenseBase< Derived > &times, const Eigen::DenseBase< Derived > &values)
 
static const bool engine_utils::is_point_in_box (double a, double b, double x, double y, double theta)