Loading data-access/engine/src/common/include/ast4vl.hpp +0 −7 Original line number Diff line number Diff line Loading @@ -21,13 +21,6 @@ struct Bounds int naxis; }; struct uint_bounds { unsigned int pix1; unsigned int pix2; unsigned char type; }; struct double_xy { double x; Loading data-access/engine/src/common/include/cutout.hpp +11 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,14 @@ enum class specsystem {NONE, VELO_LSRK, WAVE_Barycentric}; enum class timesystem {NONE, MJD_UTC}; struct uint_bounds { unsigned int pix1; unsigned int pix2; unsigned char type; }; /* SODA */ struct circle Loading Loading @@ -82,11 +90,13 @@ struct coordinates double time_value[2]; // time interval (MJD in UTC) std::vector<std::string> pol; // polarization states FIXME pol should be Set<enums> std::vector<uint_bounds> pixel_i; // PIXEL_i for non-standard axes allow direct cut without WCS }; coordinates parse_coordinates(const std::string region_string); coordinates to_coordinates(const position pos, const band bnd, const time_axis time, const std::vector<std::string> pol); const std::vector<std::string> pol, const std::vector<uint_bounds> pixel_i); /* cutout */ Loading data-access/engine/src/common/include/cutout_nljson.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ void to_json(json& j, const cutout_res_s& p); void to_json(json& j, const fits_card& p); void from_json(const json& j, fits_card& p); void from_json(const json& j, uint_bounds& p); void to_json(json& j, const coordinates& p); void from_json(const json& j, coordinates& p); Loading data-access/engine/src/common/src/cutout.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -177,6 +177,7 @@ string axistype2string(unsigned char cc) case 'b': return "BAND"; break; case 't': return "TIME"; break; case 'p': return "POL"; break; case 'x': return "PIXEL_i"; break; case ' ': return "UNKNOWN"; break; default: throw invalid_argument(cc + " is not a valid axis type"); Loading Loading @@ -207,7 +208,7 @@ coordinates parse_coordinates(const string region_string) LOG_trace(string(__func__) + " : " + region_string); json_region reg(region_string); coordinates coord = to_coordinates(reg.get_pos(), reg.get_band(), reg.get_time(), reg.get_pol()); coordinates coord = to_coordinates(reg.get_pos(), reg.get_band(), reg.get_time(), reg.get_pol(), reg.get_pixel_i()); LOG_STREAM << "coord parsed: " << coord << endl; Loading @@ -215,7 +216,8 @@ coordinates parse_coordinates(const string region_string) } coordinates to_coordinates(const position pos, const band bnd, const time_axis time, const std::vector<std::string> pol) coordinates to_coordinates(const position pos, const band bnd, const time_axis time, const std::vector<std::string> pol, const std::vector<uint_bounds> pixel_i) { coordinates coord; coord.skysys = pos.sys; Loading Loading @@ -274,6 +276,8 @@ coordinates to_coordinates(const position pos, const band bnd, const time_axis t coord.pol = pol; coord.pixel_i = pixel_i; return coord; } Loading Loading @@ -336,7 +340,8 @@ cutout_res_s do_cutout_file( const string abs_subimg_pathname = conf_fits_cutpath + "/" + generate_cut_fitsname(fits_pathname, hdunum); const string abs_fits_pathname{ conf_fits_path + "/" + fits_pathname }; coordinates coord = to_coordinates(pos, bnd, time, pol); vector<uint_bounds> pixel_i_none; coordinates coord = to_coordinates(pos, bnd, time, pol, pixel_i_none); uintmax_t filesize = cutout_file(abs_fits_pathname, hdunum, coord, abs_subimg_pathname, extra_cards); Loading data-access/engine/src/common/src/cutout_nljson.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,13 @@ void from_json(const json& j, fits_card& p) } void from_json(const json& j, uint_bounds& p) { if(j.contains("pix1")) j.at("pix1").get_to(p.pix1); else p.pix1 = 0; if(j.contains("pix2")) j.at("pix2").get_to(p.pix2); else p.pix2 = 0; if(j.contains("type")) j.at("type").get_to(p.type); else p.type = ' '; } // cutout Loading Loading
data-access/engine/src/common/include/ast4vl.hpp +0 −7 Original line number Diff line number Diff line Loading @@ -21,13 +21,6 @@ struct Bounds int naxis; }; struct uint_bounds { unsigned int pix1; unsigned int pix2; unsigned char type; }; struct double_xy { double x; Loading
data-access/engine/src/common/include/cutout.hpp +11 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,14 @@ enum class specsystem {NONE, VELO_LSRK, WAVE_Barycentric}; enum class timesystem {NONE, MJD_UTC}; struct uint_bounds { unsigned int pix1; unsigned int pix2; unsigned char type; }; /* SODA */ struct circle Loading Loading @@ -82,11 +90,13 @@ struct coordinates double time_value[2]; // time interval (MJD in UTC) std::vector<std::string> pol; // polarization states FIXME pol should be Set<enums> std::vector<uint_bounds> pixel_i; // PIXEL_i for non-standard axes allow direct cut without WCS }; coordinates parse_coordinates(const std::string region_string); coordinates to_coordinates(const position pos, const band bnd, const time_axis time, const std::vector<std::string> pol); const std::vector<std::string> pol, const std::vector<uint_bounds> pixel_i); /* cutout */ Loading
data-access/engine/src/common/include/cutout_nljson.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ void to_json(json& j, const cutout_res_s& p); void to_json(json& j, const fits_card& p); void from_json(const json& j, fits_card& p); void from_json(const json& j, uint_bounds& p); void to_json(json& j, const coordinates& p); void from_json(const json& j, coordinates& p); Loading
data-access/engine/src/common/src/cutout.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -177,6 +177,7 @@ string axistype2string(unsigned char cc) case 'b': return "BAND"; break; case 't': return "TIME"; break; case 'p': return "POL"; break; case 'x': return "PIXEL_i"; break; case ' ': return "UNKNOWN"; break; default: throw invalid_argument(cc + " is not a valid axis type"); Loading Loading @@ -207,7 +208,7 @@ coordinates parse_coordinates(const string region_string) LOG_trace(string(__func__) + " : " + region_string); json_region reg(region_string); coordinates coord = to_coordinates(reg.get_pos(), reg.get_band(), reg.get_time(), reg.get_pol()); coordinates coord = to_coordinates(reg.get_pos(), reg.get_band(), reg.get_time(), reg.get_pol(), reg.get_pixel_i()); LOG_STREAM << "coord parsed: " << coord << endl; Loading @@ -215,7 +216,8 @@ coordinates parse_coordinates(const string region_string) } coordinates to_coordinates(const position pos, const band bnd, const time_axis time, const std::vector<std::string> pol) coordinates to_coordinates(const position pos, const band bnd, const time_axis time, const std::vector<std::string> pol, const std::vector<uint_bounds> pixel_i) { coordinates coord; coord.skysys = pos.sys; Loading Loading @@ -274,6 +276,8 @@ coordinates to_coordinates(const position pos, const band bnd, const time_axis t coord.pol = pol; coord.pixel_i = pixel_i; return coord; } Loading Loading @@ -336,7 +340,8 @@ cutout_res_s do_cutout_file( const string abs_subimg_pathname = conf_fits_cutpath + "/" + generate_cut_fitsname(fits_pathname, hdunum); const string abs_fits_pathname{ conf_fits_path + "/" + fits_pathname }; coordinates coord = to_coordinates(pos, bnd, time, pol); vector<uint_bounds> pixel_i_none; coordinates coord = to_coordinates(pos, bnd, time, pol, pixel_i_none); uintmax_t filesize = cutout_file(abs_fits_pathname, hdunum, coord, abs_subimg_pathname, extra_cards); Loading
data-access/engine/src/common/src/cutout_nljson.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,13 @@ void from_json(const json& j, fits_card& p) } void from_json(const json& j, uint_bounds& p) { if(j.contains("pix1")) j.at("pix1").get_to(p.pix1); else p.pix1 = 0; if(j.contains("pix2")) j.at("pix2").get_to(p.pix2); else p.pix2 = 0; if(j.contains("type")) j.at("type").get_to(p.type); else p.type = ' '; } // cutout Loading