Changeset 12430


Ignore:
Timestamp:
11/06/11 18:32:12 (13 years ago)
Author:
lyard
Message:
added writing of separate TM channels
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/DataWriteFits.cc

    r12269 r12430  
    4848    fFile.AddColumn('S', "StartCellData",       NPIX);
    4949    fFile.AddColumn('S', "StartCellTimeMarker", NTMARK);
    50     fFile.AddColumn('S', "Data",                h->NPix*h->Nroi);
    51     fFile.AddColumn('S', "TimeMarker",          h->NTm*h->NroiTM);
     50    fFile.AddColumn('S', "Data",                h->NPix*h->Nroi);       
     51       
     52        int16_t realRoiTM = (h->NroiTM > h->Nroi) ? h->Nroi : 0;
     53    fFile.AddColumn('S', "TimeMarker",          h->NTm*realRoiTM);//ETIENNE TM);
    5254
    5355    // Write length of physical pipeline (1024)
     
    5557    fConv = new Converter(Converter::ToFormat(fFile.GetColumnTypes()));
    5658
    57     const size_t sz = (h->NPix*h->Nroi + h->NTm*h->NroiTM)*2;
     59    const size_t sz = (h->NPix*h->Nroi + h->NTm*realRoiTM)*2;//ETIENNE TM)*2;
    5860    if (fConv->GetSize()-sz+4!=sizeof(EVENT))
    5961    {
     
    9092        fFile.WriteKey("NTMARK",   h->NTm,      "Number of Time marks");
    9193        fFile.WriteKey("NROI",     h->Nroi,     "Number of slices per pixels");
    92         fFile.WriteKey("NROITM",   h->NroiTM,   "Number of slices per time-marker");
     94        fFile.WriteKey("NROITM",   realRoiTM,   "Number of slices per time-marker"); //ETIENNE from NroiTMm to Nroi
     95                int realOffset = (h->NroiTM > h->Nroi) ?  h->NroiTM - 2*h->Nroi : 0;
     96                fFile.WriteKey("OFFSET", realOffset, "Offset between pixels ROI and TM ROi"); //ETIENNE added
    9397
    9498        //FIXME should we also put the start and stop time of the received data ?
     
    181185    if (!fFile.AddRow())
    182186        return false;
    183 
    184     const size_t sz = sizeof(EVENT) + sizeof(e->StartPix)*e->Roi+sizeof(e->StartTM)*e->RoiTM;
     187    int realRoiTM = (e->RoiTM > e->Roi) ? e->Roi : 0;
     188    const size_t sz = sizeof(EVENT) + sizeof(e->StartPix)*e->Roi+sizeof(e->StartTM)*realRoiTM; //ETIENNE from RoiTm to Roi
    185189
    186190    const vector<char> data = fConv->ToFits(reinterpret_cast<char*>(e)+4, sz-4);
Note: See TracChangeset for help on using the changeset viewer.