99 #include <uves_physmod_chop_otab.h>
101 #include <uves_utils_wrappers.h>
102 #include <uves_pfits.h>
103 #include <uves_error.h>
139 const char* col_name,
147 double xbox[2]={0,0};
148 double ybox[2]={0,0};
149 const double fct=0.075;
150 const double add=50.;
151 cpl_table* tmp_tbl1=NULL;
152 cpl_table* tmp_tbl2=NULL;
156 "Could not read nx from input header");
158 "Could not read ny from input header");
160 xbox[0]=(double)(nx/2-nx*fct);
161 xbox[1]=(double)(nx/2+nx*fct);
163 ybox[1]=(double)(ny-add);
166 uves_msg_debug(
"xbox=%f,%f ybox=%f,%f",xbox[0],xbox[1],ybox[0],ybox[1]);
168 check(tmp_tbl1=uves_extract_table_rows(*ord_tbl,
"X",CPL_GREATER_THAN,xbox[0]),
169 "Error selecting X");
171 check(tmp_tbl2=uves_extract_table_rows(tmp_tbl1,
"X",CPL_LESS_THAN,xbox[1]),
172 "Error selecting X");
173 uves_free_table(&tmp_tbl1);
175 check_nomsg(*ord_min=(
int)cpl_table_get_column_min(tmp_tbl2,col_name));
176 check_nomsg(*ord_max=(
int)cpl_table_get_column_max(tmp_tbl2,col_name));
177 uves_free_table(&tmp_tbl2);
180 check(tmp_tbl1=uves_extract_table_rows(*ord_tbl,col_name,
181 CPL_NOT_GREATER_THAN,*ord_max),
182 "Error selecting Order");
183 uves_free_table(ord_tbl);
184 check(*ord_tbl=uves_extract_table_rows(tmp_tbl1,col_name,
185 CPL_NOT_LESS_THAN,*ord_min),
186 "Error selecting Order");
190 uves_free_table(&tmp_tbl1);
191 uves_free_table(&tmp_tbl2);
int uves_pfits_get_nx(const uves_propertylist *plist, enum uves_chip chip)
Find out the OUT1 NX or OUT4 NX.
int uves_pfits_get_ny(const uves_propertylist *plist, enum uves_chip chip)
Find out the OUT1 NY or OUT4 NY.
int uves_physmod_chop_otab(const uves_propertylist *raw_header, enum uves_chip chip, cpl_table **ord_tbl, const char *col_name, int *ord_min, int *ord_max)
Chop off orders which are not fully in the detector chip.
#define uves_msg_debug(...)
Print a debug message.