Loading data-access/engine/src/common/include/ast4vl.hpp +3 −0 Original line number Diff line number Diff line Loading @@ -56,5 +56,8 @@ std::vector<Bounds> calc_bounds(std::string header, std::string skysys_str, std: std::vector<uint_bounds> calc_overlap(const std::string header, const coordinates coord, int& ov_code); int header_modif_coordsys(const std::string& skysys_str, const std::string& specsys_str, const std::string& pathname); #endif data-access/engine/src/common/src/ast4vl.cpp +41 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,8 @@ #include "math.h" // round() needed #include "cutout_ostream.hpp" // coordinates needed #include "fitsfiles.hpp" // header_modif_coordsys needs this #include <ostream> //#include <vector> Loading Loading @@ -170,3 +172,42 @@ std::vector<uint_bounds> calc_overlap(const std::string header, const coordinate } void write_previous2(string header, string filename) { std::ofstream out(filename); out << header; } int header_modif_coordsys(const string& skysys_str, const string& specsys_str, const string& pathname) { LOG_trace(__func__); int maxHdu = 1;//FIXME INT_MAX; // read all HDU's std::vector<fitsfiles::Hdu> allHdus = fitsfiles::fname2hdrstr(pathname, maxHdu); for(unsigned int i=0; i<allHdus.size(); i++) { cerr << "HDU#" << i << endl; fitsfiles::Hdu hd = allHdus.at(i); write_previous2(hd.m_header, "backup.fitshdu"+ to_string(i) +"header.orig"); ast::frameset frm_set(hd.m_header); frm_set.set_skysystem(skysys_str); if(frm_set.has_specframe()) frm_set.set_specsystem(specsys_str); //frm_set.write(cout, hd.m_header); frm_set.write2(pathname, i+1); } return 0; } data-access/engine/src/common/include/ast_frameset.hpp→data-access/engine/src/common/src/ast_frameset.hpp +0 −0 File moved. View file data-access/engine/src/common/include/fits_header.hpp→data-access/engine/src/common/src/fits_header.hpp +0 −0 File moved. View file data-access/engine/src/vlkb/src/ast.cpp +0 −32 Original line number Diff line number Diff line Loading @@ -11,9 +11,6 @@ #include "io.hpp" #include "my_assert.hpp" #include "ast_frameset.hpp" // FIXME temporarily was moved common/src -> common/include #include <iostream> #include <climits> // INT_MAX needed #include <sstream> Loading Loading @@ -130,35 +127,6 @@ int header_backup(const string& pathname, bool backup) } int header_modif_coordsys(const string& skysys_str, const string& specsys_str, const string& pathname) { LOG_trace(__func__); int maxHdu = 1;//FIXME INT_MAX; // read all HDU's std::vector<fitsfiles::Hdu> allHdus = fitsfiles::fname2hdrstr(pathname, maxHdu); for(unsigned int i=0; i<allHdus.size(); i++) { cerr << "HDU#" << i << endl; fitsfiles::Hdu hd = allHdus.at(i); write_previous(hd.m_header, "backup.fitshdu"+ to_string(i) +"header.orig"); ast::frameset frm_set(hd.m_header); frm_set.set_skysystem(skysys_str); if(frm_set.has_specframe()) frm_set.set_specsystem(specsys_str); //frm_set.write(cout, hd.m_header); frm_set.write2(pathname, i+1); } return 0; } //--------------------------------------------------------------------- Loading Loading
data-access/engine/src/common/include/ast4vl.hpp +3 −0 Original line number Diff line number Diff line Loading @@ -56,5 +56,8 @@ std::vector<Bounds> calc_bounds(std::string header, std::string skysys_str, std: std::vector<uint_bounds> calc_overlap(const std::string header, const coordinates coord, int& ov_code); int header_modif_coordsys(const std::string& skysys_str, const std::string& specsys_str, const std::string& pathname); #endif
data-access/engine/src/common/src/ast4vl.cpp +41 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,8 @@ #include "math.h" // round() needed #include "cutout_ostream.hpp" // coordinates needed #include "fitsfiles.hpp" // header_modif_coordsys needs this #include <ostream> //#include <vector> Loading Loading @@ -170,3 +172,42 @@ std::vector<uint_bounds> calc_overlap(const std::string header, const coordinate } void write_previous2(string header, string filename) { std::ofstream out(filename); out << header; } int header_modif_coordsys(const string& skysys_str, const string& specsys_str, const string& pathname) { LOG_trace(__func__); int maxHdu = 1;//FIXME INT_MAX; // read all HDU's std::vector<fitsfiles::Hdu> allHdus = fitsfiles::fname2hdrstr(pathname, maxHdu); for(unsigned int i=0; i<allHdus.size(); i++) { cerr << "HDU#" << i << endl; fitsfiles::Hdu hd = allHdus.at(i); write_previous2(hd.m_header, "backup.fitshdu"+ to_string(i) +"header.orig"); ast::frameset frm_set(hd.m_header); frm_set.set_skysystem(skysys_str); if(frm_set.has_specframe()) frm_set.set_specsystem(specsys_str); //frm_set.write(cout, hd.m_header); frm_set.write2(pathname, i+1); } return 0; }
data-access/engine/src/common/include/ast_frameset.hpp→data-access/engine/src/common/src/ast_frameset.hpp +0 −0 File moved. View file
data-access/engine/src/common/include/fits_header.hpp→data-access/engine/src/common/src/fits_header.hpp +0 −0 File moved. View file
data-access/engine/src/vlkb/src/ast.cpp +0 −32 Original line number Diff line number Diff line Loading @@ -11,9 +11,6 @@ #include "io.hpp" #include "my_assert.hpp" #include "ast_frameset.hpp" // FIXME temporarily was moved common/src -> common/include #include <iostream> #include <climits> // INT_MAX needed #include <sstream> Loading Loading @@ -130,35 +127,6 @@ int header_backup(const string& pathname, bool backup) } int header_modif_coordsys(const string& skysys_str, const string& specsys_str, const string& pathname) { LOG_trace(__func__); int maxHdu = 1;//FIXME INT_MAX; // read all HDU's std::vector<fitsfiles::Hdu> allHdus = fitsfiles::fname2hdrstr(pathname, maxHdu); for(unsigned int i=0; i<allHdus.size(); i++) { cerr << "HDU#" << i << endl; fitsfiles::Hdu hd = allHdus.at(i); write_previous(hd.m_header, "backup.fitshdu"+ to_string(i) +"header.orig"); ast::frameset frm_set(hd.m_header); frm_set.set_skysystem(skysys_str); if(frm_set.has_specframe()) frm_set.set_specsystem(specsys_str); //frm_set.write(cout, hd.m_header); frm_set.write2(pathname, i+1); } return 0; } //--------------------------------------------------------------------- Loading