Add indexing of XISF
This commit is contained in:
+27
-3
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user