Skip to content
Snippets Groups Projects
Select Git revision
  • 3c73b3c07cc54fb8282a7930649021c215102a50
  • main default protected
  • 1.8.5
  • 1.8.4
  • 1.8.3
  • 1.8.2
  • 1.8.1
  • 1.8.0
  • 1.7.14
  • 1.7.13
  • 1.7.12
  • 1.7.11
  • 1.7.10
  • 1.7.9
  • 1.7.8
  • 1.7.7
  • 1.7.6
  • 1.7.5
  • 1.7.4
  • 1.7.3
  • 1.7.2
  • 1.7.1
22 results

fitsfiles.hpp

Blame
  • fitsfiles.hpp 1.77 KiB
    
    #ifndef FITSFILES_HPP
    #define FITSFILES_HPP
    
    #include "cutout.hpp" // struct fits_card
    
    #include <set>
    #include <map>
    #include <vector>
    #include <string>
    
    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<std::string> globVector(const std::string& pattern);
     
       struct keys_by_type
       {
          std::set<std::string> strKeys;
          std::set<std::string> uintKeys;
          std::set<std::string> doubleKeys;
       };
    
       struct key_values_by_type
       {
          std::map<std::string, std::string>   strValues;
          std::map<std::string, unsigned long> uintValues;
          std::map<std::string, double>        doubleValues;
       };
    
       struct Hdu 
       {
          unsigned int m_hdunum;
          std::string  m_header;
          key_values_by_type key_values;
       };
    
       std::vector<Hdu> 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<fits_card> 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<struct fits_card> 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