36 #include "omega_dfs.h"
37 #include "omega_fits.h"
43 #if defined CPL_VERSION_CODE && CPL_VERSION_CODE <= CPL_VERSION(5, 5, 0)
45 #define CPL_SIZE_FORMAT "d"
50 #define freespace(_p) if (_p != NULL) {cpl_free(_p); _p = NULL;}
51 #define freeframe(_p) if (_p != NULL) {cpl_frame_delete(_p); _p = NULL;}
52 #define freeimage(_p) if (_p != NULL) {cpl_image_delete(_p); _p = NULL;}
53 #define freeilist(_p) if (_p != NULL) {cpl_imagelist_delete(_p); _p = NULL;}
54 #define freeframeset(_p) if (_p != NULL) {cpl_frameset_delete(_p); _p = NULL;}
55 #define freetable(_p) if (_p != NULL) {cpl_table_delete(_p); _p = NULL;}
56 #define freeplist(_p) if (_p != NULL) {cpl_propertylist_delete(_p); _p = NULL;}
57 #define freestats(_p) if (_p != NULL) {cpl_stats_delete(_p); _p = NULL;}
58 #define freefits(_p) if (_p != NULL) {omega_fits_delete(_p); _p = NULL;}
59 #define freelfits(_p,_n) if (_p != NULL) {omega_fits_delete_list(_p,_n); _p = NULL;}
60 #define freetfits(_p) if (_p != NULL) {omega_tfits_delete(_p); _p = NULL;}
61 #define freemask(_p) if (_p != NULL) {cpl_mask_delete(_p); _p = NULL;}
62 #define freematrix(_p) if (_p != NULL) {cpl_matrix_delete(_p); _p = NULL;}
63 #define freevector(_p) if (_p != NULL) {cpl_vector_delete(_p); _p = NULL;}
64 #define freebivector(_p) if (_p != NULL) {cpl_bivector_delete(_p); _p = NULL;}
65 #define freematrix(_p) if (_p != NULL) {cpl_matrix_delete(_p); _p = NULL;}
66 #define freewcs(_p) if (_p != NULL) {cpl_wcs_delete(_p); _p = NULL;}
67 #define freearray(_p) if (_p != NULL) {cpl_array_delete(_p); _p = NULL;}
79 extern void omega_extensions(
const cpl_frame *frame,
int inexten,
int *out1,
int *out2);
81 cpl_size *labels, cpl_size nlab,
84 int ext, cpl_stats **diffstats);
89 int omega_save_dummy(cpl_frameset *set, cpl_parameterlist *parlist,cpl_frame_type type,
90 cpl_type_bpp bitpix,
const char *outfile,
const cpl_propertylist *plist,
91 const char *recipe, cpl_frame *product_frame);
94 const char *outfile,
const char *recipe,
const cpl_propertylist *plist,
95 cpl_frame *product_frame,
const cpl_frame *inherit);
98 char *
omega_create_name(
const char *instrument,
const char *name,
const char *suffix);
102 int omega_save_image(
const cpl_image *img,cpl_frameset *set,
const cpl_parameterlist *pars,
103 cpl_propertylist *alist,
const cpl_propertylist *qclist,cpl_type_bpp bpp,
104 const char *name,
const char *recipe, cpl_frame *frame,
105 const cpl_frame *inherit,
int isfirst);
107 int omega_save_table(
const cpl_table *tbl,cpl_frameset *set,
const cpl_parameterlist *pars,
108 cpl_propertylist *alist,
const cpl_propertylist *qclist,
const char *name,
109 const char *recipe, cpl_frame *frame,
const cpl_frame *inherit,
int isfirst);
111 int omega_save_fits(omega_fits *scifits,cpl_frameset *set,
const cpl_parameterlist *pars,
112 const cpl_propertylist *qclist, cpl_type_bpp bpp,
const char *name,
113 const char *recipe,cpl_frame *product_frame,
const cpl_frame *inherit,
115 cpl_error_code omega_get_pixelscale(cpl_propertylist *plist,
116 double * pixscale_x,
double * pixscale_y);
119 cpl_propertylist * wcslist2,
double * xshift,
double * yshift);
char * omega_create_name(const char *instrument, const char *name, const char *suffix)
Create a string with a name.
int omega_save_dummy(cpl_frameset *set, cpl_parameterlist *parlist, cpl_frame_type type, cpl_type_bpp bitpix, const char *outfile, const cpl_propertylist *plist, const char *recipe, cpl_frame *product_frame)
Save a dummy image or table in an extension.
int omega_get_chip_orientation(int ext)
Get the readout orientation of a chip based on the FITS extension number.
const char * omega_get_extension_chipid(int ext)
Get the value of CHIP ID for a given extension.
void omega_extensions(const cpl_frame *frame, int inexten, int *out1, int *out2)
int omega_save_table(const cpl_table *tbl, cpl_frameset *set, const cpl_parameterlist *pars, cpl_propertylist *alist, const cpl_propertylist *qclist, const char *name, const char *recipe, cpl_frame *frame, const cpl_frame *inherit, int isfirst)
Save a table as a DFS compliant product.
int omega_save_primary(cpl_frameset *set, const cpl_parameterlist *parlist, const char *outfile, const char *recipe, const cpl_propertylist *plist, cpl_frame *product_frame, const cpl_frame *inherit)
Save the primary header of a product.
int omega_compare_tags(const cpl_frame *frame1, const cpl_frame *frame2)
int omega_biascor(cpl_image *image, const cpl_image *bias)
Subtract bias from an image.
const char * omega_get_license(void)
Get the pipeline copyright and license.
void omega_exten_range(int inexten, int *out1, int *out2)
cpl_image * omega_smooth_image(cpl_image *in, int size)
Smooth an image using a median filter.
cpl_error_code omega_get_wcsshift(cpl_propertylist *wcslist1, cpl_propertylist *wcslist2, double *xshift, double *yshift)
Compute the wcs shift in x and y direction.
cpl_frame * omega_product_frame(const char *filename, const char *tag, cpl_frame_type type)
Setup a frame to save a product.
FILE * oc_paf_print_header(char *, char *, char *)
Open a new PAF file, output a default header.
char * omega_get_root_name(const char *filename)
Find out the root part of a basename (name without extension).
int omega_compare_reference(const cpl_image *master, const cpl_frame *refframe, int ext, cpl_stats **diffstats)
cpl_frameset * omega_frameset_subgroup(cpl_frameset *frameset, cpl_size *labels, cpl_size nlab, const char *tag)
char * omega_get_pathname(const char *filename)
Find the directory name in the given string.
int omega_save_fits(omega_fits *scifits, cpl_frameset *set, const cpl_parameterlist *pars, const cpl_propertylist *qclist, cpl_type_bpp bpp, const char *name, const char *recipe, cpl_frame *product_frame, const cpl_frame *inherit, const int isfirst)
Save an image which is taken from a omega_fits strucutre.
int omega_save_image(const cpl_image *img, cpl_frameset *set, const cpl_parameterlist *pars, cpl_propertylist *alist, const cpl_propertylist *qclist, cpl_type_bpp bpp, const char *name, const char *recipe, cpl_frame *frame, const cpl_frame *inherit, int isfirst)
Save an image as a DFS compliant product.