Better handling of FITS records
This commit is contained in:
+7
-5
@@ -161,10 +161,12 @@ int loadFITSHeader(fitsfile *file, ImageInfoData &info)
|
||||
var = vald;
|
||||
else if(status == VALUE_UNDEFINED)
|
||||
var = QVariant();
|
||||
else if(string == "T" || string == "F")
|
||||
var = string == "T";
|
||||
else
|
||||
var = strval;
|
||||
var = string;
|
||||
status = 0;
|
||||
info.fitsHeader.append({key, var, comm});
|
||||
info.fitsHeader.append(FITSRecord(key, var, comm));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -324,7 +326,7 @@ bool loadXISF(const QString &path, ImageInfoData &info, RawImage **image)
|
||||
auto fitskeywords = xisf.ReadFITSKeywords();
|
||||
for(auto fits : fitskeywords)
|
||||
{
|
||||
info.fitsHeader.append({fits.name.c_str(), fits.value.IsNumeral() ? QVariant(fits.value.ToDouble()) : QVariant(fits.value.c_str()), fits.comment.c_str()});
|
||||
info.fitsHeader.append(fits);
|
||||
}
|
||||
info.wcs = std::make_shared<WCSData>(xisf.ImageInfo().width, xisf.ImageInfo().height, info.fitsHeader);
|
||||
if(!info.wcs->valid())info.wcs.reset();
|
||||
@@ -500,7 +502,7 @@ bool readXISFHeader(const QString &path, ImageInfoData &info)
|
||||
auto fitskeywords = xisf.ReadFITSKeywords();
|
||||
for(auto fits : fitskeywords)
|
||||
{
|
||||
info.fitsHeader.append({fits.name.c_str(), fits.value.IsNumeral() ? QVariant(fits.value.ToDouble()) : QVariant(fits.value.c_str()), fits.comment.c_str()});
|
||||
info.fitsHeader.append(fits);
|
||||
}
|
||||
info.wcs = std::make_shared<WCSData>(xisf.ImageInfo().width, xisf.ImageInfo().height, info.fitsHeader);
|
||||
if(!info.wcs->valid())info.wcs.reset();
|
||||
@@ -626,7 +628,7 @@ void ConvertRunable::run()
|
||||
pcl::FITSKeywordArray fitskeywords;
|
||||
for(auto &record : imageinfo.fitsHeader)
|
||||
{
|
||||
pcl::FITSHeaderKeyword key(pcl::IsoString(record.key.data()), pcl::IsoString(record.value.toString().toLatin1().data()), pcl::IsoString(record.comment.data()));
|
||||
pcl::FITSHeaderKeyword key(pcl::IsoString(record.key.data()), pcl::IsoString(record.valueToByteArray().data()), pcl::IsoString(record.comment.data()));
|
||||
fitskeywords.Append(key);
|
||||
}
|
||||
pcl::XISFWriter xisf;
|
||||
|
||||
Reference in New Issue
Block a user