ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcbFitsTools.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <errno.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <ngc/core/ngcb.h>

Macros

#define _LARGEFILE64_SOURCE
 
#define ngcbFITS_MAX_BLOCKS   512
 
#define ngcbFITS_MAX_LINES   (ngcbFITS_MAX_BLOCKS * ngcbFITS_BLOCK_LINES)
 

Functions

char * ngcbFitsStrip (char *buffer, size_t *size, int *bitPix, char *erms)
 
int ngcbSplitCube (const char *source, const char *target, int numBlocks, char *erms)
 
int ngcbCube2Ext (const char *fileName, const char *extName, int numBlocks, char *erms)
 
int ngcbCubeOpen (const char *fileName, ngcb_cube_t *cube, char *erms)
 
int ngcbCubeRead (ngcb_cube_t cube, void *data, int slice, char *erms)
 
void ngcbCubeClose (ngcb_cube_t cube)
 
int ngcbCubeRead32 (ngcb_cube_t cube, float *buffer, int slice, char *erms)
 

Detailed Description

Macro Definition Documentation

◆ _LARGEFILE64_SOURCE

#define _LARGEFILE64_SOURCE

◆ ngcbFITS_MAX_BLOCKS

#define ngcbFITS_MAX_BLOCKS   512

◆ ngcbFITS_MAX_LINES

#define ngcbFITS_MAX_LINES   (ngcbFITS_MAX_BLOCKS * ngcbFITS_BLOCK_LINES)

Function Documentation

◆ ngcbCube2Ext()

int ngcbCube2Ext ( const char * fileName,
const char * extName,
int numBlocks,
char * erms )

Move data-cube to FITS-extension.

◆ ngcbCubeClose()

void ngcbCubeClose ( ngcb_cube_t cube)

Close data cube.

◆ ngcbCubeOpen()

int ngcbCubeOpen ( const char * fileName,
ngcb_cube_t * cube,
char * erms )

Open data cube.

◆ ngcbCubeRead()

int ngcbCubeRead ( ngcb_cube_t cube,
void * buffer,
int slice,
char * erms )

Read slice from data cube.

◆ ngcbCubeRead32()

int ngcbCubeRead32 ( ngcb_cube_t cube,
float * buffer,
int slice,
char * erms )

Read slice from data cube and convert to 32-bit floating point format.

◆ ngcbFitsStrip()

char * ngcbFitsStrip ( char * buffer,
size_t * size,
int * bitPix,
char * erms )

Strip off the FITS-header from the buffer and return a pointer to the data. The size should be the original buffer size. When the function fails a NULL-pointer is returned. Otherwise size is updated to the size of the data buffer and bitPix returns the BITPIX-value from the FITS-header.

◆ ngcbSplitCube()

int ngcbSplitCube ( const char * source,
const char * target,
int numBlocks,
char * erms )

Split data-cube into FITS-extensions per chip.