1#ifndef HYDROBRICKS_UTILS_H
2#define HYDROBRICKS_UTILS_H
11[[nodiscard]]
bool InitHydrobricks();
16[[nodiscard]]
bool InitHydrobricksForPython();
23string GetUserDirPath();
30[[nodiscard]]
bool CheckOutputDirectory(
const string& path);
37void DisplayProcessingTime(std::chrono::steady_clock::time_point startTime);
44void InitLog(
const string& path);
59void SetDebugLogLevel();
64void SetMessageLogLevel();
83bool IsNaN(
float value);
91bool IsNaN(
double value);
98const char* GetPathSeparator();
111bool StringsMatch(
const string& str1,
const string& str2);
123int Find(
const int* start,
const int* end,
int value,
int tolerance = 0,
bool showWarning =
true);
135int Find(
const float* start,
const float* end,
float value,
float tolerance = 0.0,
bool showWarning =
true);
147int Find(
const double* start,
const double* end,
double value,
double tolerance = 0.0,
bool showWarning =
true);
160int FindT(
const T* start,
const T* end, T value, T tolerance = 0,
bool showWarning =
true);
170double IncrementDateBy(
double date,
int amount, TimeUnit unit);
178Time GetTimeStructFromMJD(
double mjd);
187double ParseDate(
const string& dateStr, TimeFormat format);
200double GetMJD(
int year,
int month = 1,
int day = 1,
int hour = 0,
int minute = 0,
int second = 0);