32 #include "muse_image.h"
33 #include "muse_pixtable.h"
34 #include "muse_processing.h"
39 # error FILENAME_MAX undefined!
50 #define UNUSED_ARGUMENT(arg) (void)(arg)
51 #define UNUSED_ARGUMENTS(arg1,arg2) UNUSED_ARGUMENT(arg1),UNUSED_ARGUMENT(arg2);
55 #if HAVE_ISNAN && HAVE_ISINF
56 #define isfinite(x) (!isnan(x) && !isinf(x))
58 #define isfinite(x) ((x != nan) && (x != -nan) && (x != inf) && (x != -inf))
64 #if HAVE_ISNAN && HAVE_ISINF
65 #define isnormal(x) (!isnan(x) && !isinf(x) && (x != 0.))
67 #define isnormal(x) ((x != nan) && (x != -nan) && (x != inf) && (x != -inf) \
68 && (x != 0.) && (x != -0.))
75 #define drand48() ((double)(rand()) / RAND_MAX)
83 #define MUSE_ERROR_READ_DATA CPL_ERROR_EOL+1
84 #define MUSE_ERROR_READ_DQ CPL_ERROR_EOL+2
85 #define MUSE_ERROR_READ_STAT CPL_ERROR_EOL+3
87 #define MUSE_ERROR_SLICE_LEFT_MISSING CPL_ERROR_EOL+4
88 #define MUSE_ERROR_SLICE_RIGHT_MISSING CPL_ERROR_EOL+5
89 #define MUSE_ERROR_SLICE_EDGE_MISSING CPL_ERROR_EOL+6
91 #define MUSE_ERROR_CHIP_NOT_LIVE CPL_ERROR_EOL+10
118 cpl_frameset *
muse_frameset_find(
const cpl_frameset *,
const char *,
unsigned char, cpl_boolean);
123 cpl_error_code muse_utils_frameset_merge_frames(cpl_frameset *);
134 cpl_error_code
muse_utils_fit_multigauss_1d(
const cpl_vector *,
const cpl_bivector *, cpl_vector *,
double *, cpl_vector *, cpl_vector *,
double *,
double *, cpl_matrix **);
135 cpl_error_code
muse_utils_fit_moffat_2d(
const cpl_matrix *,
const cpl_vector *,
const cpl_vector *, cpl_array *, cpl_array *,
const cpl_array *,
double *,
double *);
141 cpl_error_code
muse_utils_set_hduclass(cpl_propertylist *,
const char *,
const char *,
const char *,
const char *);
int muse_utils_get_extension_for_ifu(const char *, unsigned char)
Return extension number that corresponds to this IFU/channel number.
unsigned char muse_utils_get_ifu(const cpl_propertylist *)
Find out the IFU/channel from which this header originated.
double muse_utils_pixtable_fit_line_gaussian(muse_pixtable *, double, double, double, cpl_array *, cpl_array *)
Fit a 1D Gaussian to a given wavelength range in a pixel table.
muse_utils_centroid_type
Background handling when computing centroids.
void muse_utils_memory_dump(const char *)
Display the current memory usage of the given program.
cpl_error_code muse_utils_set_hduclass(cpl_propertylist *, const char *, const char *, const char *, const char *)
Set HDU headers for the ESO FITS data format.
cpl_table * muse_table_load_filter(muse_processing *, const char *)
Load a table for a given filter name.
const char * muse_get_license(void)
Get the pipeline copyright and license.
Structure definition of MUSE pixel table.
cpl_error_code muse_utils_fit_moffat_2d(const cpl_matrix *, const cpl_vector *, const cpl_vector *, cpl_array *, cpl_array *, const cpl_array *, double *, double *)
Fit a 2D Moffat function to a given set of data.
cpl_polynomial * muse_utils_iterate_fit_polynomial(cpl_matrix *, cpl_vector *, cpl_vector *, cpl_table *, const unsigned int, const double, double *, double *)
Iterate a polynomial fit.
cpl_frameset * muse_frameset_sort_raw_other(const cpl_frameset *, int, const char *, cpl_boolean)
Create a new frameset containing all relevant raw frames first then all other frames.
cpl_error_code muse_utils_fit_multigauss_1d(const cpl_vector *, const cpl_bivector *, cpl_vector *, double *, cpl_vector *, cpl_vector *, double *, double *, cpl_matrix **)
Carry out a multi-Gaussian fit of data in a vector.
char * muse_utils_header_get_lamp_names(cpl_propertylist *, char)
Concatenate names of all active calibration lamps.
cpl_array * muse_utils_header_get_lamp_numbers(cpl_propertylist *)
List numbers of all active calibration lamps.
cpl_image * muse_utils_image_fit_polynomial(const cpl_image *, unsigned short, unsigned short)
Create a smooth version of a 2D image by fitting it with a 2D polynomial.
cpl_table * muse_table_load(muse_processing *, const char *, unsigned char)
load a table according to its tag and IFU/channel number
cpl_error_code muse_utils_image_get_centroid_window(cpl_image *, int, int, int, int, double *, double *, muse_utils_centroid_type)
Compute centroid over an image window, optionally marginalizing over the background.
cpl_propertylist * muse_propertylist_load(muse_processing *, const char *)
load a propertylist according to its tag
cpl_matrix * muse_matrix_new_gaussian_2d(int, int, double)
Create a matrix that contains a normalized 2D Gaussian.
cpl_frameset * muse_frameset_check_raw(const cpl_frameset *, const cpl_array *, unsigned char)
return frameset containing good raw input data
cpl_frameset * muse_frameset_find(const cpl_frameset *, const char *, unsigned char, cpl_boolean)
return frameset containing data from an IFU/channel with a certain tag
cpl_frame * muse_frameset_find_master(const cpl_frameset *, const char *, unsigned char)
find the master frame according to its CCD number and tag
cpl_error_code muse_utils_copy_modified_header(cpl_propertylist *, cpl_propertylist *, const char *, const char *)
Copy a modified header keyword from one header to another.
cpl_error_code muse_utils_get_centroid(const cpl_matrix *, const cpl_vector *, const cpl_vector *, double *, double *, muse_utils_centroid_type)
Compute centroid of a two-dimensional dataset.
cpl_frameset * muse_frameset_find_tags(const cpl_frameset *, const cpl_array *, unsigned char, cpl_boolean)
return frameset containing data from an IFU/channel with the given tag(s)