27 #ifndef MLN_IO_FITS_LOAD_HH
28 # define MLN_IO_FITS_LOAD_HH
39 # include <mln/core/image/image2d.hh>
40 # include <mln/value/int_u8.hh>
63 void load(image2d<float>& ima,
76 # ifndef MLN_INCLUDE_ONLY
79 void fits_exit(
int status)
83 fits_report_error(stderr, status);
92 mln_trace(
"mln::io::fits::load");
95 int status, nfound, anynull;
100 if (fits_open_file(&fptr, filename.c_str(), READONLY, &status))
103 char NAXIS[] =
"NAXIS";
104 if (fits_read_keys_lng(fptr, NAXIS, 1, 2, naxes, &nfound, &status))
109 image2d<float> output(nrows, ncols);
115 for (
p.row() = 0;
p.row() <
nrows; ++
p.row())
117 if (fits_read_img(fptr,
128 if (fits_close_file(fptr, &status))
136 void load(image2d<float>& ima,
137 const std::string& filename)
139 ima =
load(filename);
142 # endif // ! MLN_INCLUDE_ONLY
151 #endif // ! MLN_IO_FITS_LOAD_HH