40 #include "naco_utils.h"
41 #include "naco_pfits.h"
65 bug_if(cpl_error_get_code());
68 bug_if( dlam == NULL);
70 if (!strncmp(f,
"J", IRPLIB_FITS_STRLEN)) {
71 *lam = 1.265; *dlam = 0.250;
72 }
else if (!strncmp(f,
"Jc", IRPLIB_FITS_STRLEN)) {
73 *lam = 1.265; *dlam = 0.250;
74 }
else if (!strncmp(f,
"H", IRPLIB_FITS_STRLEN)) {
75 *lam = 1.660; *dlam = 0.330;
76 }
else if (!strncmp(f,
"K", IRPLIB_FITS_STRLEN)) {
77 *lam = 2.230; *dlam = 0.390;
78 }
else if (!strncmp(f,
"Ks", IRPLIB_FITS_STRLEN)) {
79 *lam = 2.180; *dlam = 0.350;
80 }
else if (!strncmp(f,
"L", IRPLIB_FITS_STRLEN)) {
81 *lam = 3.500; *dlam = 0.610;
82 }
else if (!strncmp(f,
"L_prime", IRPLIB_FITS_STRLEN)) {
83 *lam = 3.800; *dlam = 0.620;
84 }
else if (!strncmp(f,
"M_prime", IRPLIB_FITS_STRLEN)) {
85 *lam = 4.780; *dlam = 0.590;
86 }
else if (!strncmp(f,
"SJ", IRPLIB_FITS_STRLEN)) {
87 *lam = 1.160; *dlam = 0.470;
88 }
else if (!strncmp(f,
"SH", IRPLIB_FITS_STRLEN)) {
89 *lam = 1.630; *dlam = 0.430;
90 }
else if (!strncmp(f,
"SK", IRPLIB_FITS_STRLEN)) {
91 *lam = 2.270; *dlam = 0.760;
92 }
else if (!strncmp(f,
"NB_1.04", IRPLIB_FITS_STRLEN)) {
93 *lam = 1.040; *dlam = 0.015;
94 }
else if (!strncmp(f,
"NB_1.08", IRPLIB_FITS_STRLEN)) {
95 *lam = 1.083; *dlam = 0.015;
96 }
else if (!strncmp(f,
"NB_1.09", IRPLIB_FITS_STRLEN)) {
97 *lam = 1.094; *dlam = 0.015;
98 }
else if (!strncmp(f,
"NB_1.24", IRPLIB_FITS_STRLEN)) {
99 *lam = 1.237; *dlam = 0.015;
100 }
else if (!strncmp(f,
"NB_1.26", IRPLIB_FITS_STRLEN)) {
101 *lam = 1.257; *dlam = 0.014;
102 }
else if (!strncmp(f,
"NB_1.28", IRPLIB_FITS_STRLEN)) {
103 *lam = 1.282; *dlam = 0.014;
104 }
else if (!strncmp(f,
"NB_1.64", IRPLIB_FITS_STRLEN)) {
105 *lam = 1.644; *dlam = 0.018;
106 }
else if (!strncmp(f,
"NB_1.75", IRPLIB_FITS_STRLEN)) {
107 *lam = 1.748; *dlam = 0.026;
108 }
else if (!strncmp(f,
"NB_3.74", IRPLIB_FITS_STRLEN)) {
109 *lam = 3.740; *dlam = 0.020;
110 }
else if (!strncmp(f,
"IB_2.00", IRPLIB_FITS_STRLEN)) {
111 *lam = 2.000; *dlam = 0.060;
112 }
else if (!strncmp(f,
"IB_2.03", IRPLIB_FITS_STRLEN)) {
113 *lam = 2.030; *dlam = 0.060;
114 }
else if (!strncmp(f,
"IB_2.06", IRPLIB_FITS_STRLEN)) {
115 *lam = 2.060; *dlam = 0.060;
116 }
else if (!strncmp(f,
"IB_2.09", IRPLIB_FITS_STRLEN)) {
117 *lam = 2.090; *dlam = 0.060;
118 }
else if (!strncmp(f,
"IB_2.12", IRPLIB_FITS_STRLEN)) {
119 *lam = 2.120; *dlam = 0.060;
120 }
else if (!strncmp(f,
"NB_2.12", IRPLIB_FITS_STRLEN)) {
121 *lam = 2.122; *dlam = 0.022;
122 }
else if (!strncmp(f,
"IB_2.15", IRPLIB_FITS_STRLEN)) {
123 *lam = 2.150; *dlam = 0.060;
124 }
else if (!strncmp(f,
"NB_2.17", IRPLIB_FITS_STRLEN)) {
125 *lam = 2.166; *dlam = 0.023;
126 }
else if (!strncmp(f,
"IB_2.18", IRPLIB_FITS_STRLEN)) {
127 *lam = 2.180; *dlam = 0.060;
128 }
else if (!strncmp(f,
"IB_2.21", IRPLIB_FITS_STRLEN)) {
129 *lam = 2.210; *dlam = 0.060;
130 }
else if (!strncmp(f,
"IB_2.24", IRPLIB_FITS_STRLEN)) {
131 *lam = 2.240; *dlam = 0.060;
132 }
else if (!strncmp(f,
"IB_2.27", IRPLIB_FITS_STRLEN)) {
133 *lam = 2.270; *dlam = 0.060;
134 }
else if (!strncmp(f,
"IB_2.30", IRPLIB_FITS_STRLEN)) {
135 *lam = 2.300; *dlam = 0.060;
136 }
else if (!strncmp(f,
"IB_2.33", IRPLIB_FITS_STRLEN)) {
137 *lam = 2.330; *dlam = 0.060;
138 }
else if (!strncmp(f,
"IB_2.36", IRPLIB_FITS_STRLEN)) {
139 *lam = 2.360; *dlam = 0.060;
140 }
else if (!strncmp(f,
"IB_2.39", IRPLIB_FITS_STRLEN)) {
141 *lam = 2.390; *dlam = 0.060;
142 }
else if (!strncmp(f,
"IB_2.42", IRPLIB_FITS_STRLEN)) {
143 *lam = 2.420; *dlam = 0.060;
144 }
else if (!strncmp(f,
"IB_2.45", IRPLIB_FITS_STRLEN)) {
145 *lam = 2.450; *dlam = 0.060;
146 }
else if (!strncmp(f,
"IB_2.48", IRPLIB_FITS_STRLEN)) {
147 *lam = 2.480; *dlam = 0.060;
148 }
else if (!strncmp(f,
"NB_4.05", IRPLIB_FITS_STRLEN)) {
149 *lam = 4.051; *dlam = 0.020;
150 }
else if (!strncmp(f,
"IB_4.05", IRPLIB_FITS_STRLEN)) {
152 *lam = 4.05; *dlam = 0.100;
154 irplib_ensure(0, CPL_ERROR_DATA_NOT_FOUND,
"Unknown filter: %s", f);
158 return cpl_error_get_code();
177 char * (*pftag)(
const cpl_frame *,
178 const cpl_propertylist *,
183 const char ** taglist = NULL;
186 cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), NULL);
187 cpl_ensure(
self != NULL, CPL_ERROR_NULL_INPUT, NULL);
188 cpl_ensure(pftag != NULL, CPL_ERROR_NULL_INPUT, NULL);
189 cpl_ensure(pntags != NULL, CPL_ERROR_NULL_INPUT, NULL);
193 cpl_ensure(size > 0, CPL_ERROR_DATA_NOT_FOUND, NULL);
197 for (iframe = 0; iframe < size ; iframe++) {
199 const cpl_propertylist * plist
207 cpl_ensure(frame != NULL, CPL_ERROR_ILLEGAL_INPUT, NULL);
208 cpl_ensure(plist != NULL, CPL_ERROR_ILLEGAL_INPUT, NULL);
210 tag = (*pftag)(frame, plist, iframe);
212 cpl_ensure(tag != NULL, cpl_error_get_code(), NULL);
216 (void)cpl_frame_set_tag(frame, tag);
219 newtag = cpl_frame_get_tag(frame);
221 cpl_ensure(!cpl_error_get_code(), cpl_error_get_code(), NULL);
224 for (i=0; i < *pntags; i++)
225 if (strcmp(newtag, taglist[i]) == 0)
break;
231 taglist = (
const char **)cpl_realloc(taglist, *pntags *
232 sizeof(
const char *));
cpl_error_code naco_get_filter_infos(const char *f, double *lam, double *dlam)
Get the infos of one of the filters.
const cpl_propertylist * irplib_framelist_get_propertylist_const(const irplib_framelist *self, int pos)
Get the propertylist of the specified frame in the framelist.
cpl_frame * irplib_framelist_get(irplib_framelist *self, int pos)
Get the specified frame from the framelist.
const char ** naco_framelist_set_tag(irplib_framelist *self, char *(*pftag)(const cpl_frame *, const cpl_propertylist *, int), int *pntags)
Retag a framelist according to the given tagging function.
int irplib_framelist_get_size(const irplib_framelist *self)
Get the size of a framelist.