13#error This is a C++ include file and cannot be used from plain C
25#define ngcdcsMAX_FRAME_TYPES ngcppMAX_FRAME_TYPES
30#define ngcdcsMAX_DET 32
119 strcpy(
type,
"CHIP-TYPE");
120 strcpy(
name,
"CHIP-NAME");
121 strcpy(
id,
"CHIP-ID");
122 strcpy(
date,
"YYYY-MM-DD");
125 for (i=0;i<64;i++)
outGain[i] = 0.0;
205 void Add(
int pid,
int id,
int fcnt,
int hcnt) {
206 int *e =
entry->desc;
207 e[0] = pid; e[1] = id; e[2] = fcnt; e[3] = hcnt;
214 void Add(
const char *ref) {
215 int pid, id, fcnt, hcnt;
216 if (sscanf(ref,
"%10d_%10d_%*d_%10d_%10d", &pid, &
id, &fcnt, &hcnt) == 4)
218 Add(pid,
id, fcnt, hcnt);
220 else if (sscanf(ref,
"%10d_%10d_%*d_*_%10d", &pid, &
id, &hcnt) == 3)
222 Add(pid,
id, -1, hcnt);
228 if ((n < 0) || (n >=
size))
236 for (i=0;i<n;i++) e = e->
next;
243 if ((e[2] == -1) && (e[3] == -1))
245 sprintf(fileName,
"%d_%d_%d_*_*.frm", e[0], e[1],
ftype);
251 sprintf(fileName,
"%d_%d_%d_*_%d.frm", e[0], e[1],
ftype, e[3]);
255 sprintf(fileName,
"%d_%d_%d_%d_*.frm", e[0], e[1],
ftype, e[2]);
259 sprintf(fileName,
"%d_%d_%d_%d_%d.frm", e[0], e[1],
ftype, e[2], e[3]);
266 const int *e =
Entry(n);
267 if (e == NULL) fileName[0] =
'\0';
396 int Open(
const char *path,
const char *name) {
427 int fno = fileno(
fd);
438 int fno = fileno(
fd);
439 if (fno >= 0) fsync(fno);
446 fclose(
fd);
fd = NULL;
Timestamp binary table container class.
Definition ngcdcsTsTable.hpp:25
Definition ngcbFITS.hpp:25
Definition ngcbSTREAM.hpp:43
Definition ngcdcsFINFO.hpp:287
int bitPix
Bits per pixel as defined in the FITS-standard.
Definition ngcdcsFINFO.hpp:302
int naxis1
Dimension in x-direction.
Definition ngcdcsFINFO.hpp:293
~ngcdcsCUBE()
Destructor.
Definition ngcdcsFINFO.hpp:386
int sx
Lower left corner (x-direction)
Definition ngcdcsFINFO.hpp:317
unsigned int cnt
Cube counter.
Definition ngcdcsFINFO.hpp:335
FILE * fd
File descriptor.
Definition ngcdcsFINFO.hpp:290
int naxis2
Dimension in y-direction.
Definition ngcdcsFINFO.hpp:296
int fcnt0
Initial frame counter.
Definition ngcdcsFINFO.hpp:341
ngc::core::ngcdcs::TsTable timestamps
Timestamp container.
Definition ngcdcsFINFO.hpp:356
double bzero
Offset value to be added.
Definition ngcdcsFINFO.hpp:311
ngcb_off_t truncate
Truncate file.
Definition ngcdcsFINFO.hpp:344
void Close(int sync=0)
Close data cube.
Definition ngcdcsFINFO.hpp:418
int ndit
Number of integrations in pixel data.
Definition ngcdcsFINFO.hpp:314
int Open(const char *path, const char *name)
Open data cube.
Definition ngcdcsFINFO.hpp:396
double bscale
Scaling factor to be applied.
Definition ngcdcsFINFO.hpp:308
int divisor
Pixel divisor.
Definition ngcdcsFINFO.hpp:305
ngcb_off_t Size()
Cube data size.
Definition ngcdcsFINFO.hpp:391
int fcnt
Frame counter.
Definition ngcdcsFINFO.hpp:338
char frameName[64]
Frame type name for all images in the cube.
Definition ngcdcsFINFO.hpp:332
char reference[64]
Reference file.
Definition ngcdcsFINFO.hpp:347
ngcdcs_cfile_list * fileList
Cube file list on local storage media.
Definition ngcdcsFINFO.hpp:350
int sy
Lower left corner (y-direction)
Definition ngcdcsFINFO.hpp:320
int naxis3
Number of images.
Definition ngcdcsFINFO.hpp:299
double expFactor
Exposure time factor.
Definition ngcdcsFINFO.hpp:323
double timeStamp
MUDPI/RTMS timestamp of first frame.
Definition ngcdcsFINFO.hpp:326
char fileName[512]
Actual filename (full path)
Definition ngcdcsFINFO.hpp:329
ngcdcsCUBE()
Constructor.
Definition ngcdcsFINFO.hpp:359
ngcbSTREAM * stream
Streaming buffer.
Definition ngcdcsFINFO.hpp:353
Definition ngcdcsFINFO.hpp:175
int size
Number of entries.
Definition ngcdcsFINFO.hpp:178
int ftype
Frame type.
Definition ngcdcsFINFO.hpp:181
void Add(const char *ref)
Add file descriptor given by reference string.
Definition ngcdcsFINFO.hpp:214
const int * Entry(int n)
Return n'th entry.
Definition ngcdcsFINFO.hpp:227
~ngcdcs_cfile_list()
Destructor.
Definition ngcdcsFINFO.hpp:199
ngcdcs_cfile_list()
Constructor.
Definition ngcdcsFINFO.hpp:187
void FileName(char *fileName, int n)
Retrieve n'th file-name.
Definition ngcdcsFINFO.hpp:265
ngcdcs_cfile_t * entry
Entry.
Definition ngcdcsFINFO.hpp:184
void Add(int pid, int id, int fcnt, int hcnt)
Add file descriptor to list.
Definition ngcdcsFINFO.hpp:205
ngcdcs_cfile_list(int f)
Constructor with frame type.
Definition ngcdcsFINFO.hpp:193
void Entry2File(char *fileName, const int *e)
Convert list entry to file-name.
Definition ngcdcsFINFO.hpp:242
#define ngcb_fopen(p, m)
Definition ngcb.h:51
off_t ngcb_off_t
Definition ngcb.h:46
#define ngcb_ftruncate(s, o)
Definition ngcb.h:54
#define ngcbSUCCESS
Definition ngcb.h:138
#define ngcbFAILURE
Definition ngcb.h:140
Timestamp binary table container.
#define ngcppFRAME_NO_FRAME
Definition ngcppInt.h:232
#define ngcppAPP_HDR_SIZE
Definition ngcppInt.h:513
Definition ngcdcsFINFO.hpp:150
ngcdcs_cfile_t()
Constructor.
Definition ngcdcsFINFO.hpp:158
ngcdcs_cfile_t * next
Next entry.
Definition ngcdcsFINFO.hpp:155
~ngcdcs_cfile_t()
Destructor.
Definition ngcdcsFINFO.hpp:164
int desc[4]
File descriptor.
Definition ngcdcsFINFO.hpp:152
int adjustMode
Window adjustment mode (0=free, 1=center, ...)
Definition ngcdcsFINFO.hpp:49
double pixSpace
Pixel to pixel space (meter)
Definition ngcdcsFINFO.hpp:76
char type[32]
Detector type.
Definition ngcdcsFINFO.hpp:103
int live
Detector live (=1) or broken (=0)
Definition ngcdcsFINFO.hpp:64
int index
Unique index.
Definition ngcdcsFINFO.hpp:58
char date[16]
Installation date [YYYY-MM-DD].
Definition ngcdcsFINFO.hpp:112
int adjustY
Window adjustment step in y-direction.
Definition ngcdcsFINFO.hpp:55
double pszy
Size of pixel in y (um)
Definition ngcdcsFINFO.hpp:91
int nx
X-Dimension (in pixels)
Definition ngcdcsFINFO.hpp:43
int posY
Y-Position in mosaic.
Definition ngcdcsFINFO.hpp:40
int numOutput
Number of output channels.
Definition ngcdcsFINFO.hpp:67
double ygap
Gap between chips along y (um)
Definition ngcdcsFINFO.hpp:97
double pszx
Size of pixel in x (um)
Definition ngcdcsFINFO.hpp:88
int adjustX
Window adjustment step in x-direction.
Definition ngcdcsFINFO.hpp:52
int acqIdx
Acquisition module index.
Definition ngcdcsFINFO.hpp:73
int ny
Y-Dimension (in pixels)
Definition ngcdcsFINFO.hpp:46
char name[32]
Detector name.
Definition ngcdcsFINFO.hpp:106
int pixPerChan
Pixel per channel.
Definition ngcdcsFINFO.hpp:70
double outGain[64]
Gain per output (e-/ADU)
Definition ngcdcsFINFO.hpp:82
int rotAngle
Rotation angle of chip in mosaic (0, 90, 180, 270)
Definition ngcdcsFINFO.hpp:61
int posX
X-Position in mosaic.
Definition ngcdcsFINFO.hpp:37
ngcdcs_chip_t(int n=0)
Constructor.
Definition ngcdcsFINFO.hpp:115
double rgap
Angle of gap between chips (deg)
Definition ngcdcsFINFO.hpp:100
double gain
Gain (e-/ADU)
Definition ngcdcsFINFO.hpp:79
double ron
Read-out noise (e-)
Definition ngcdcsFINFO.hpp:85
double xgap
Gap between chips along x (um)
Definition ngcdcsFINFO.hpp:94
int fcnt0
Initial frame counter.
Definition ngcdcsFINFO.hpp:518
int divisor
Pixel divisor.
Definition ngcdcsFINFO.hpp:485
int sx
Lower left corner (x-direction)
Definition ngcdcsFINFO.hpp:494
double expFactor
Factor for EXPTIME.
Definition ngcdcsFINFO.hpp:479
int sy
Lower left corner (y-direction)
Definition ngcdcsFINFO.hpp:497
int appDataInline
Application data inline flag.
Definition ngcdcsFINFO.hpp:542
char reference[64]
Reference file.
Definition ngcdcsFINFO.hpp:533
int nx
Dimension in x-direction.
Definition ngcdcsFINFO.hpp:500
int fcnt
Frame counter.
Definition ngcdcsFINFO.hpp:476
char name[64]
Unique frame name.
Definition ngcdcsFINFO.hpp:473
int recording
Frame belongs to recording sequence.
Definition ngcdcsFINFO.hpp:527
double bscale
Scaling factor to be applied.
Definition ngcdcsFINFO.hpp:488
int type
Unique frame type.
Definition ngcdcsFINFO.hpp:470
int ndit
Number of integrations in pixel-data.
Definition ngcdcsFINFO.hpp:521
char appData[ngcppAPP_HDR_SIZE]
Application data.
Definition ngcdcsFINFO.hpp:545
char utc[64]
Time when frame was ready in the pre-processor.
Definition ngcdcsFINFO.hpp:530
int detIdx
Detector index (for mosaics)
Definition ngcdcsFINFO.hpp:512
double timeStamp
MUDPI/RTMS timestamp (seconds since UNIX epoch)
Definition ngcdcsFINFO.hpp:548
double crpix1
Reference pixel in x-direction.
Definition ngcdcsFINFO.hpp:506
int acq
Acquisition module instance number.
Definition ngcdcsFINFO.hpp:524
ngcbFITS * ehdr
Extension FITS header.
Definition ngcdcsFINFO.hpp:554
ngcdcsCUBE * cube
Data cube object to be used for storing to a cube.
Definition ngcdcsFINFO.hpp:551
int ny
Dimension in y-direction.
Definition ngcdcsFINFO.hpp:503
int bitPix
Bits per pixel as defined in the FITS-standard.
Definition ngcdcsFINFO.hpp:482
double bzero
Offset value to be added.
Definition ngcdcsFINFO.hpp:491
int appDataSize
Application data size.
Definition ngcdcsFINFO.hpp:539
char where[512]
Location where file has been stored.
Definition ngcdcsFINFO.hpp:536
int expCnt
Exposure counter for this type.
Definition ngcdcsFINFO.hpp:515
double crpix2
Reference pixel in y-direction.
Definition ngcdcsFINFO.hpp:509
ngcdcs_finfo_t()
Constructor.
Definition ngcdcsFINFO.hpp:557