Add indexing of XISF

This commit is contained in:
2022-04-12 09:03:29 +02:00
parent 0fb27266c7
commit a44c456cab
4 changed files with 64 additions and 31 deletions
+27 -3
View File
@@ -449,8 +449,32 @@ bool readFITSHeader(const QString &path, ImageInfoData &info)
int status = 0;
fits_open_diskfile(&fr, path.toLocal8Bit().data(), READONLY, &status);
status = loadFITSHeader(fr, info);
fits_close_file(fr, &status);
if(fr && status == 0)
{
status = loadFITSHeader(fr, info);
fits_close_file(fr, &status);
}
return status == 0;
}
bool readXISFHeader(const QString &path, ImageInfoData &info)
{
try
{
pcl::String pclPath = path.utf16();
pcl::XISFReader xisf;
xisf.Open(pclPath);
auto fitskeywords = xisf.ReadFITSKeywords();
for(auto fits : fitskeywords)
{
info.fitsHeader.append({fits.name.c_str(), fits.value.c_str(), fits.comment.c_str()});
}
}
catch (pcl::Error err)
{
qDebug() << err.FormatInfo().ToUTF8().c_str();
return false;
}
return true;
}