#ifndef FITSFILES_HPP #define FITSFILES_HPP #include "cutout.hpp" // struct fits_card #include #include #include #include namespace fitsfiles { std::string cfitsio_errmsg(const char * filename, int line_num, int status); // for db-ingestion std::uintmax_t fileSize(std::string pathname); std::vector globVector(const std::string& pattern); struct keys_by_type { std::set strKeys; std::set uintKeys; std::set doubleKeys; }; struct key_values_by_type { std::map strValues; std::map uintValues; std::map doubleValues; }; struct Hdu { unsigned int m_hdunum; std::string m_header; key_values_by_type key_values; }; std::vector fname2hdrstr(std::string filename, unsigned int maxHduPos, const keys_by_type *keys = nullptr); // for services std::string read_header(std::string pathname, unsigned int hdunum); void fits_hdu_cut(const std::string infile, const unsigned int hdunum, const std::string outfile); std::string append_card_if_not_in_header(std::string header, const std::vector additional_cards); // for vlkb cmds std::string read_card(const std::string pathname, unsigned int hdunum, const std::string keyname); void add_cards_if_missing(const std::string pathname, unsigned int hdunum, const std::vector cards); int mod_value(std::string filename, std::string token, std::string keyvalue); double calc_nullvals(std::string pathname, unsigned int hdunum, unsigned long long & null_cnt, unsigned long long & total_cnt); }; #endif