#include "mex.h"#include "matrix.h"#include <fitsio.h>Go to the source code of this file.
Compounds | |
| struct | mfitsio_header |
| This structure stores an entire extracted header. More... | |
| struct | mfitsio_info |
| This structure stores information about a FITS data array or a MATLAB image. More... | |
| struct | mfitsio_record |
| This structure holds keyword information extracted from a FITS file header. More... | |
Defines | |
| #define | MFITSIO_WARN mexWarnMsgTxt |
| Macro specifies which function to execute when a warning is reported. More... | |
| #define | MFITSIO_ERR mexErrMsgTxt |
| Macro specifies which function to execute when an error is reported. More... | |
| #define | MFITSIO_PRINTF mexPrintf |
| Macro specifies which function to execute when writing standard text. More... | |
| #define | MFITSIO_FREE free |
| Macro specifies which function to execute when freeing memory. More... | |
| #define | MFITSIO_MALLOC malloc |
| Macro specifies which function to execute when allocating memory using the malloc invocation syntax. More... | |
| #define | MFITSIO_CALLOC calloc |
| Macro specifies which function to execute when allocating memory using the calloc invocation syntax. More... | |
| #define | MFITSIO_READONLY READONLY |
| Macro specifies which status flag should be used for functions which only read to a FITS image. More... | |
| #define | MFITSIO_READWRITE READWRITE |
| Macro specifies which status flag should be used for functions which only read and write to a FITS image. More... | |
Functions | |
| void | mfitsio_free_record (mfitsio_record *record) |
| Deallocates a mfitsio_record structure. More... | |
| void | mfitsio_free_header (mfitsio_header *header) |
| Deallocates a mfitsio_header structure. More... | |
| void | mfitsio_free_info (mfitsio_info *info) |
| Deallocates a mfitsio_info structure. More... | |
| mfitsio_record * | mfitsio_parse_card (const char *cardtext) |
| Parses a fits header "card". More... | |
| mfitsio_header * | mfitsio_read_header (const char *filename) |
| Reads a header from a fits file. More... | |
| mxArray * | mfitsio_adapt_frecord (const mfitsio_record *record) |
| Adapts a mfitsio_record structure into a MATLAB variable. More... | |
| mxArray * | mfitsio_adapt_fheader (const mfitsio_header *record) |
| Adapts a mfitsio_header structure into a MATLAB struct array. More... | |
| mfitsio_info * | mfitsio_read_info (const char *filename) |
| The dimensions and bitpix are acquired from the FITS file header. More... | |
| mxArray * | mfitsio_read_image (const char *filename, const mfitsio_info *info) |
| Read a FITS image and store the result in a MATLAB array. More... | |
| mxArray * | mfitsio_read_image_impl (const char *filename, const mfitsio_info *info, long *fpixels, long *lpixels, long *lnaxes, long *inc) |
| Read a FITS image and store the result in a MATLAB array. More... | |
| void | mfitsio_write_image (const char *filename, const mxArray *header, mxArray *img) |
| Write a MATLAB array/image to a FITS file. More... | |
| void | mfitsio_write_image_impl (const char *filename, const mxArray *header, mxArray *img, long *fpixels, long *lpixels, long *lnaxes, long *inc, mfitsio_info *info) |
| Write a MATLAB array/image to a FITS file. More... | |
| void | mfitsio_write_header (const char *filename, const mxArray *header) |
| Write header information stored in a MATLAB struct array to a FITS file. More... | |
| void | mfitsio_delete_keyword (const char *filename, const char *keyword) |
| Delete a record from a header in a FITS file. More... | |
| mfitsio_info * | mfitsio_calc_info (const mxArray *img) |
| Calculate bitpix and dimension information from a MATLAB image. More... | |
| void | mfitsio_write_info (fitsfile *fptr, const mfitsio_info *info) |
| Write bitpix and dimension information to a FITS header. More... | |
| int | mfitsio_is_scalar (const mxArray *array) |
| Determine whether the MATLAB array is singleton. More... | |
| int | mfitsio_forbidden (const char *s) |
| This function determines whether modifying a certain header keyword is allowed. More... | |
| mxArray * | mfitsio_get_mfield (const mxArray *array, int index, const char *field_name) |
| A wrapper function for mxGetField. More... | |
| double | mfitsio_get_mscalar (const mxArray *array) |
| A wrapper function for mxGetScalar. More... | |
| void | mfitsio_check_coordinate (const mxArray *crd1, const mxArray *crd2, const int naxis, const int *naxes) |
| Checks for validity of starting and ending pixel coordinates. More... | |
| void | mfitsio_check_size_info (const mxArray *crd1) |
| Checks for validity of size information. More... | |
| long * | mfitsio_convert_dbl2long (const double *dbl, const int size) |
| Converts a double array to a long array. More... | |
| long * | mfitsio_convert_int2long (const int *in, const int size) |
| Converts an int array to a long array. More... | |
| long * | mfitsio_create_ones_vector (const int size) |
| Creates a one vector of a particular size. More... | |
| int * | mfitsio_get_region_size (const long *crd1, const long *crd2, const int naxis) |
| Computes the size of a region defined by two coordinates. More... | |
| mxArray * | mfitsio_get_lpixels (const mxArray *spixels, const mxArray *img, int naxis) |
| Computes the ending pixel value based on the starting pixel. More... | |
| void | mfitsio_write_image_execute (fitsfile *file, mxArray *img, long group, long naxis, long *naxes, long *fpixel, long *lpixel, int *status) |
| Close the FITS file. More... | |
| mxArray * | mfitsio_read_image_execute (const mfitsio_info *info, int *diff, fitsfile *fptr, int group, int naxis, long *lnaxes, long *fpixel, long *lpixel, long *inc, int *anynul, int *status) |
| Return the resultant image. More... | |
|
|
Macro specifies which function to execute when allocating memory using the calloc invocation syntax.
Definition at line 51 of file mfitsio.h. Referenced by mfitsio_adapt_fheader, and mfitsio_write_header. |
|
|
Macro specifies which function to execute when an error is reported.
Definition at line 37 of file mfitsio.h. Referenced by mfitsio_adapt_fheader, mfitsio_calc_info, mfitsio_check_coordinate, mfitsio_check_size_info, mfitsio_delete_keyword, mfitsio_get_mfield, mfitsio_read_header, mfitsio_read_image_execute, mfitsio_read_image_impl, mfitsio_read_info, mfitsio_write_header, mfitsio_write_image_execute, mfitsio_write_image_impl, and mfitsio_write_info. |
|
|
Macro specifies which function to execute when freeing memory.
Definition at line 43 of file mfitsio.h. Referenced by mexFunction, mfitsio_free_header, mfitsio_free_info, mfitsio_free_record, mfitsio_read_header, mfitsio_read_image, mfitsio_read_image_impl, mfitsio_read_info, and mfitsio_write_image. |
|
|
Macro specifies which function to execute when allocating memory using the malloc invocation syntax.
Definition at line 47 of file mfitsio.h. Referenced by mfitsio_adapt_fheader, mfitsio_adapt_frecord, mfitsio_calc_info, mfitsio_convert_dbl2long, mfitsio_convert_int2long, mfitsio_create_ones_vector, mfitsio_get_region_size, mfitsio_logical_m2f, mfitsio_parse_card, mfitsio_read_header, mfitsio_read_image, mfitsio_read_info, and mfitsio_write_image. |
|
|
Macro specifies which function to execute when writing standard text.
Definition at line 40 of file mfitsio.h. Referenced by mfitsio_calc_info, mfitsio_check_coordinate, mfitsio_check_size_info, mfitsio_delete_keyword, mfitsio_get_mfield, mfitsio_read_header, mfitsio_read_image_execute, mfitsio_read_image_impl, mfitsio_read_info, mfitsio_write_header, mfitsio_write_image_execute, mfitsio_write_image_impl, and mfitsio_write_info. |
|
|
Macro specifies which status flag should be used for functions which only read to a FITS image.
Definition at line 56 of file mfitsio.h. Referenced by mfitsio_read_header, mfitsio_read_image_impl, and mfitsio_read_info. |
|
|
Macro specifies which status flag should be used for functions which only read and write to a FITS image.
Definition at line 61 of file mfitsio.h. Referenced by mfitsio_delete_keyword, mfitsio_write_header, and mfitsio_write_image_impl. |
|
|
Macro specifies which function to execute when a warning is reported.
Definition at line 34 of file mfitsio.h. Referenced by mfitsio_write_header. |
|
|
Adapts a mfitsio_header structure into a MATLAB struct array.
Definition at line 445 of file mfitsio.c. Referenced by mexFunction. |
|
|
Adapts a mfitsio_record structure into a MATLAB variable. The syntax of the text of the value determines the type of the MATLAB variable.
|
|
|
Calculate bitpix and dimension information from a MATLAB image.
Definition at line 1190 of file mfitsio.c. Referenced by mfitsio_write_image. |
|
||||||||||||||||||||
|
Checks for validity of starting and ending pixel coordinates. In particular, pixels must be within the range defined by the NAXES keywords and a region along a particular axis profile must not begin at the ending coordinate.
Definition at line 1380 of file mfitsio.c. Referenced by mexFunction. |
|
|
Checks for validity of size information. The NAXIS and NAXES information must be non-negative.
|
|
||||||||||||
|
Converts a double array to a long array.
Definition at line 1493 of file mfitsio.c. Referenced by mexFunction. |
|
||||||||||||
|
Converts an int array to a long array.
Definition at line 1511 of file mfitsio.c. Referenced by mexFunction. |
|
|
Creates a one vector of a particular size.
Definition at line 1528 of file mfitsio.c. Referenced by mexFunction. |
|
||||||||||||
|
Delete a record from a header in a FITS file.
Definition at line 905 of file mfitsio.c. Referenced by mexFunction. |
|
|
This function determines whether modifying a certain header keyword is allowed. The reason for checking is that we do not want users modifying NAXIS, BITPIX, and other important headers as they can be calculated from a MATLAB image. Thus, the situation where the dimension and bitpix keywords differ from the stored image is avoided.
Definition at line 1297 of file mfitsio.c. Referenced by mfitsio_delete_keyword, and mfitsio_write_header. |
|
|
Deallocates a mfitsio_header structure.
Definition at line 67 of file mfitsio.c. Referenced by mexFunction. |
|
|
Deallocates a mfitsio_info structure.
Definition at line 84 of file mfitsio.c. Referenced by mexFunction, and mfitsio_write_image. |
|
|
Deallocates a mfitsio_record structure.
Definition at line 54 of file mfitsio.c. Referenced by mfitsio_free_header. |
|
||||||||||||||||
|
Computes the ending pixel value based on the starting pixel.
Definition at line 1568 of file mfitsio.c. Referenced by mexFunction. |
|
||||||||||||||||
|
A wrapper function for mxGetField. Whenever a field cannot be retrieved, an error is reported and execution aborts.
|
|
|
A wrapper function for mxGetScalar. Whenever a scalar cannot be retrieved, zero is returned.
Definition at line 1364 of file mfitsio.c. Referenced by mfitsio_get_mscalar, and mfitsio_write_header. |
|
||||||||||||||||
|
Computes the size of a region defined by two coordinates.
Definition at line 1547 of file mfitsio.c. Referenced by mfitsio_read_image_impl. |
|
|
Determine whether the MATLAB array is singleton.
Definition at line 1260 of file mfitsio.c. Referenced by mfitsio_write_header. |
|
|
Parses a fits header "card". Comments are ignored. A mfitsio_record structure is returned. When this structure is no longer needed, it should be deallocated.
Definition at line 104 of file mfitsio.c. Referenced by mfitsio_read_header. |
|
|
Reads a header from a fits file. Before the result of this function can be used by MATLAB, the header must be adapted to a MATLAB struct array using mfitsio_adapt_fheader function.
Definition at line 223 of file mfitsio.c. Referenced by mexFunction. |
|
||||||||||||
|
Read a FITS image and store the result in a MATLAB array.
Definition at line 572 of file mfitsio.c. Referenced by mexFunction. |
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Return the resultant image.
Definition at line 646 of file mfitsio.c. Referenced by mfitsio_read_image_impl. |
|
||||||||||||||||||||||||||||
|
Read a FITS image and store the result in a MATLAB array.
Definition at line 607 of file mfitsio.c. Referenced by mexFunction, and mfitsio_read_image. |
|
|
The dimensions and bitpix are acquired from the FITS file header.
Definition at line 503 of file mfitsio.c. Referenced by mexFunction. |
|
||||||||||||
|
Write header information stored in a MATLAB struct array to a FITS file.
Definition at line 951 of file mfitsio.c. Referenced by mexFunction, and mfitsio_write_image_impl. |
|
||||||||||||||||
|
Write a MATLAB array/image to a FITS file.
Definition at line 704 of file mfitsio.c. Referenced by mexFunction. |
|
||||||||||||||||||||||||||||||||||||
|
Close the FITS file.
Definition at line 825 of file mfitsio.c. Referenced by mfitsio_write_image_impl. |
|
||||||||||||||||||||||||||||||||||||
|
Write a MATLAB array/image to a FITS file.
Definition at line 751 of file mfitsio.c. Referenced by mexFunction, and mfitsio_write_image. |
|
||||||||||||
|
Write bitpix and dimension information to a FITS header.
|