MAOS
Multithreaded Adaptive Optics Simulator
|
Macros | |
#define | cellfree(A) if(A){cellfree_do(A); A=NULL;} |
#define | writebin(A, format...) if(A) write_by_id(A, M_0, format) |
#define | writecell(A, format...) write_by_id(A, M_0, format) |
#define | readbin(format...) read_by_id(M_0, -1, format); |
#define | writebin_async(A, ncol) writecell_async(A, ncol) |
#define | readdata(fp) readdata_by_id(fp, 0, -1, 0) |
#define | writedata(fp, A) writedata_by_id(fp, A, 0, 0) |
Functions | |
cell * | cellnew (long nx, long ny) |
void | cellinit (panyarray A, long nx, long ny) |
void | cellinit2 (panyarray A, const_anyarray B) |
void | celldim (const_anyarray A_, long *nx, long *ny, long **nxs, long **nys) |
void | cellresize (anyarray in, long nx, long ny) |
void | cellfree_do (anyarray dc) |
void | writedata_by_id (file_t *fd, const_anyarray A, M_ID id, long ncol) |
void | write_by_id (const_anyarray dc, M_ID id, const char *format,...) |
cell * | readdata_by_id (file_t *fp, M_ID id, int level, header_t *header) |
cell * | read_by_id (M_ID id, int level, const char *format,...) |
void | writecell_async (const_anyarray A, long ncol) |
void | writebin_header (anyarray dc, const char *keywords, const char *format,...) |
cell * | readsock (int sock) |
void | writesock (const_anyarray dc, int sock) |
Function for a generic cell. use CELL() to case to cell.
#define cellfree | ( | A | ) | if(A){cellfree_do(A); A=NULL;} |
free a cell array and zero the pointer.
#define writebin | ( | A, | |
format... | |||
) | if(A) write_by_id(A, M_0, format) |
A generic routine for write data to file.
#define readbin | ( | format... | ) | read_by_id(M_0, -1, format); |
A generic routine for reading data from file. User need to cast the result. -1 means scan the file
check the size of cell array if exist. Otherwise create it
void cellinit2 | ( | panyarray | A_, |
const_anyarray | B_ | ||
) |
check the size of cell array if exist. Otherwise create it. m is created for dcell
Obtain the dimensions.
void cellfree_do | ( | anyarray | A_ | ) |
free a mat or cell object.
void writedata_by_id | ( | file_t * | fp, |
const_anyarray | A_, | ||
M_ID | id, | ||
long | ncol | ||
) |
ncol: 0: normal writing. -1: initialize async data. >0: async writing.
Read data from file. level indicate intension, which may not match the file, in which case conversion is done. Usage: level=0: array of fundamental data. level=1: cell of fundamental data. level>1: cell of cell ... level==-1: automatically identify and read all data. top level non-cell data will be combined to a cell (e.g., fits) level<-1: only from recursive calling when the initial level is -1
id: magic number of request fundamental data. data is converted if it does not match magic number from the file.
There are two cases the file may be scanned to real all data, only at the top level though
void writecell_async | ( | const_anyarray | A, |
long | ncol | ||
) |
Calls writebin with build in fp
void writebin_header | ( | anyarray | Ac_, |
const char * | keywords, | ||
const char * | format, | ||
... | |||
) |
A generic routine for write data to file with separate keywords
cell* readsock | ( | int | sock | ) |
A generic routine for reading data from socket. User need to cast the result. We dup the fd to avoid close it after read.
void writesock | ( | const_anyarray | A, |
int | sock | ||
) |
A generic routine for write data to socket. We dup the fd to avoid close it after read.