Program Listing for File helper.h

Return to documentation for file (include/helper.h)

#ifndef HELPER_H
#define HELPER_H
#define _USE_MATH_DEFINES

#include <vector>
#include <cmath>
#include <vector>
#include <iterator>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <cstdlib>
#include "csv_reader.h"
#include "H5Cpp.h"
#include <map>
#include <array>
#include <algorithm>
#include <numeric>
#include <random>

void vector_to_file(std::vector<double> const &vec, std::string const &filename);

std::array<double, 6> decompose_matrix(std::array<double, 6> mat);

std::array<double, 6> compose_matrix(std::vector<double> parameters);

std::vector<std::size_t> compute_sort_order(const std::vector<double> &v);

double wrap_rads(double r);

double interpolate(const std::map<double, double> &data, double x);

/*
 * Helper for HDF file to get group names
 */
herr_t file_info(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *opdata);


template<typename Out>
void split(const std::string &s, char delim, Out result);

std::vector<std::string> split_to_vector(const std::string &s, char delim);

int download_phoenix(int t_eff, double log_g, double z, double alpha, const std::string path);

int download_wave_grid(std::string path);

bool check_for_file(const std::string &path);

/*
 * Helper for curl to write data to hard drive
 */
size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream);

#endif