Calculate bounds on indexing

This commit is contained in:
2022-06-14 21:44:32 +02:00
parent 04e587b51c
commit 08e70cdb52
5 changed files with 83 additions and 25 deletions
+5 -1
View File
@@ -132,6 +132,9 @@ bool loadRAW(const QString path, ImageInfoData &info, RawImage **image)
int loadFITSHeader(fitsfile *file, ImageInfoData &info)
{
int imgtype;
int naxis;
long naxes[3] = {0};
int nexist;
int status = 0;
char key[FLEN_KEYWORD];
@@ -139,6 +142,7 @@ int loadFITSHeader(fitsfile *file, ImageInfoData &info)
char comm[FLEN_COMMENT];
char strval[FLEN_VALUE];
QVariant var;
fits_get_img_param(file, 3, &imgtype, &naxis, naxes, &status);
fits_get_hdrspace(file, &nexist, nullptr, &status);
for(int i=1; i<=nexist; i++)
{
@@ -173,7 +177,7 @@ int loadFITSHeader(fitsfile *file, ImageInfoData &info)
fits_hdr2str(file, TRUE, nullptr, 0, &header, &nrec, &status);
if(status == 0)
{
info.wcs = std::make_shared<WCSData>(header, nrec);
info.wcs = std::make_shared<WCSData>(naxes[0], naxes[1], header, nrec);
if(!info.wcs->valid())info.wcs.reset();
}
fits_free_memory(header, &status);