12#error This is a C++ include file and cannot be used from plain C
23#define ngcdcsMAX_FRAME_TYPES ngcppMAX_FRAME_TYPES
28#define ngcdcsMAX_DET 32
117 strcpy(
type,
"CHIP-TYPE");
118 strcpy(
name,
"CHIP-NAME");
119 strcpy(
id,
"CHIP-ID");
120 strcpy(
date,
"YYYY-MM-DD");
123 for (i=0;i<64;i++)
outGain[i] = 0.0;
203 void Add(
int pid,
int id,
int fcnt,
int hcnt) {
204 int *e =
entry->desc;
205 e[0] = pid; e[1] = id; e[2] = fcnt; e[3] = hcnt;
212 void Add(
const char *ref) {
213 int pid, id, fcnt, hcnt;
214 if (sscanf(ref,
"%10d_%10d_%*d_%10d_%10d", &pid, &
id, &fcnt, &hcnt) == 4)
216 Add(pid,
id, fcnt, hcnt);
218 else if (sscanf(ref,
"%10d_%10d_%*d_*_%10d", &pid, &
id, &hcnt) == 3)
220 Add(pid,
id, -1, hcnt);
226 if ((n < 0) || (n >=
size))
234 for (i=0;i<n;i++) e = e->
next;
241 if ((e[2] == -1) && (e[3] == -1))
243 sprintf(fileName,
"%d_%d_%d_*_*.frm", e[0], e[1],
ftype);
249 sprintf(fileName,
"%d_%d_%d_*_%d.frm", e[0], e[1],
ftype, e[3]);
253 sprintf(fileName,
"%d_%d_%d_%d_*.frm", e[0], e[1],
ftype, e[2]);
257 sprintf(fileName,
"%d_%d_%d_%d_%d.frm", e[0], e[1],
ftype, e[2], e[3]);
264 const int *e =
Entry(n);
265 if (e == NULL) fileName[0] =
'\0';
391 int Open(
const char *path,
const char *name) {
421 int fno = fileno(
fd);
432 int fno = fileno(
fd);
433 if (fno >= 0) fsync(fno);
440 fclose(
fd);
fd = NULL;
Definition ngcbFITS.hpp:24
Definition ngcbSTREAM.hpp:42
Definition ngcdcsFINFO.hpp:285
int bitPix
Bits per pixel as defined in the FITS-standard.
Definition ngcdcsFINFO.hpp:300
int naxis1
Dimension in x-direction.
Definition ngcdcsFINFO.hpp:291
~ngcdcsCUBE()
Destructor.
Definition ngcdcsFINFO.hpp:381
int sx
Lower left corner (x-direction)
Definition ngcdcsFINFO.hpp:315
unsigned int cnt
Cube counter.
Definition ngcdcsFINFO.hpp:333
FILE * fd
File descriptor.
Definition ngcdcsFINFO.hpp:288
int naxis2
Dimension in y-direction.
Definition ngcdcsFINFO.hpp:294
int fcnt0
Initial frame counter.
Definition ngcdcsFINFO.hpp:339
double bzero
Offset value to be added.
Definition ngcdcsFINFO.hpp:309
ngcb_off_t truncate
Truncate file.
Definition ngcdcsFINFO.hpp:342
void Close(int sync=0)
Close data cube.
Definition ngcdcsFINFO.hpp:412
int ndit
Number of integrations in pixel data.
Definition ngcdcsFINFO.hpp:312
int Open(const char *path, const char *name)
Open data cube.
Definition ngcdcsFINFO.hpp:391
double bscale
Scaling factor to be applied.
Definition ngcdcsFINFO.hpp:306
int divisor
Pixel divisor.
Definition ngcdcsFINFO.hpp:303
ngcb_off_t Size()
Cube data size.
Definition ngcdcsFINFO.hpp:386
int fcnt
Frame counter.
Definition ngcdcsFINFO.hpp:336
char frameName[64]
Frame type name for all images in the cube.
Definition ngcdcsFINFO.hpp:330
char reference[64]
Reference file.
Definition ngcdcsFINFO.hpp:345
ngcdcs_cfile_list * fileList
Cube file list on local storage media.
Definition ngcdcsFINFO.hpp:348
int sy
Lower left corner (y-direction)
Definition ngcdcsFINFO.hpp:318
int naxis3
Number of images.
Definition ngcdcsFINFO.hpp:297
double expFactor
Exposure time factor.
Definition ngcdcsFINFO.hpp:321
double timeStamp
MUDPI/RTMS timestamp of first frame.
Definition ngcdcsFINFO.hpp:324
char fileName[512]
Actual filename (full path)
Definition ngcdcsFINFO.hpp:327
ngcdcsCUBE()
Constructor.
Definition ngcdcsFINFO.hpp:354
ngcbSTREAM * stream
Streaming buffer.
Definition ngcdcsFINFO.hpp:351
Definition ngcdcsFINFO.hpp:173
int size
Number of entries.
Definition ngcdcsFINFO.hpp:176
int ftype
Frame type.
Definition ngcdcsFINFO.hpp:179
void Add(const char *ref)
Add file descriptor given by reference string.
Definition ngcdcsFINFO.hpp:212
const int * Entry(int n)
Return n'th entry.
Definition ngcdcsFINFO.hpp:225
~ngcdcs_cfile_list()
Destructor.
Definition ngcdcsFINFO.hpp:197
ngcdcs_cfile_list()
Constructor.
Definition ngcdcsFINFO.hpp:185
void FileName(char *fileName, int n)
Retrieve n'th file-name.
Definition ngcdcsFINFO.hpp:263
ngcdcs_cfile_t * entry
Entry.
Definition ngcdcsFINFO.hpp:182
void Add(int pid, int id, int fcnt, int hcnt)
Add file descriptor to list.
Definition ngcdcsFINFO.hpp:203
ngcdcs_cfile_list(int f)
Constructor with frame type.
Definition ngcdcsFINFO.hpp:191
void Entry2File(char *fileName, const int *e)
Convert list entry to file-name.
Definition ngcdcsFINFO.hpp:240
#define ngcb_fopen(p, m)
Definition ngcb.h:50
off_t ngcb_off_t
Definition ngcb.h:45
#define ngcb_ftruncate(s, o)
Definition ngcb.h:53
#define ngcbSUCCESS
Definition ngcb.h:137
#define ngcbFAILURE
Definition ngcb.h:139
#define ngcppFRAME_NO_FRAME
Definition ngcppInt.h:231
#define ngcppAPP_HDR_SIZE
Definition ngcppInt.h:511
Definition ngcdcsFINFO.hpp:148
ngcdcs_cfile_t()
Constructor.
Definition ngcdcsFINFO.hpp:156
ngcdcs_cfile_t * next
Next entry.
Definition ngcdcsFINFO.hpp:153
~ngcdcs_cfile_t()
Destructor.
Definition ngcdcsFINFO.hpp:162
int desc[4]
File descriptor.
Definition ngcdcsFINFO.hpp:150
int adjustMode
Window adjustment mode (0=free, 1=center, ...)
Definition ngcdcsFINFO.hpp:47
double pixSpace
Pixel to pixel space (meter)
Definition ngcdcsFINFO.hpp:74
char type[32]
Detector type.
Definition ngcdcsFINFO.hpp:101
int live
Detector live (=1) or broken (=0)
Definition ngcdcsFINFO.hpp:62
int index
Unique index.
Definition ngcdcsFINFO.hpp:56
char date[16]
Installation date [YYYY-MM-DD].
Definition ngcdcsFINFO.hpp:110
int adjustY
Window adjustment step in y-direction.
Definition ngcdcsFINFO.hpp:53
double pszy
Size of pixel in y (um)
Definition ngcdcsFINFO.hpp:89
int nx
X-Dimension (in pixels)
Definition ngcdcsFINFO.hpp:41
int posY
Y-Position in mosaic.
Definition ngcdcsFINFO.hpp:38
int numOutput
Number of output channels.
Definition ngcdcsFINFO.hpp:65
double ygap
Gap between chips along y (um)
Definition ngcdcsFINFO.hpp:95
double pszx
Size of pixel in x (um)
Definition ngcdcsFINFO.hpp:86
int adjustX
Window adjustment step in x-direction.
Definition ngcdcsFINFO.hpp:50
int acqIdx
Acquisition module index.
Definition ngcdcsFINFO.hpp:71
int ny
Y-Dimension (in pixels)
Definition ngcdcsFINFO.hpp:44
char name[32]
Detector name.
Definition ngcdcsFINFO.hpp:104
int pixPerChan
Pixel per channel.
Definition ngcdcsFINFO.hpp:68
double outGain[64]
Gain per output (e-/ADU)
Definition ngcdcsFINFO.hpp:80
int rotAngle
Rotation angle of chip in mosaic (0, 90, 180, 270)
Definition ngcdcsFINFO.hpp:59
int posX
X-Position in mosaic.
Definition ngcdcsFINFO.hpp:35
ngcdcs_chip_t(int n=0)
Constructor.
Definition ngcdcsFINFO.hpp:113
double rgap
Angle of gap between chips (deg)
Definition ngcdcsFINFO.hpp:98
double gain
Gain (e-/ADU)
Definition ngcdcsFINFO.hpp:77
double ron
Read-out noise (e-)
Definition ngcdcsFINFO.hpp:83
double xgap
Gap between chips along x (um)
Definition ngcdcsFINFO.hpp:92
int fcnt0
Initial frame counter.
Definition ngcdcsFINFO.hpp:512
int divisor
Pixel divisor.
Definition ngcdcsFINFO.hpp:479
int sx
Lower left corner (x-direction)
Definition ngcdcsFINFO.hpp:488
double expFactor
Factor for EXPTIME.
Definition ngcdcsFINFO.hpp:473
int sy
Lower left corner (y-direction)
Definition ngcdcsFINFO.hpp:491
int appDataInline
Application data inline flag.
Definition ngcdcsFINFO.hpp:536
char reference[64]
Reference file.
Definition ngcdcsFINFO.hpp:527
int nx
Dimension in x-direction.
Definition ngcdcsFINFO.hpp:494
int fcnt
Frame counter.
Definition ngcdcsFINFO.hpp:470
char name[64]
Unique frame name.
Definition ngcdcsFINFO.hpp:467
int recording
Frame belongs to recording sequence.
Definition ngcdcsFINFO.hpp:521
double bscale
Scaling factor to be applied.
Definition ngcdcsFINFO.hpp:482
int type
Unique frame type.
Definition ngcdcsFINFO.hpp:464
int ndit
Number of integrations in pixel-data.
Definition ngcdcsFINFO.hpp:515
char appData[ngcppAPP_HDR_SIZE]
Application data.
Definition ngcdcsFINFO.hpp:539
char utc[64]
Time when frame was ready in the pre-processor.
Definition ngcdcsFINFO.hpp:524
int detIdx
Detector index (for mosaics)
Definition ngcdcsFINFO.hpp:506
double timeStamp
MUDPI/RTMS timestamp (seconds since UNIX epoch)
Definition ngcdcsFINFO.hpp:542
double crpix1
Reference pixel in x-direction.
Definition ngcdcsFINFO.hpp:500
int acq
Acquisition module instance number.
Definition ngcdcsFINFO.hpp:518
ngcbFITS * ehdr
Extension FITS header.
Definition ngcdcsFINFO.hpp:548
ngcdcsCUBE * cube
Data cube object to be used for storing to a cube.
Definition ngcdcsFINFO.hpp:545
int ny
Dimension in y-direction.
Definition ngcdcsFINFO.hpp:497
int bitPix
Bits per pixel as defined in the FITS-standard.
Definition ngcdcsFINFO.hpp:476
double bzero
Offset value to be added.
Definition ngcdcsFINFO.hpp:485
int appDataSize
Application data size.
Definition ngcdcsFINFO.hpp:533
char where[512]
Location where file has been stored.
Definition ngcdcsFINFO.hpp:530
int expCnt
Exposure counter for this type.
Definition ngcdcsFINFO.hpp:509
double crpix2
Reference pixel in y-direction.
Definition ngcdcsFINFO.hpp:503
ngcdcs_finfo_t()
Constructor.
Definition ngcdcsFINFO.hpp:551