Changeset 19726 for trunk/Mars


Ignore:
Timestamp:
10/05/19 20:51:15 (5 years ago)
Author:
tbretz
Message:
Switch to compressed files -- the algorithm which columnis compressed how is a bit arbitrary and might only work for our raw files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mfileio/MWriteFitsFile.cc

    r19688 r19726  
    464464      {
    465465
    466       ofits* fitsTable = new ofits();
     466      ofits* fitsTable = new zofits();
    467467      fitsTable->AllowCommentsTrimming(true);
    468468      TString dol = fileNameNoExt;
     
    476476          dol = dol(0, dol.Length()-5);
    477477      }
     478      if (dol(dol.Length()-8, dol.Length()) == ".fits.fz")
     479      {
     480          dol = dol(0, dol.Length()-8);
     481      }
    478482      dol += "_";
    479483      dol += i_table->first;
    480       dol += ".fits";
     484      dol += ".fits.fz";
    481485      fitsTable->open(dol.Data());
    482486      *fLog << inf << "Opening FITS file: " << dol.Data() << endl;
     
    551555         dol2 += "_";
    552556         dol2 += i_table->first;
    553          dol2 += ".fits";
     557         dol2 += ".fits.fz";
    554558
    555559         if (fOpenOption == "RECREATE")
     
    11501154//    *fLog << warn << "In table " << tableName << " Adding column |" << truncatedName << "| |" << truncatedComment << "| |" << count << "| |" << typeChar;
    11511155//    *fLog << warn << "| Real: "<< columnName << " comment: " << comment << endl;
    1152     fFitsTables[tableName]->AddColumn(count, typeChar, truncatedName, unit, truncatedComment);
     1156
     1157    if (count>=1440 && colWidth>count)
     1158    {
     1159        vector<uint16_t> processing;
     1160        if (count>1440)
     1161            processing.push_back(FITS::kFactSmoothing);
     1162        processing.push_back(FITS::kFactHuffman16);
     1163
     1164        const FITS::Compression comp(processing, FITS::kOrderByRow);
     1165        fFitsTables[tableName]->AddColumn(comp, count, typeChar, truncatedName, unit, truncatedComment);
     1166
     1167        *fLog << inf2 << "FITS: Compressing '" << truncatedName << "' [" << count << "]" << endl;
     1168    }
     1169    else
     1170        fFitsTables[tableName]->AddColumn(count, typeChar, truncatedName, unit, truncatedComment);
    11531171}
    11541172
Note: See TracChangeset for help on using the changeset viewer.