Debian Codegraph @

libharp/harp-ingest-mls_l2.c

raw symbols SCIP
1 /*
2 * Copyright (C) 2015-2026 S[&]T, The Netherlands.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 #include "coda.h"
33 #include "harp-ingestion.h"
34
35 #include <stdlib.h>
36 #include <string.h>
37
38 /* ------------------- Defines ------------------ */
39
40 #define SECONDS_FROM_1993_TO_2000 (220838400 + 5)
41
42 #define CHECKED_MALLOC(v, s) v = malloc(s); if (v == NULL) { harp_set_error(HARP_ERROR_OUT_OF_MEMORY, "out of memory (could not allocate %lu bytes) (%s:%u)", s, __FILE__, __LINE__); return -1;}
43
44 /* ------------------ Typedefs ------------------ */
45
46 typedef struct ingest_info_struct
47 {
48 const char *swath_name;
49 coda_product *product;
50 coda_cursor swath_cursor;
51 coda_cursor geo_cursor;
52 long num_times;
53 long num_levels;
54 } ingest_info;
55
56 typedef struct product_limits_struct
57 {
58 const char *product_name;
59 double pressure_limit_high;
60 double pressure_limit_low;
61 double quality_threshold;
62 double convergence_threshold;
63 } product_limits;
64
65 /* -------------- Global variables --------------- */
66
67 static product_limits check_limits[] = {
68 {"BrO", 10.0, 3.2, 1.3, 1.05},
69 {"CH3Cl", 147.0, 4.6, 1.3, 1.05},
70 {"CH3CN", 46.0, 1.0, 1.4, 1.05},
71 {"CH3OH", -1, -1, -1, -1},
72 {"ClO", 147.0, 1.0, 1.3, 1.05},
73 {"CO", 100.0, 0.0046, 1.5, 1.03},
74 {"CO", 215.0, 146.0, 1.5, 1.03},
75 {"GPH", 83.0, 0.001, 0.2, 1.03},
76 {"GPH", 261.0, 100.0, 0.9, 1.03},
77 {"H2O", 83.0, 0.002, 0.7, 2.0},
78 {"H2O", 316.0, 100.0, 0.7, 2.0},
79 {"HCl", 100.0, 0.32, 1.2, 1.05},
80 {"HCN", 21.0, 0.1, 0.2, 2.0},
81 {"HNO3", 215.0, 1.5, 0.8, 1.03},
82 {"HO2", 22.0, 0.046, -1, 1.1},
83 {"HOCl", 10.0, 2.2, 1.2, 1.05},
84 {"IWC", 215.0, 83.0, -1, -1},
85 {"IWP", -1, -1, -1, -1},
86 {"N2O", 68.0, 0.46, 1.0, 2.0},
87 {"O3", 100.0, 0.02, 1.0, 1.03},
88 {"O3", 261.0, 121.0, 1.0, 1.03},
89 {"OH", 32.0, 0.0032, -1, 1.1},
90 {"RHI", 316.0, 100.0, 1.45, 2.0},
91 {"RHI", 100.0, 83.0, -1, 2.0},
92 {"RHI", 83.0, 0.002, 1.45, 2.0},
93 {"SO2", 215.0, 10.0, 0.95, 1.03},
94 {"Temperature", 83.0, 0.001, 0.2, 1.03},
95 {"Temperature", 261.0, 100.0, 0.9, 1.03},
96 {NULL, 0, 0, 0, 0}
97 };
98
99 static const char *quality_flag_description1 =
100 "Bits 4 to 9 and 11 to 14 in the quality flag denote a specific error condition while bits 0 to 2 denote the "
101 "severity (bit 0 error, bit 1 warning, bit 2 comment).\n\nBits 4 to 9 denote the MLS status (bit 4 HICLOUD, "
102 "bit 5 LOWCLOUD, bit 6 NO_APRIORI_T, bit 7 NUM_ERROR, bit 8 TOO_FEW_RAD, bit 9 GLOB_FAILURE).\n\n"
103 "Bits 11 to 14 denote specific checks as specified in the EOS MLS data quality document (the pressure range, ";
104 static const char *quality_flag_description2 =
105 "quality and convergence thresholds come from table 1.1.1 in issue 4.x-4.0 of that document): "
106 "Bit 11 denotes pressure out of range, bit 12 denotes quality below threshold, bit 13 denotes convergence above "
107 "threshold and bit 14 denotes a negative precision. Also, if any of the bits 11 to 14 is set, "
108 "bit 0 is automatically set.\n\n";
109
110 static const char *hno3_quality_flag_description =
111 "Bits 15 and 16 denote the results of checks that are only performed for the HNO3 product. Bit 15 is set if the "
112 "pressure is at most 68 hPa and the quality flag is not zero. Bit 16 is set if either the pressure is at least "
113 "316 hPa and the volume mixing ratio is less than -2.0 or the pressure is between 68 hPa and 215 hPa and the "
114 "volume mixing ratio is less than -1.2. Again, if any of the bits 15 and 16 is set, bit 0 is automatically set."
115 "\n\n";
116
117 /* -------------------- Code -------------------- */
118
119 static int init_cursors(ingest_info *info)
120 {
121 if (coda_cursor_set_product(&info->swath_cursor, info->product) != 0)
122 {
123 harp_set_error(HARP_ERROR_CODA, NULL);
124 return -1;
125 }
126 if (coda_cursor_goto(&info->swath_cursor, "/HDFEOS/SWATHS") != 0)
127 {
128 harp_set_error(HARP_ERROR_CODA, NULL);
129 return -1;
130 }
131 if (coda_cursor_goto_record_field_by_name(&info->swath_cursor, info->swath_name) != 0)
132 {
133 harp_set_error(HARP_ERROR_CODA, NULL);
134 return -1;
135 }
136 info->geo_cursor = info->swath_cursor;
137 if (coda_cursor_goto_record_field_by_name(&info->swath_cursor, "Data_Fields") != 0)
138 {
139 harp_set_error(HARP_ERROR_CODA, NULL);
140 return -1;
141 }
142 if (coda_cursor_goto_record_field_by_name(&info->geo_cursor, "Geolocation_Fields") != 0)
143 {
144 harp_set_error(HARP_ERROR_CODA, NULL);
145 return -1;
146 }
147
148 return 0;
149 }
150
151 static int get_dimensions(ingest_info *info)
152 {
153 coda_cursor cursor;
154 long coda_dimension[CODA_MAX_NUM_DIMS];
155 int num_coda_dimensions;
156
157 cursor = info->swath_cursor;
158 if (coda_cursor_goto_record_field_by_name(&cursor, "L2gpValue") != 0)
159 {
160 harp_set_error(HARP_ERROR_CODA, NULL);
161 return -1;
162 }
163 if (coda_cursor_get_array_dim(&cursor, &num_coda_dimensions, coda_dimension) != 0)
164 {
165 harp_set_error(HARP_ERROR_CODA, NULL);
166 return -1;
167 }
168
169 info->num_times = coda_dimension[0];
170 info->num_levels = coda_dimension[1];
171
172 return 0;
173 }
174
175 static int get_variable_attributes(coda_cursor *cursor, double *missing_value, double *scale_factor, double *offset)
176 {
177 if (coda_cursor_goto_attributes(cursor) != 0)
178 {
179 harp_set_error(HARP_ERROR_CODA, NULL);
180 return -1;
181 }
182 if (coda_cursor_goto_record_field_by_name(cursor, "MissingValue") != 0)
183 {
184 harp_set_error(HARP_ERROR_CODA, NULL);
185 return -1;
186 }
187 if (coda_cursor_goto_first_array_element(cursor) != 0)
188 {
189 harp_set_error(HARP_ERROR_CODA, NULL);
190 return -1;
191 }
192 if (coda_cursor_read_double(cursor, missing_value) != 0)
193 {
194 harp_set_error(HARP_ERROR_CODA, NULL);
195 return -1;
196 }
197 coda_cursor_goto_parent(cursor);
198 coda_cursor_goto_parent(cursor);
199
200 if (coda_cursor_goto_record_field_by_name(cursor, "ScaleFactor") != 0)
201 {
202 /* use a scale factor of 1 */
203 *scale_factor = 1;
204 }
205 else
206 {
207 if (coda_cursor_goto_first_array_element(cursor) != 0)
208 {
209 harp_set_error(HARP_ERROR_CODA, NULL);
210 return -1;
211 }
212 if (coda_cursor_read_double(cursor, scale_factor) != 0)
213 {
214 harp_set_error(HARP_ERROR_CODA, NULL);
215 return -1;
216 }
217 coda_cursor_goto_parent(cursor);
218 coda_cursor_goto_parent(cursor);
219 }
220
221 if (coda_cursor_goto_record_field_by_name(cursor, "Offset") != 0)
222 {
223 /* use an offset of 0 */
224 *offset = 0;
225 }
226 else
227 {
228 if (coda_cursor_goto_first_array_element(cursor) != 0)
229 {
230 harp_set_error(HARP_ERROR_CODA, NULL);
231 return -1;
232 }
233 if (coda_cursor_read_double(cursor, offset) != 0)
234 {
235 harp_set_error(HARP_ERROR_CODA, NULL);
236 return -1;
237 }
238 coda_cursor_goto_parent(cursor);
239 coda_cursor_goto_parent(cursor);
240 }
241 coda_cursor_goto_parent(cursor);
242
243 return 0;
244 }
245
246 static int read_variable(coda_cursor *cursor, const char *name, int num_dimensions, long dimension_0, long dimension_1,
247 harp_array data)
248 {
249 double missing_value;
250 double scale_factor;
251 double offset;
252 long num_elements;
253 long coda_dimension[CODA_MAX_NUM_DIMS];
254 int num_coda_dimensions;
255 long i;
256
257 if (coda_cursor_goto_record_field_by_name(cursor, name) != 0)
258 {
259 harp_set_error(HARP_ERROR_CODA, NULL);
260 return -1;
261 }
262 if (coda_cursor_get_array_dim(cursor, &num_coda_dimensions, coda_dimension) != 0)
263 {
264 harp_set_error(HARP_ERROR_CODA, NULL);
265 return -1;
266 }
267 if (num_coda_dimensions != num_dimensions)
268 {
269 harp_set_error(HARP_ERROR_INGESTION, "product error detected in MLS L2 product (variable %s has %d dimensions, "
270 "expected %d)", name, num_coda_dimensions, num_dimensions);
271 return -1;
272 }
273 if (dimension_0 != coda_dimension[0])
274 {
275 harp_set_error(HARP_ERROR_INGESTION,
276 "product error detected in MLS L2 product (first dimension for variable %s "
277 "has %ld elements, expected %ld", name, coda_dimension[0], dimension_0);
278 return -1;
279 }
280 num_elements = coda_dimension[0];
281 if (num_dimensions > 1)
282 {
283 if (dimension_1 != coda_dimension[1])
284 {
285 harp_set_error(HARP_ERROR_INGESTION, "product error detected in MLS L2 product (second dimension for "
286 "variable %s has %ld elements, expected %ld", name, coda_dimension[1], dimension_1);
287 return -1;
288 }
289 num_elements *= coda_dimension[1];
290 }
291 if (get_variable_attributes(cursor, &missing_value, &scale_factor, &offset) != 0)
292 {
293 return -1;
294 }
295 if (coda_cursor_read_double_array(cursor, data.double_data, coda_array_ordering_c) != 0)
296 {
297 harp_set_error(HARP_ERROR_CODA, NULL);
298 return -1;
299 }
300
301 /* apply scaling and filter for NaN */
302 for (i = 0; i < num_elements; i++)
303 {
304 if (data.double_data[i] == missing_value)
305 {
306 data.double_data[i] = coda_NaN();
307 }
308 else
309 {
310 data.double_data[i] = offset + scale_factor * data.double_data[i];
311 }
312 }
313
314 coda_cursor_goto_parent(cursor);
315
316 return 0;
317 }
318
319 static int read_int32_variable(coda_cursor *cursor, const char *name, int num_dimensions, long dimension_0,
320 harp_array data)
321 {
322 long coda_dimension[CODA_MAX_NUM_DIMS];
323 int num_coda_dimensions;
324
325 if (coda_cursor_goto_record_field_by_name(cursor, name) != 0)
326 {
327 harp_set_error(HARP_ERROR_CODA, NULL);
328 return -1;
329 }
330 if (coda_cursor_get_array_dim(cursor, &num_coda_dimensions, coda_dimension) != 0)
331 {
332 harp_set_error(HARP_ERROR_CODA, NULL);
333 return -1;
334 }
335 if (num_coda_dimensions != num_dimensions)
336 {
337 harp_set_error(HARP_ERROR_INGESTION, "product error detected in MLS L2 product (variable %s has %d dimensions, "
338 "expected %d)", name, num_coda_dimensions, num_dimensions);
339 return -1;
340 }
341 if (dimension_0 != coda_dimension[0])
342 {
343 harp_set_error(HARP_ERROR_INGESTION,
344 "product error detected in MLS L2 product (first dimension for variable %s "
345 "has %ld elements, expected %ld", name, coda_dimension[0], dimension_0);
346 return -1;
347 }
348 if (coda_cursor_read_int32_array(cursor, data.int32_data, coda_array_ordering_c) != 0)
349 {
350 harp_set_error(HARP_ERROR_CODA, NULL);
351 return -1;
352 }
353
354 coda_cursor_goto_parent(cursor);
355
356 return 0;
357 }
358
359 static int read_dimensions(void *user_data, long dimension[HARP_NUM_DIM_TYPES])
360 {
361 ingest_info *info = (ingest_info *)user_data;
362
363 dimension[harp_dimension_time] = info->num_times;
364 dimension[harp_dimension_vertical] = info->num_levels;
365
366 return 0;
367 }
368
369 static int read_time(void *user_data, harp_array data)
370 {
371 ingest_info *info = (ingest_info *)user_data;
372 long i;
373
374 if (read_variable(&info->geo_cursor, "Time", 1, info->num_times, 0, data) != 0)
375 {
376 return -1;
377 }
378
379 /* convert time values from TAI93 to seconds since 2000-01-01 */
380 for (i = 0; i < info->num_times; i++)
381 {
382 data.double_data[i] -= SECONDS_FROM_1993_TO_2000;
383 }
384
385 return 0;
386 }
387
388 static int read_longitude(void *user_data, harp_array data)
389 {
390 ingest_info *info = (ingest_info *)user_data;
391
392 return read_variable(&info->geo_cursor, "Longitude", 1, info->num_times, 0, data);
393 }
394
395 static int read_latitude(void *user_data, harp_array data)
396 {
397 ingest_info *info = (ingest_info *)user_data;
398
399 return read_variable(&info->geo_cursor, "Latitude", 1, info->num_times, 0, data);
400 }
401
402 static int read_pressure(void *user_data, harp_array data)
403 {
404 ingest_info *info = (ingest_info *)user_data;
405
406 return read_variable(&info->geo_cursor, "Pressure", 1, info->num_levels, 0, data);
407 }
408
409 static int read_value(void *user_data, harp_array data)
410 {
411 ingest_info *info = (ingest_info *)user_data;
412
413 return read_variable(&info->swath_cursor, "L2gpValue", 2, info->num_times, info->num_levels, data);
414 }
415
416 static int read_error(void *user_data, harp_array data)
417 {
418 ingest_info *info = (ingest_info *)user_data;
419
420 return read_variable(&info->swath_cursor, "L2gpPrecision", 2, info->num_times, info->num_levels, data);
421 }
422
423 static int perform_pressure_quality_convergence_precision_checks(ingest_info *info, int32_t *status_data,
424 const char *product_name)
425 {
426 double pressure, quality, convergence, precision;
427 long i, j;
428 short pressure_is_within_limits;
429 short quality_is_high_enough;
430 short convergence_is_low_enough;
431 harp_array pressure_data, quality_data, convergence_data, precision_data;
432 product_limits *limits;
433
434 CHECKED_MALLOC(pressure_data.double_data, info->num_levels * sizeof(double));
435 quality_data.double_data = malloc(info->num_times * sizeof(double));
436 if (quality_data.double_data == NULL)
437 {
438 harp_set_error(HARP_ERROR_OUT_OF_MEMORY, "out of memory (could not allocate %lu bytes) (%s:%u)",
439 info->num_times * sizeof(double), __FILE__, __LINE__);
440 free(pressure_data.double_data);
441 return -1;
442 }
443 convergence_data.double_data = malloc(info->num_times * sizeof(double));
444 if (convergence_data.double_data == NULL)
445 {
446 harp_set_error(HARP_ERROR_OUT_OF_MEMORY, "out of memory (could not allocate %lu bytes) (%s:%u)",
447 info->num_times * sizeof(double), __FILE__, __LINE__);
448 free(quality_data.double_data);
449 free(pressure_data.double_data);
450 return -1;
451 }
452 precision_data.double_data = malloc(info->num_times * info->num_levels * sizeof(double));
453 if (precision_data.double_data == NULL)
454 {
455 harp_set_error(HARP_ERROR_OUT_OF_MEMORY, "out of memory (could not allocate %lu bytes) (%s:%u)",
456 info->num_times * info->num_levels * sizeof(double), __FILE__, __LINE__);
457 free(convergence_data.double_data);
458 free(quality_data.double_data);
459 free(pressure_data.double_data);
460 return -1;
461 }
462
463 if (read_variable(&info->geo_cursor, "Pressure", 1, info->num_levels, 0, pressure_data) != 0)
464 {
465 free(precision_data.double_data);
466 free(convergence_data.double_data);
467 free(quality_data.double_data);
468 free(pressure_data.double_data);
469 return -1;
470 }
471 if (read_variable(&info->swath_cursor, "Quality", 1, info->num_times, 0, quality_data) != 0)
472 {
473 free(precision_data.double_data);
474 free(convergence_data.double_data);
475 free(quality_data.double_data);
476 free(pressure_data.double_data);
477 return -1;
478 }
479 if (read_variable(&info->swath_cursor, "Convergence", 1, info->num_times, 0, convergence_data) != 0)
480 {
481 /* In old datafiles the field Convergence was not yet present so */
482 /* we fill the Convergence values with values far below the limit. */
483 memset(convergence_data.double_data, '\0', info->num_times * sizeof(double));
484 }
485 if (read_variable(&info->swath_cursor, "L2gpPrecision", 2, info->num_times, info->num_levels, precision_data) != 0)
486 {
487 free(precision_data.double_data);
488 free(convergence_data.double_data);
489 free(quality_data.double_data);
490 free(pressure_data.double_data);
491 return -1;
492 }
493 for (i = 0; i < info->num_times; i++)
494 {
495 for (j = 0; j < info->num_levels; j++)
496 {
497 pressure = pressure_data.double_data[j];
498 quality = quality_data.double_data[i];
499 convergence = convergence_data.double_data[i];
500 precision = precision_data.double_data[i * info->num_levels + j];
501 pressure_is_within_limits = 0;
502 quality_is_high_enough = 0;
503 convergence_is_low_enough = 0;
504 limits = check_limits;
505 while (limits->product_name != NULL)
506 {
507 if (strcmp(limits->product_name, product_name) == 0)
508 {
509 if ((limits->pressure_limit_low < 0.0) ||
510 ((pressure >= limits->pressure_limit_low) && (pressure <= limits->pressure_limit_high)))
511 {
512 pressure_is_within_limits = 1;
513 if ((limits->quality_threshold < 0.0) || (quality >= limits->quality_threshold))
514 {
515 quality_is_high_enough = 1;
516 }
517 if ((limits->convergence_threshold < 0.0) || (convergence <= limits->convergence_threshold))
518 {
519 convergence_is_low_enough = 1;
520 }
521 }
522 }
523 limits++;
524 }
525 if (!pressure_is_within_limits)
526 {
527 /* Set bit 11 (OUTSIDE_PRESS_RANGE) + bit 0 (MLS_STATUS_BAD) */
528 status_data[i * info->num_levels + j] |= 0x801;
529 }
530 if (!quality_is_high_enough)
531 {
532 /* Set bit 12 (QUALITY_TOO_LOW) + bit 0 (MLS_STATUS_BAD) */
533 status_data[i * info->num_levels + j] |= 0x1001;
534 }
535 if (!convergence_is_low_enough)
536 {
537 /* Set bit 13 (CONVERGENCE_TOO_HIGH) + bit 0 (MLS_STATUS_BAD) */
538 status_data[i * info->num_levels + j] |= 0x2001;
539 }
540 if (precision <= 0.0)
541 {
542 /* Set bit 14 (NEGATIVE_PRECISION) + bit 0 (MLS_STATUS_BAD) */
543 status_data[i * info->num_levels + j] |= 0x4001;
544 }
545 }
546 }
547 free(precision_data.double_data);
548 free(convergence_data.double_data);
549 free(quality_data.double_data);
550 free(pressure_data.double_data);
551 return 0;
552 }
553
554 static int perform_hno3_checks(ingest_info *info, int32_t *status_data)
555 {
556 double pressure, vmr;
557 long i, j;
558 harp_array pressure_data, vmr_data;
559
560 CHECKED_MALLOC(pressure_data.double_data, info->num_levels * sizeof(double));
561 vmr_data.double_data = malloc(info->num_times * info->num_levels * sizeof(double));
562 if (vmr_data.double_data == NULL)
563 {
564 harp_set_error(HARP_ERROR_OUT_OF_MEMORY, "out of memory (could not allocate %lu bytes) (%s:%u)",
565 info->num_times * info->num_levels * sizeof(double), __FILE__, __LINE__);
566 free(pressure_data.double_data);
567 return -1;
568 }
569 if (read_variable(&info->geo_cursor, "Pressure", 1, info->num_levels, 0, pressure_data) != 0)
570 {
571 free(vmr_data.double_data);
572 free(pressure_data.double_data);
573 return -1;
574 }
575 if (read_variable(&info->swath_cursor, "L2gpValue", 2, info->num_times, info->num_levels, vmr_data) != 0)
576 {
577 free(vmr_data.double_data);
578 free(pressure_data.double_data);
579 return -1;
580 }
581 for (i = 0; i < info->num_times; i++)
582 {
583 for (j = 0; j < info->num_levels; j++)
584 {
585 pressure = pressure_data.double_data[j];
586 vmr = vmr_data.double_data[i * info->num_levels + j];
587 /* Check on cloud contamination as specified on page 90 of the DQD issue 4.x-4.0 */
588 if ((pressure <= 68) && (status_data[i * info->num_levels + j] != 0))
589 {
590 /* Set bit 15 (CLOUD_CONTAMINATION) + bit 0 (MLS_STATUS_BAD) */
591 status_data[i * info->num_levels + j] |= 0x8001;
592 }
593 /* Check on HNO3 outlier as specified on page 91 of the DQD issue 4.x-4.0 */
594 if ((pressure >= 316.0) && (vmr < -2.0))
595 {
596 /* Set bit 16 (HNO3_OUTLIER) + bit 0 (MLS_STATUS_BAD) */
597 status_data[i * info->num_levels + j] |= 0x10001;
598 }
599 else if ((pressure >= 68.0) && (pressure <= 215.0) && (vmr < -1.6))
600 {
601 /* Set bit 16 (HNO3_OUTLIER) + bit 0 (MLS_STATUS_BAD) */
602 status_data[i * info->num_levels + j] |= 0x10001;
603 }
604 }
605 }
606 free(vmr_data.double_data);
607 free(pressure_data.double_data);
608 return 0;
609 }
610
611 static int read_validity(void *user_data, harp_array data)
612 {
613 ingest_info *info = (ingest_info *)user_data;
614 long i, j;
615
616 /* The Status-field in the ingested file is 1-dimensional with size info->num_times but the */
617 /* validity-field in the HARP data is 2-dimensional with size info->num_times * info->num_levels. */
618 if (read_int32_variable(&info->swath_cursor, "Status", 1, info->num_times, data) != 0)
619 {
620 return -1;
621 }
622 for (i = info->num_times - 1; i >= 0; i--)
623 {
624 for (j = 0; j < info->num_levels; j++)
625 {
626 data.int32_data[i * info->num_levels + j] = data.int32_data[i];
627 }
628 }
629
630 if (perform_pressure_quality_convergence_precision_checks(info, data.int32_data, info->swath_name) != 0)
631 {
632 return -1;
633 }
634
635 if (strcmp(info->swath_name, "HNO3") == 0)
636 {
637 if (perform_hno3_checks(info, data.int32_data) != 0)
638 {
639 return -1;
640 }
641 }
642 return 0;
643 }
644
645 static void ingestion_done(void *user_data)
646 {
647 ingest_info *info = (ingest_info *)user_data;
648
649 if (info != NULL)
650 {
651 free(info);
652 }
653 }
654
655 static int ingestion_init(const harp_ingestion_module *module, coda_product *product,
656 const harp_ingestion_options *options, harp_product_definition **definition, void **user_data,
657 const char *swath_name)
658 {
659 ingest_info *info;
660
661 (void)options;
662
663 info = malloc(sizeof(ingest_info));
664 if (info == NULL)
665 {
666 harp_set_error(HARP_ERROR_OUT_OF_MEMORY, "out of memory (could not allocate %lu bytes) (%s:%u)",
667 sizeof(ingest_info), __FILE__, __LINE__);
668 return -1;
669 }
670 info->product = product;
671 info->swath_name = swath_name;
672
673 if (init_cursors(info) != 0)
674 {
675 ingestion_done(info);
676 return -1;
677 }
678 if (get_dimensions(info) != 0)
679 {
680 ingestion_done(info);
681 return -1;
682 }
683
684 *definition = *module->product_definition;
685 *user_data = info;
686
687 return 0;
688 }
689
690 static int ingestion_init_bro(const harp_ingestion_module *module, coda_product *product,
691 const harp_ingestion_options *options, harp_product_definition **definition,
692 void **user_data)
693 {
694 return ingestion_init(module, product, options, definition, user_data, "BrO");
695 }
696
697 static int ingestion_init_ch3cl(const harp_ingestion_module *module, coda_product *product,
698 const harp_ingestion_options *options, harp_product_definition **definition,
699 void **user_data)
700 {
701 return ingestion_init(module, product, options, definition, user_data, "CH3Cl");
702 }
703
704 static int ingestion_init_ch3cn(const harp_ingestion_module *module, coda_product *product,
705 const harp_ingestion_options *options, harp_product_definition **definition,
706 void **user_data)
707 {
708 return ingestion_init(module, product, options, definition, user_data, "CH3CN");
709 }
710
711 static int ingestion_init_ch3oh(const harp_ingestion_module *module, coda_product *product,
712 const harp_ingestion_options *options, harp_product_definition **definition,
713 void **user_data)
714 {
715 return ingestion_init(module, product, options, definition, user_data, "CH3OH");
716 }
717
718 static int ingestion_init_clo(const harp_ingestion_module *module, coda_product *product,
719 const harp_ingestion_options *options, harp_product_definition **definition,
720 void **user_data)
721 {
722 return ingestion_init(module, product, options, definition, user_data, "ClO");
723 }
724
725 static int ingestion_init_co(const harp_ingestion_module *module, coda_product *product,
726 const harp_ingestion_options *options, harp_product_definition **definition,
727 void **user_data)
728 {
729 return ingestion_init(module, product, options, definition, user_data, "CO");
730 }
731
732 static int ingestion_init_gph(const harp_ingestion_module *module, coda_product *product,
733 const harp_ingestion_options *options, harp_product_definition **definition,
734 void **user_data)
735 {
736 return ingestion_init(module, product, options, definition, user_data, "GPH");
737 }
738
739 static int ingestion_init_h2o(const harp_ingestion_module *module, coda_product *product,
740 const harp_ingestion_options *options, harp_product_definition **definition,
741 void **user_data)
742 {
743 return ingestion_init(module, product, options, definition, user_data, "H2O");
744 }
745
746 static int ingestion_init_hcl(const harp_ingestion_module *module, coda_product *product,
747 const harp_ingestion_options *options, harp_product_definition **definition,
748 void **user_data)
749 {
750 return ingestion_init(module, product, options, definition, user_data, "HCl");
751 }
752
753 static int ingestion_init_hcn(const harp_ingestion_module *module, coda_product *product,
754 const harp_ingestion_options *options, harp_product_definition **definition,
755 void **user_data)
756 {
757 return ingestion_init(module, product, options, definition, user_data, "HCN");
758 }
759
760 static int ingestion_init_hno3(const harp_ingestion_module *module, coda_product *product,
761 const harp_ingestion_options *options, harp_product_definition **definition,
762 void **user_data)
763 {
764 return ingestion_init(module, product, options, definition, user_data, "HNO3");
765 }
766
767 static int ingestion_init_ho2(const harp_ingestion_module *module, coda_product *product,
768 const harp_ingestion_options *options, harp_product_definition **definition,
769 void **user_data)
770 {
771 return ingestion_init(module, product, options, definition, user_data, "HO2");
772 }
773
774 static int ingestion_init_hocl(const harp_ingestion_module *module, coda_product *product,
775 const harp_ingestion_options *options, harp_product_definition **definition,
776 void **user_data)
777 {
778 return ingestion_init(module, product, options, definition, user_data, "HOCl");
779 }
780
781 static int ingestion_init_iwc(const harp_ingestion_module *module, coda_product *product,
782 const harp_ingestion_options *options, harp_product_definition **definition,
783 void **user_data)
784 {
785 return ingestion_init(module, product, options, definition, user_data, "IWC");
786 }
787
788 static int ingestion_init_n2o(const harp_ingestion_module *module, coda_product *product,
789 const harp_ingestion_options *options, harp_product_definition **definition,
790 void **user_data)
791 {
792 return ingestion_init(module, product, options, definition, user_data, "N2O");
793 }
794
795 static int ingestion_init_o3(const harp_ingestion_module *module, coda_product *product,
796 const harp_ingestion_options *options, harp_product_definition **definition,
797 void **user_data)
798 {
799 return ingestion_init(module, product, options, definition, user_data, "O3");
800 }
801
802 static int ingestion_init_oh(const harp_ingestion_module *module, coda_product *product,
803 const harp_ingestion_options *options, harp_product_definition **definition,
804 void **user_data)
805 {
806 return ingestion_init(module, product, options, definition, user_data, "OH");
807 }
808
809 static int ingestion_init_rhi(const harp_ingestion_module *module, coda_product *product,
810 const harp_ingestion_options *options, harp_product_definition **definition,
811 void **user_data)
812 {
813 return ingestion_init(module, product, options, definition, user_data, "RHI");
814 }
815
816 static int ingestion_init_so2(const harp_ingestion_module *module, coda_product *product,
817 const harp_ingestion_options *options, harp_product_definition **definition,
818 void **user_data)
819 {
820 return ingestion_init(module, product, options, definition, user_data, "SO2");
821 }
822
823 static int ingestion_init_t(const harp_ingestion_module *module, coda_product *product,
824 const harp_ingestion_options *options, harp_product_definition **definition,
825 void **user_data)
826 {
827 return ingestion_init(module, product, options, definition, user_data, "Temperature");
828 }
829
830 static void register_datetime_variable(harp_product_definition *product_definition, const char *path)
831 {
832 harp_variable_definition *variable_definition;
833 harp_dimension_type dimension_type[1] = { harp_dimension_time };
834 const char *description;
835
836 description = "time of the measurement";
837 variable_definition =
838 harp_ingestion_register_variable_full_read(product_definition, "datetime", harp_type_double, 1, dimension_type,
839 NULL, description, "seconds since 2000-01-01", NULL, read_time);
840
841 description = "the time converted from TAI93 to seconds since 2000-01-01T00:00:00";
842 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, description);
843 }
844
845 static void register_longitude_variable(harp_product_definition *product_definition, const char *path)
846 {
847 harp_variable_definition *variable_definition;
848 harp_dimension_type dimension_type[1] = { harp_dimension_time };
849 const char *description;
850
851 description = "tangent longitude";
852 variable_definition =
853 harp_ingestion_register_variable_full_read(product_definition, "longitude", harp_type_double, 1, dimension_type,
854 NULL, description, "degree_east", NULL, read_longitude);
855 harp_variable_definition_set_valid_range_double(variable_definition, -180.0, 180.0);
856 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
857 }
858
859 static void register_latitude_variable(harp_product_definition *product_definition, const char *path)
860 {
861 harp_variable_definition *variable_definition;
862 harp_dimension_type dimension_type[1] = { harp_dimension_time };
863 const char *description;
864
865 description = "tangent latitude";
866 variable_definition =
867 harp_ingestion_register_variable_full_read(product_definition, "latitude", harp_type_double, 1, dimension_type,
868 NULL, description, "degree_north", NULL, read_latitude);
869 harp_variable_definition_set_valid_range_double(variable_definition, -90.0, 90.0);
870 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
871 }
872
873 static void register_pressure_variable(harp_product_definition *product_definition, const char *path)
874 {
875 harp_variable_definition *variable_definition;
876 harp_dimension_type dimension_type[1] = { harp_dimension_vertical };
877 const char *description;
878
879 description = "pressure per profile level";
880 variable_definition =
881 harp_ingestion_register_variable_full_read(product_definition, "pressure", harp_type_double, 1, dimension_type,
882 NULL, description, "hPa", NULL, read_pressure);
883 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
884 }
885
886 static void register_bro_product(void)
887 {
888 harp_ingestion_module *module;
889 harp_product_definition *product_definition;
890 harp_variable_definition *variable_definition;
891 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
892 const char *description;
893 const char *path;
894
895 module = harp_ingestion_register_module("MLS_L2_BRO", "MLS", "AURA_MLS", "ML2BRO", "MLS BrO profile",
896 ingestion_init_bro, ingestion_done);
897
898 /* BRO product */
899 product_definition = harp_ingestion_register_product(module, "MLS_L2_BRO", NULL, read_dimensions);
900 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
901 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
902
903 /* datetime */
904 path = "/HDFEOS/SWATHS/BrO/Geolocation_Fields/Time[]";
905 register_datetime_variable(product_definition, path);
906
907 /* longitude and latitude */
908 path = "/HDFEOS/SWATHS/BrO/Geolocation_Fields/Longitude[]";
909 register_longitude_variable(product_definition, path);
910 path = "/HDFEOS/SWATHS/BrO/Geolocation_Fields/Latitude[]";
911 register_latitude_variable(product_definition, path);
912
913 /* pressure */
914 path = "/HDFEOS/SWATHS/BrO/Geolocation_Fields/Pressure[]";
915 register_pressure_variable(product_definition, path);
916
917 /* BrO_volume_mixing_ratio */
918 description = "BrO volume mixing ratio";
919 variable_definition =
920 harp_ingestion_register_variable_full_read(product_definition, "BrO_volume_mixing_ratio", harp_type_double, 2,
921 dimension_type, NULL, description, "ppv", NULL, read_value);
922 path = "/HDFEOS/SWATHS/BrO/Data_Fields/L2gpValue[]";
923 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
924
925 /* BrO_volume_mixing_ratio_uncertainty */
926 description = "uncertainty of the BrO volume mixing ratio";
927 variable_definition =
928 harp_ingestion_register_variable_full_read(product_definition, "BrO_volume_mixing_ratio_uncertainty",
929 harp_type_double, 2, dimension_type, NULL, description, "ppv", NULL,
930 read_error);
931 path = "/HDFEOS/SWATHS/BrO/Data_Fields/L2gpPrecision[]";
932 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
933
934 /* BrO_volume_mixing_ratio_validity */
935 description = "quality flag for the BrO volume mixing ratio";
936 variable_definition =
937 harp_ingestion_register_variable_full_read(product_definition, "BrO_volume_mixing_ratio_validity",
938 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
939 read_validity);
940 path = "/HDFEOS/SWATHS/BrO/Data_Fields/Status[], /HDFEOS/SWATHS/BrO/Data_Fields/Quality[], "
941 "/HDFEOS/SWATHS/BrO/Data_Fields/Convergence[], /HDFEOS/SWATHS/BrO/Data_Fields/L2gpPrecision[], "
942 "/HDFEOS/SWATHS/BrO/Geolocation_Fields/Pressure[]";
943 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
944 }
945
946 static void register_ch3cl_product(void)
947 {
948 harp_ingestion_module *module;
949 harp_product_definition *product_definition;
950 harp_variable_definition *variable_definition;
951 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
952 const char *description;
953 const char *path;
954
955 module = harp_ingestion_register_module("MLS_L2_CH3Cl", "MLS", "AURA_MLS", "ML2CH3CL", "MLS CH3Cl profile",
956 ingestion_init_ch3cl, ingestion_done);
957
958 /* CH3Cl product */
959 product_definition = harp_ingestion_register_product(module, "MLS_L2_CH3Cl", NULL, read_dimensions);
960 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
961 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
962
963 /* datetime */
964 path = "/HDFEOS/SWATHS/CH3Cl/Geolocation_Fields/Time[]";
965 register_datetime_variable(product_definition, path);
966
967 /* longitude and latitude */
968 path = "/HDFEOS/SWATHS/CH3Cl/Geolocation_Fields/Longitude[]";
969 register_longitude_variable(product_definition, path);
970 path = "/HDFEOS/SWATHS/CH3Cl/Geolocation_Fields/Latitude[]";
971 register_latitude_variable(product_definition, path);
972
973 /* pressure */
974 path = "/HDFEOS/SWATHS/CH3Cl/Geolocation_Fields/Pressure[]";
975 register_pressure_variable(product_definition, path);
976
977 /* CH3Cl_volume_mixing_ratio */
978 description = "CH3Cl volume mixing ratio";
979 variable_definition =
980 harp_ingestion_register_variable_full_read(product_definition, "CH3Cl_volume_mixing_ratio", harp_type_double, 2,
981 dimension_type, NULL, description, "ppv", NULL, read_value);
982 path = "/HDFEOS/SWATHS/CH3Cl/Data_Fields/L2gpValue[]";
983 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
984
985 /* CH3Cl_volume_mixing_ratio_uncertainty */
986 description = "uncertainty of the CH3Cl volume mixing ratio";
987 variable_definition =
988 harp_ingestion_register_variable_full_read(product_definition, "CH3Cl_volume_mixing_ratio_uncertainty",
989 harp_type_double, 2, dimension_type, NULL, description, "ppv", NULL,
990 read_error);
991 path = "/HDFEOS/SWATHS/CH3Cl/Data_Fields/L2gpPrecision[]";
992 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
993
994 /* CH3Cl_volume_mixing_ratio_validity */
995 description = "quality flag for the CH3Cl volume mixing ratio";
996 variable_definition =
997 harp_ingestion_register_variable_full_read(product_definition, "CH3Cl_volume_mixing_ratio_validity",
998 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
999 read_validity);
1000 path = "/HDFEOS/SWATHS/CH3Cl/Data_Fields/Status[], /HDFEOS/SWATHS/CH3Cl/Data_Fields/Quality[], "
1001 "/HDFEOS/SWATHS/CH3Cl/Data_Fields/Convergence[], /HDFEOS/SWATHS/CH3Cl/Data_Fields/L2gpPrecision[], "
1002 "/HDFEOS/SWATHS/CH3Cl/Geolocation_Fields/Pressure[]";
1003 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1004 }
1005
1006 static void register_ch3cn_product(void)
1007 {
1008 harp_ingestion_module *module;
1009 harp_product_definition *product_definition;
1010 harp_variable_definition *variable_definition;
1011 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1012 const char *description;
1013 const char *path;
1014
1015 module = harp_ingestion_register_module("MLS_L2_CH3CN", "MLS", "AURA_MLS", "ML2CH3CN", "MLS CH3CN profile",
1016 ingestion_init_ch3cn, ingestion_done);
1017
1018 /* CH3CN product */
1019 product_definition = harp_ingestion_register_product(module, "MLS_L2_CH3CN", NULL, read_dimensions);
1020 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1021 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1022
1023 /* datetime */
1024 path = "/HDFEOS/SWATHS/CH3CN/Geolocation_Fields/Time[]";
1025 register_datetime_variable(product_definition, path);
1026
1027 /* longitude and latitude */
1028 path = "/HDFEOS/SWATHS/CH3CN/Geolocation_Fields/Longitude[]";
1029 register_longitude_variable(product_definition, path);
1030 path = "/HDFEOS/SWATHS/CH3CN/Geolocation_Fields/Latitude[]";
1031 register_latitude_variable(product_definition, path);
1032
1033 /* pressure */
1034 path = "/HDFEOS/SWATHS/CH3CN/Geolocation_Fields/Pressure[]";
1035 register_pressure_variable(product_definition, path);
1036
1037 /* CH3CN_volume_mixing_ratio */
1038 description = "CH3CN volume mixing ratio";
1039 variable_definition =
1040 harp_ingestion_register_variable_full_read(product_definition, "CH3CN_volume_mixing_ratio", harp_type_double, 2,
1041 dimension_type, NULL, description, "ppv", NULL, read_value);
1042 path = "/HDFEOS/SWATHS/CH3CN/Data_Fields/L2gpValue[]";
1043 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1044
1045 /* CH3Cl_volume_mixing_ratio_uncertainty */
1046 description = "uncertainty of the CH3CN volume mixing ratio";
1047 variable_definition =
1048 harp_ingestion_register_variable_full_read(product_definition, "CH3CN_volume_mixing_ratio_uncertainty",
1049 harp_type_double, 2, dimension_type, NULL, description, "ppv",
1050 NULL, read_error);
1051 path = "/HDFEOS/SWATHS/CH3CN/Data_Fields/L2gpPrecision[]";
1052 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1053
1054 /* CH3CN_volume_mixing_ratio_validity */
1055 description = "quality flag for the CH3CN volume mixing ratio";
1056 variable_definition =
1057 harp_ingestion_register_variable_full_read(product_definition, "CH3CN_volume_mixing_ratio_validity",
1058 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1059 read_validity);
1060 path = "/HDFEOS/SWATHS/CH3CN/Data_Fields/Status[], /HDFEOS/SWATHS/CH3CN/Data_Fields/Quality[], "
1061 "/HDFEOS/SWATHS/CH3CN/Data_Fields/Convergence[], /HDFEOS/SWATHS/CH3CN/Data_Fields/L2gpPrecision[], "
1062 "/HDFEOS/SWATHS/CH3CN/Geolocation_Fields/Pressure[]";
1063 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1064 }
1065
1066 static void register_ch3oh_product(void)
1067 {
1068 harp_ingestion_module *module;
1069 harp_product_definition *product_definition;
1070 harp_variable_definition *variable_definition;
1071 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1072 const char *description;
1073 const char *path;
1074
1075 module = harp_ingestion_register_module("MLS_L2_CH3OH", "MLS", "AURA_MLS", "ML2CH3OH", "MLS CH3OH profile",
1076 ingestion_init_ch3oh, ingestion_done);
1077
1078 /* CH3OH product */
1079 product_definition = harp_ingestion_register_product(module, "MLS_L2_CH3OH", NULL, read_dimensions);
1080 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1081 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1082
1083 /* datetime */
1084 path = "/HDFEOS/SWATHS/CH3OH/Geolocation_Fields/Time[]";
1085 register_datetime_variable(product_definition, path);
1086
1087 /* longitude and latitude */
1088 path = "/HDFEOS/SWATHS/CH3OH/Geolocation_Fields/Longitude[]";
1089 register_longitude_variable(product_definition, path);
1090 path = "/HDFEOS/SWATHS/CH3OH/Geolocation_Fields/Latitude[]";
1091 register_latitude_variable(product_definition, path);
1092
1093 /* pressure */
1094 path = "/HDFEOS/SWATHS/CH3OH/Geolocation_Fields/Pressure[]";
1095 register_pressure_variable(product_definition, path);
1096
1097 /* CH3OH_volume_mixing_ratio */
1098 description = "CH3OH volume mixing ratio";
1099 variable_definition =
1100 harp_ingestion_register_variable_full_read(product_definition, "CH3OH_volume_mixing_ratio", harp_type_double, 2,
1101 dimension_type, NULL, description, "ppv", NULL, read_value);
1102 path = "/HDFEOS/SWATHS/CH3OH/Data_Fields/L2gpValue[]";
1103 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1104
1105 /* CH3OH_volume_mixing_ratio_uncertainty */
1106 description = "uncertainty of the CH3OH volume mixing ratio";
1107 variable_definition =
1108 harp_ingestion_register_variable_full_read(product_definition, "CH3OH_volume_mixing_ratio_uncertainty",
1109 harp_type_double, 2, dimension_type, NULL, description, "ppv", NULL,
1110 read_error);
1111 path = "/HDFEOS/SWATHS/CH3OH/Data_Fields/L2gpPrecision[]";
1112 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1113
1114 /* CH3OH_volume_mixing_ratio_validity */
1115 description = "quality flag for the CH3OH volume mixing ratio";
1116 variable_definition =
1117 harp_ingestion_register_variable_full_read(product_definition, "CH3OH_volume_mixing_ratio_validity",
1118 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1119 read_validity);
1120 path = "/HDFEOS/SWATHS/CH3OH/Data_Fields/Status[], /HDFEOS/SWATHS/CH3OH/Data_Fields/Quality[], "
1121 "/HDFEOS/SWATHS/CH3OH/Data_Fields/Convergence[], /HDFEOS/SWATHS/CH3OH/Data_Fields/L2gpPrecision[], "
1122 "/HDFEOS/SWATHS/CH3OH/Geolocation_Fields/Pressure[]";
1123 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1124 }
1125
1126 static void register_clo_product(void)
1127 {
1128 harp_ingestion_module *module;
1129 harp_product_definition *product_definition;
1130 harp_variable_definition *variable_definition;
1131 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1132 const char *description;
1133 const char *path;
1134
1135 module = harp_ingestion_register_module("MLS_L2_CLO", "MLS", "AURA_MLS", "ML2CLO", "MLS ClO profile",
1136 ingestion_init_clo, ingestion_done);
1137
1138 /* CLO product */
1139 product_definition = harp_ingestion_register_product(module, "MLS_L2_CLO", NULL, read_dimensions);
1140 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1141 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1142
1143 /* datetime */
1144 path = "/HDFEOS/SWATHS/ClO/Geolocation_Fields/Time[]";
1145 register_datetime_variable(product_definition, path);
1146
1147 /* longitude and latitude */
1148 path = "/HDFEOS/SWATHS/ClO/Geolocation_Fields/Longitude[]";
1149 register_longitude_variable(product_definition, path);
1150 path = "/HDFEOS/SWATHS/ClO/Geolocation_Fields/Latitude[]";
1151 register_latitude_variable(product_definition, path);
1152
1153 /* pressure */
1154 path = "/HDFEOS/SWATHS/ClO/Geolocation_Fields/Pressure[]";
1155 register_pressure_variable(product_definition, path);
1156
1157 /* ClO_volume_mixing_ratio */
1158 description = "ClO volume mixing ratio";
1159 variable_definition =
1160 harp_ingestion_register_variable_full_read(product_definition, "ClO_volume_mixing_ratio", harp_type_double, 2,
1161 dimension_type, NULL, description, "ppv", NULL, read_value);
1162 path = "/HDFEOS/SWATHS/ClO/Data_Fields/L2gpValue[]";
1163 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1164
1165 /* ClO_volume_mixing_ratio_uncertainty */
1166 description = "uncertainty of the ClO volume mixing ratio";
1167 variable_definition =
1168 harp_ingestion_register_variable_full_read(product_definition, "ClO_volume_mixing_ratio_uncertainty",
1169 harp_type_double, 2, dimension_type, NULL, description, "ppv", NULL,
1170 read_error);
1171 path = "/HDFEOS/SWATHS/ClO/Data_Fields/L2gpPrecision[]";
1172 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1173
1174 /* ClO_volume_mixing_ratio_validity */
1175 description = "quality flag for the ClO volume mixing ratio";
1176 variable_definition =
1177 harp_ingestion_register_variable_full_read(product_definition, "ClO_volume_mixing_ratio_validity",
1178 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1179 read_validity);
1180 path = "/HDFEOS/SWATHS/ClO/Data_Fields/Status[], /HDFEOS/SWATHS/ClO/Data_Fields/Quality[], "
1181 "/HDFEOS/SWATHS/ClO/Data_Fields/Convergence[], /HDFEOS/SWATHS/ClO/Data_Fields/L2gpPrecision[], "
1182 "/HDFEOS/SWATHS/ClO/Geolocation_Fields/Pressure[]";
1183 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1184 }
1185
1186 static void register_co_product(void)
1187 {
1188 harp_ingestion_module *module;
1189 harp_product_definition *product_definition;
1190 harp_variable_definition *variable_definition;
1191 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1192 const char *description;
1193 const char *path;
1194
1195 module = harp_ingestion_register_module("MLS_L2_CO", "MLS", "AURA_MLS", "ML2CO", "MLS CO profile",
1196 ingestion_init_co, ingestion_done);
1197
1198 /* CO product */
1199 product_definition = harp_ingestion_register_product(module, "MLS_L2_CO", NULL, read_dimensions);
1200 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1201 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1202
1203 /* datetime */
1204 path = "/HDFEOS/SWATHS/CO/Geolocation_Fields/Time[]";
1205 register_datetime_variable(product_definition, path);
1206
1207 /* longitude and latitude */
1208 path = "/HDFEOS/SWATHS/CO/Geolocation_Fields/Longitude[]";
1209 register_longitude_variable(product_definition, path);
1210 path = "/HDFEOS/SWATHS/CO/Geolocation_Fields/Latitude[]";
1211 register_latitude_variable(product_definition, path);
1212
1213 /* pressure */
1214 path = "/HDFEOS/SWATHS/CO/Geolocation_Fields/Pressure[]";
1215 register_pressure_variable(product_definition, path);
1216
1217 /* CO_volume_mixing_ratio */
1218 description = "CO volume mixing ratio";
1219 variable_definition =
1220 harp_ingestion_register_variable_full_read(product_definition, "CO_volume_mixing_ratio", harp_type_double, 2,
1221 dimension_type, NULL, description, "ppv", NULL, read_value);
1222 path = "/HDFEOS/SWATHS/CO/Data_Fields/L2gpValue[]";
1223 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1224
1225 /* CO_volume_mixing_ratio_uncertainty */
1226 description = "uncertainty of the CO volume mixing ratio";
1227 variable_definition =
1228 harp_ingestion_register_variable_full_read(product_definition, "CO_volume_mixing_ratio_uncertainty",
1229 harp_type_double, 2, dimension_type, NULL, description, "ppv", NULL,
1230 read_error);
1231 path = "/HDFEOS/SWATHS/CO/Data_Fields/L2gpPrecision[]";
1232 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1233
1234 /* CO_volume_mixing_ratio_validity */
1235 description = "quality flag for the CO volume mixing ratio";
1236 variable_definition =
1237 harp_ingestion_register_variable_full_read(product_definition, "CO_volume_mixing_ratio_validity",
1238 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1239 read_validity);
1240 path = "/HDFEOS/SWATHS/CO/Data_Fields/Status[], /HDFEOS/SWATHS/CO/Data_Fields/Quality[], "
1241 "/HDFEOS/SWATHS/CO/Data_Fields/Convergence[], /HDFEOS/SWATHS/CO/Data_Fields/L2gpPrecision[], "
1242 "/HDFEOS/SWATHS/CO/Geolocation_Fields/Pressure[]";
1243 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1244 }
1245
1246 static void register_gph_product(void)
1247 {
1248 harp_ingestion_module *module;
1249 harp_product_definition *product_definition;
1250 harp_variable_definition *variable_definition;
1251 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1252 const char *description;
1253 const char *path;
1254
1255 module = harp_ingestion_register_module("MLS_L2_GPH", "MLS", "AURA_MLS", "ML2GPH", "MLS GPH profile",
1256 ingestion_init_gph, ingestion_done);
1257
1258 /* GPH product */
1259 product_definition = harp_ingestion_register_product(module, "MLS_L2_GPH", NULL, read_dimensions);
1260 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1261 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1262
1263 /* datetime */
1264 path = "/HDFEOS/SWATHS/GPH/Geolocation_Fields/Time[]";
1265 register_datetime_variable(product_definition, path);
1266
1267 /* longitude and latitude */
1268 path = "/HDFEOS/SWATHS/GPH/Geolocation_Fields/Longitude[]";
1269 register_longitude_variable(product_definition, path);
1270 path = "/HDFEOS/SWATHS/GPH/Geolocation_Fields/Latitude[]";
1271 register_latitude_variable(product_definition, path);
1272
1273 /* pressure */
1274 path = "/HDFEOS/SWATHS/GPH/Geolocation_Fields/Pressure[]";
1275 register_pressure_variable(product_definition, path);
1276
1277 /* geopotential_height */
1278 description = "retrieved geopotential height";
1279 variable_definition =
1280 harp_ingestion_register_variable_full_read(product_definition, "geopotential_height", harp_type_double, 2,
1281 dimension_type, NULL, description, "m", NULL, read_value);
1282 path = "/HDFEOS/SWATHS/GPH/Data_Fields/L2gpValue[]";
1283 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1284
1285 /* geopotential_height_uncertainty */
1286 description = "uncertainty of the retrieved geopotential height";
1287 variable_definition =
1288 harp_ingestion_register_variable_full_read(product_definition, "geopotential_height_uncertainty",
1289 harp_type_double, 2, dimension_type, NULL, description, "m", NULL,
1290 read_error);
1291 path = "/HDFEOS/SWATHS/GPH/Data_Fields/L2gpPrecision[]";
1292 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1293
1294 /* geopotential_height_validity */
1295 description = "quality flag for the retrieved geopotential height";
1296 variable_definition =
1297 harp_ingestion_register_variable_full_read(product_definition, "geopotential_height_validity",
1298 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1299 read_validity);
1300 path = "/HDFEOS/SWATHS/GPH/Data_Fields/Status[], /HDFEOS/SWATHS/GPH/Data_Fields/Quality[], "
1301 "/HDFEOS/SWATHS/GPH/Data_Fields/Convergence[], /HDFEOS/SWATHS/GPH/Data_Fields/L2gpPrecision[], "
1302 "/HDFEOS/SWATHS/GPH/Geolocation_Fields/Pressure[]";
1303 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1304 }
1305
1306 static void register_h2o_product(void)
1307 {
1308 harp_ingestion_module *module;
1309 harp_product_definition *product_definition;
1310 harp_variable_definition *variable_definition;
1311 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1312 const char *description;
1313 const char *path;
1314
1315 module = harp_ingestion_register_module("MLS_L2_H2O", "MLS", "AURA_MLS", "ML2H2O", "MLS H2O profile",
1316 ingestion_init_h2o, ingestion_done);
1317
1318 /* H2O product */
1319 product_definition = harp_ingestion_register_product(module, "MLS_L2_H2O", NULL, read_dimensions);
1320 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1321 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1322
1323 /* datetime */
1324 path = "/HDFEOS/SWATHS/H2O/Geolocation_Fields/Time[]";
1325 register_datetime_variable(product_definition, path);
1326
1327 /* longitude and latitude */
1328 path = "/HDFEOS/SWATHS/H2O/Geolocation_Fields/Longitude[]";
1329 register_longitude_variable(product_definition, path);
1330 path = "/HDFEOS/SWATHS/H2O/Geolocation_Fields/Latitude[]";
1331 register_latitude_variable(product_definition, path);
1332
1333 /* pressure */
1334 path = "/HDFEOS/SWATHS/H2O/Geolocation_Fields/Pressure[]";
1335 register_pressure_variable(product_definition, path);
1336
1337 /* H2O_volume_mixing_ratio */
1338 description = "H2O volume mixing ratio";
1339 variable_definition =
1340 harp_ingestion_register_variable_full_read(product_definition, "H2O_volume_mixing_ratio", harp_type_double, 2,
1341 dimension_type, NULL, description, "ppv", NULL, read_value);
1342 path = "/HDFEOS/SWATHS/H2O/Data_Fields/L2gpValue[]";
1343 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1344
1345 /* H2O_volume_mixing_ratio_uncertainty */
1346 description = "uncertainty of the H2O volume mixing ratio";
1347 variable_definition =
1348 harp_ingestion_register_variable_full_read(product_definition, "H2O_volume_mixing_ratio_uncertainty",
1349 harp_type_double, 2, dimension_type, NULL, description, "ppv", NULL,
1350 read_error);
1351 path = "/HDFEOS/SWATHS/H2O/Data_Fields/L2gpPrecision[]";
1352 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1353
1354 /* H2O_volume_mixing_ratio_validity */
1355 description = "quality flag for the H2O volume mixing ratio";
1356 variable_definition =
1357 harp_ingestion_register_variable_full_read(product_definition, "H2O_volume_mixing_ratio_validity",
1358 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1359 read_validity);
1360 path = "/HDFEOS/SWATHS/H2O/Data_Fields/Status[], /HDFEOS/SWATHS/H2O/Data_Fields/Quality[], "
1361 "/HDFEOS/SWATHS/H2O/Data_Fields/Convergence[], /HDFEOS/SWATHS/H2O/Data_Fields/L2gpPrecision[], "
1362 "/HDFEOS/SWATHS/H2O/Geolocation_Fields/Pressure[]";
1363 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1364 }
1365
1366 static void register_hcl_product(void)
1367 {
1368 harp_ingestion_module *module;
1369 harp_product_definition *product_definition;
1370 harp_variable_definition *variable_definition;
1371 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1372 const char *description;
1373 const char *path;
1374
1375 module = harp_ingestion_register_module("MLS_L2_HCL", "MLS", "AURA_MLS", "ML2HCL", "MLS HCl profile",
1376 ingestion_init_hcl, ingestion_done);
1377
1378 /* HCL product */
1379 product_definition = harp_ingestion_register_product(module, "MLS_L2_HCL", NULL, read_dimensions);
1380 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1381 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1382
1383 /* datetime */
1384 path = "/HDFEOS/SWATHS/HCL/Geolocation_Fields/Time[]";
1385 register_datetime_variable(product_definition, path);
1386
1387 /* longitude and latitude */
1388 path = "/HDFEOS/SWATHS/HCL/Geolocation_Fields/Longitude[]";
1389 register_longitude_variable(product_definition, path);
1390 path = "/HDFEOS/SWATHS/HCL/Geolocation_Fields/Latitude[]";
1391 register_latitude_variable(product_definition, path);
1392
1393 /* pressure */
1394 path = "/HDFEOS/SWATHS/HCL/Geolocation_Fields/Pressure[]";
1395 register_pressure_variable(product_definition, path);
1396
1397 /* HCl_volume_mixing_ratio */
1398 description = "HCl volume mixing ratio";
1399 variable_definition =
1400 harp_ingestion_register_variable_full_read(product_definition, "HCl_volume_mixing_ratio", harp_type_double, 2,
1401 dimension_type, NULL, description, "ppv", NULL, read_value);
1402 path = "/HDFEOS/SWATHS/HCL/Data_Fields/L2gpValue[]";
1403 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1404
1405 /* HCl_volume_mixing_ratio_uncertainty */
1406 description = "uncertainty of the HCl volume mixing ratio";
1407 variable_definition =
1408 harp_ingestion_register_variable_full_read(product_definition, "HCl_volume_mixing_ratio_uncertainty",
1409 harp_type_double, 2, dimension_type, NULL, description, "ppv", NULL,
1410 read_error);
1411 path = "/HDFEOS/SWATHS/HCL/Data_Fields/L2gpPrecision[]";
1412 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1413
1414 /* HCl_volume_mixing_ratio_validity */
1415 description = "quality flag for the HCl volume mixing ratio";
1416 variable_definition =
1417 harp_ingestion_register_variable_full_read(product_definition, "HCl_volume_mixing_ratio_validity",
1418 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1419 read_validity);
1420 path = "/HDFEOS/SWATHS/HCl/Data_Fields/Status[], /HDFEOS/SWATHS/HCl/Data_Fields/Quality[], "
1421 "/HDFEOS/SWATHS/HCl/Data_Fields/Convergence[], /HDFEOS/SWATHS/HCl/Data_Fields/L2gpPrecision[], "
1422 "/HDFEOS/SWATHS/HCl/Geolocation_Fields/Pressure[]";
1423 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1424 }
1425
1426 static void register_hcn_product(void)
1427 {
1428 harp_ingestion_module *module;
1429 harp_product_definition *product_definition;
1430 harp_variable_definition *variable_definition;
1431 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1432 const char *description;
1433 const char *path;
1434
1435 module = harp_ingestion_register_module("MLS_L2_HCN", "MLS", "AURA_MLS", "ML2HCN", "MLS HCN profile",
1436 ingestion_init_hcn, ingestion_done);
1437
1438 /* HCN product */
1439 product_definition = harp_ingestion_register_product(module, "MLS_L2_HCN", NULL, read_dimensions);
1440 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1441 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1442
1443 /* datetime */
1444 path = "/HDFEOS/SWATHS/HCN/Geolocation_Fields/Time[]";
1445 register_datetime_variable(product_definition, path);
1446
1447 /* longitude and latitude */
1448 path = "/HDFEOS/SWATHS/HCN/Geolocation_Fields/Longitude[]";
1449 register_longitude_variable(product_definition, path);
1450 path = "/HDFEOS/SWATHS/HCN/Geolocation_Fields/Latitude[]";
1451 register_latitude_variable(product_definition, path);
1452
1453 /* pressure */
1454 path = "/HDFEOS/SWATHS/HCN/Geolocation_Fields/Pressure[]";
1455 register_pressure_variable(product_definition, path);
1456
1457 /* HCN_volume_mixing_ratio */
1458 description = "HCN volume mixing ratio";
1459 variable_definition =
1460 harp_ingestion_register_variable_full_read(product_definition, "HCN_volume_mixing_ratio", harp_type_double, 2,
1461 dimension_type, NULL, description, "ppv", NULL, read_value);
1462 path = "/HDFEOS/SWATHS/HCN/Data_Fields/L2gpValue[]";
1463 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1464
1465 /* HCN_volume_mixing_ratio_uncertainty */
1466 description = "uncertainty of the HCN volume mixing ratio";
1467 variable_definition =
1468 harp_ingestion_register_variable_full_read(product_definition, "HCN_volume_mixing_ratio_uncertainty",
1469 harp_type_double, 2, dimension_type, NULL, description, "ppv", NULL,
1470 read_error);
1471 path = "/HDFEOS/SWATHS/HCN/Data_Fields/L2gpPrecision[]";
1472 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1473
1474 /* HCN_volume_mixing_ratio_validity */
1475 description = "quality flag for the HCN volume mixing ratio";
1476 variable_definition =
1477 harp_ingestion_register_variable_full_read(product_definition, "HCN_volume_mixing_ratio_validity",
1478 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1479 read_validity);
1480 path = "/HDFEOS/SWATHS/HCN/Data_Fields/Status[], /HDFEOS/SWATHS/HCN/Data_Fields/Quality[], "
1481 "/HDFEOS/SWATHS/HCN/Data_Fields/Convergence[], /HDFEOS/SWATHS/HCN/Data_Fields/L2gpPrecision[], "
1482 "/HDFEOS/SWATHS/HCN/Geolocation_Fields/Pressure[]";
1483 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1484 }
1485
1486 static void register_hno3_product(void)
1487 {
1488 harp_ingestion_module *module;
1489 harp_product_definition *product_definition;
1490 harp_variable_definition *variable_definition;
1491 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1492 const char *description;
1493 const char *path;
1494
1495 module = harp_ingestion_register_module("MLS_L2_HNO3", "MLS", "AURA_MLS", "ML2HNO3", "MLS HNO3 profile",
1496 ingestion_init_hno3, ingestion_done);
1497
1498 /* HNO3 product */
1499 product_definition = harp_ingestion_register_product(module, "MLS_L2_HNO3", NULL, read_dimensions);
1500 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1501 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1502 harp_product_definition_add_mapping(product_definition, hno3_quality_flag_description, NULL);
1503
1504 /* datetime */
1505 path = "/HDFEOS/SWATHS/HNO3/Geolocation_Fields/Time[]";
1506 register_datetime_variable(product_definition, path);
1507
1508 /* longitude and latitude */
1509 path = "/HDFEOS/SWATHS/HNO3/Geolocation_Fields/Longitude[]";
1510 register_longitude_variable(product_definition, path);
1511 path = "/HDFEOS/SWATHS/HNO3/Geolocation_Fields/Latitude[]";
1512 register_latitude_variable(product_definition, path);
1513
1514 /* pressure */
1515 path = "/HDFEOS/SWATHS/HNO3/Geolocation_Fields/Pressure[]";
1516 register_pressure_variable(product_definition, path);
1517
1518 /* HNO3_volume_mixing_ratio */
1519 description = "HNO3 volume mixing ratio";
1520 variable_definition =
1521 harp_ingestion_register_variable_full_read(product_definition, "HNO3_volume_mixing_ratio", harp_type_double, 2,
1522 dimension_type, NULL, description, "ppv", NULL, read_value);
1523 path = "/HDFEOS/SWATHS/HNO3/Data_Fields/L2gpValue[]";
1524 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1525
1526 /* HNO3_volume_mixing_ratio_uncertainty */
1527 description = "uncertainty of the HNO3 volume mixing ratio";
1528 variable_definition =
1529 harp_ingestion_register_variable_full_read(product_definition, "HNO3_volume_mixing_ratio_uncertainty",
1530 harp_type_double, 2, dimension_type, NULL, description, "ppv", NULL,
1531 read_error);
1532 path = "/HDFEOS/SWATHS/HNO3/Data_Fields/L2gpPrecision[]";
1533 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1534
1535 /* HNO3_volume_mixing_ratio_validity */
1536 description = "quality flag for the HNO3 volume mixing ratio";
1537 variable_definition =
1538 harp_ingestion_register_variable_full_read(product_definition, "HNO3_volume_mixing_ratio_validity",
1539 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1540 read_validity);
1541 path = "/HDFEOS/SWATHS/HNO3/Data_Fields/Status[], /HDFEOS/SWATHS/HNO3/Data_Fields/Quality[], "
1542 "/HDFEOS/SWATHS/HNO3/Data_Fields/Convergence[], /HDFEOS/SWATHS/HNO3/Data_Fields/L2gpPrecision[], "
1543 "/HDFEOS/SWATHS/HNO3/Geolocation_Fields/Pressure[]";
1544 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1545 }
1546
1547 static void register_ho2_product(void)
1548 {
1549 harp_ingestion_module *module;
1550 harp_product_definition *product_definition;
1551 harp_variable_definition *variable_definition;
1552 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1553 const char *description;
1554 const char *path;
1555
1556 module = harp_ingestion_register_module("MLS_L2_HO2", "MLS", "AURA_MLS", "ML2HO2", "MLS HO2 profile",
1557 ingestion_init_ho2, ingestion_done);
1558
1559 /* HO2 product */
1560 product_definition = harp_ingestion_register_product(module, "MLS_L2_HO2", NULL, read_dimensions);
1561 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1562 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1563
1564 /* datetime */
1565 path = "/HDFEOS/SWATHS/HO2/Geolocation_Fields/Time[]";
1566 register_datetime_variable(product_definition, path);
1567
1568 /* longitude and latitude */
1569 path = "/HDFEOS/SWATHS/HO2/Geolocation_Fields/Longitude[]";
1570 register_longitude_variable(product_definition, path);
1571 path = "/HDFEOS/SWATHS/HO2/Geolocation_Fields/Latitude[]";
1572 register_latitude_variable(product_definition, path);
1573
1574 /* pressure */
1575 path = "/HDFEOS/SWATHS/HO2/Geolocation_Fields/Pressure[]";
1576 register_pressure_variable(product_definition, path);
1577
1578 /* HO2_volume_mixing_ratio */
1579 description = "HO2 volume mixing ratio";
1580 variable_definition =
1581 harp_ingestion_register_variable_full_read(product_definition, "HO2_volume_mixing_ratio", harp_type_double, 2,
1582 dimension_type, NULL, description, "ppv", NULL, read_value);
1583 path = "/HDFEOS/SWATHS/HO2/Data_Fields/L2gpValue[]";
1584 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1585
1586 /* HO2_volume_mixing_ratio_uncertainty */
1587 description = "uncertainty of the HO2 volume mixing ratio";
1588 variable_definition =
1589 harp_ingestion_register_variable_full_read(product_definition, "HO2_volume_mixing_ratio_uncertainty",
1590 harp_type_double, 2, dimension_type, NULL, description, "ppv", NULL,
1591 read_error);
1592 path = "/HDFEOS/SWATHS/HO2/Data_Fields/L2gpPrecision[]";
1593 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1594
1595 /* HO2_volume_mixing_ratio_validity */
1596 description = "quality flag for the HO2 volume mixing ratio";
1597 variable_definition =
1598 harp_ingestion_register_variable_full_read(product_definition, "HO2_volume_mixing_ratio_validity",
1599 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1600 read_validity);
1601 path = "/HDFEOS/SWATHS/HO2/Data_Fields/Status[], /HDFEOS/SWATHS/HO2/Data_Fields/Quality[], "
1602 "/HDFEOS/SWATHS/HO2/Data_Fields/Convergence[], /HDFEOS/SWATHS/HO2/Data_Fields/L2gpPrecision[], "
1603 "/HDFEOS/SWATHS/HO2/Geolocation_Fields/Pressure[]";
1604 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1605 }
1606
1607 static void register_hocl_product(void)
1608 {
1609 harp_ingestion_module *module;
1610 harp_product_definition *product_definition;
1611 harp_variable_definition *variable_definition;
1612 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1613 const char *description;
1614 const char *path;
1615
1616 module = harp_ingestion_register_module("MLS_L2_HOCL", "MLS", "AURA_MLS", "ML2HOCL", "MLS HOCl profile",
1617 ingestion_init_hocl, ingestion_done);
1618
1619 /* HOCL product */
1620 product_definition = harp_ingestion_register_product(module, "MLS_L2_HOCL", NULL, read_dimensions);
1621 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1622 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1623
1624 /* datetime */
1625 path = "/HDFEOS/SWATHS/HOCL/Geolocation_Fields/Time[]";
1626 register_datetime_variable(product_definition, path);
1627
1628 /* longitude and latitude */
1629 path = "/HDFEOS/SWATHS/HOCL/Geolocation_Fields/Longitude[]";
1630 register_longitude_variable(product_definition, path);
1631 path = "/HDFEOS/SWATHS/HOCL/Geolocation_Fields/Latitude[]";
1632 register_latitude_variable(product_definition, path);
1633
1634 /* pressure */
1635 path = "/HDFEOS/SWATHS/HOCL/Geolocation_Fields/Pressure[]";
1636 register_pressure_variable(product_definition, path);
1637
1638 /* HOCl_volume_mixing_ratio */
1639 description = "HOCl volume mixing ratio";
1640 variable_definition =
1641 harp_ingestion_register_variable_full_read(product_definition, "HOCl_volume_mixing_ratio", harp_type_double, 2,
1642 dimension_type, NULL, description, "ppv", NULL, read_value);
1643 path = "/HDFEOS/SWATHS/HOCL/Data_Fields/L2gpValue[]";
1644 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1645
1646 /* HOCl_volume_mixing_ratio_uncertainty */
1647 description = "uncertainty of the HOCl volume mixing ratio";
1648 variable_definition =
1649 harp_ingestion_register_variable_full_read(product_definition, "HOCl_volume_mixing_ratio_uncertainty",
1650 harp_type_double, 2, dimension_type, NULL, description, "ppv", NULL,
1651 read_error);
1652 path = "/HDFEOS/SWATHS/HOCL/Data_Fields/L2gpPrecision[]";
1653 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1654
1655 /* HOCl_volume_mixing_ratio_validity */
1656 description = "quality flag for the HOCl volume mixing ratio";
1657 variable_definition =
1658 harp_ingestion_register_variable_full_read(product_definition, "HOCl_volume_mixing_ratio_validity",
1659 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1660 read_validity);
1661 path = "/HDFEOS/SWATHS/HOCl/Data_Fields/Status[], /HDFEOS/SWATHS/HOCl/Data_Fields/Quality[], "
1662 "/HDFEOS/SWATHS/HOCl/Data_Fields/Convergence[], /HDFEOS/SWATHS/HOCl/Data_Fields/L2gpPrecision[], "
1663 "/HDFEOS/SWATHS/HOCl/Geolocation_Fields/Pressure[]";
1664 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1665 }
1666
1667 static void register_iwc_product(void)
1668 {
1669 harp_ingestion_module *module;
1670 harp_product_definition *product_definition;
1671 harp_variable_definition *variable_definition;
1672 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1673 const char *description;
1674 const char *path;
1675
1676 module = harp_ingestion_register_module("MLS_L2_IWC", "MLS", "AURA_MLS", "ML2IWC",
1677 "MLS ice water content profile", ingestion_init_iwc, ingestion_done);
1678
1679 /* IWC product */
1680 product_definition = harp_ingestion_register_product(module, "MLS_L2_IWC", NULL, read_dimensions);
1681 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1682 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1683
1684 /* datetime */
1685 path = "/HDFEOS/SWATHS/IWC/Geolocation_Fields/Time[]";
1686 register_datetime_variable(product_definition, path);
1687
1688 /* longitude and latitude */
1689 path = "/HDFEOS/SWATHS/IWC/Geolocation_Fields/Longitude[]";
1690 register_longitude_variable(product_definition, path);
1691 path = "/HDFEOS/SWATHS/IWC/Geolocation_Fields/Latitude[]";
1692 register_latitude_variable(product_definition, path);
1693
1694 /* pressure */
1695 path = "/HDFEOS/SWATHS/IWC/Geolocation_Fields/Pressure[]";
1696 register_pressure_variable(product_definition, path);
1697
1698 /* ice_water_density */
1699 description = "Ice water content";
1700 variable_definition =
1701 harp_ingestion_register_variable_full_read(product_definition, "ice_water_density", harp_type_double, 2,
1702 dimension_type, NULL, description, "g/m^3", NULL, read_value);
1703 path = "/HDFEOS/SWATHS/IWC/Data_Fields/L2gpValue[]";
1704 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1705
1706 /* ice_water_density_uncertainty */
1707 description = "uncertainty of the ice water content";
1708 variable_definition =
1709 harp_ingestion_register_variable_full_read(product_definition, "ice_water_density_uncertainty",
1710 harp_type_double, 2, dimension_type, NULL, description, "g/m^3",
1711 NULL, read_value);
1712 path = "/HDFEOS/SWATHS/IWC/Data_Fields/L2gpPrecision[]";
1713 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1714
1715 /* ice_water_density_validity */
1716 description = "quality flag for the ice water content";
1717 variable_definition =
1718 harp_ingestion_register_variable_full_read(product_definition, "ice_water_density_validity",
1719 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1720 read_validity);
1721 path = "/HDFEOS/SWATHS/IWC/Data_Fields/Status[], /HDFEOS/SWATHS/IWC/Data_Fields/Quality[], "
1722 "/HDFEOS/SWATHS/IWC/Data_Fields/Convergence[], /HDFEOS/SWATHS/IWC/Data_Fields/L2gpPrecision[], "
1723 "/HDFEOS/SWATHS/IWC/Geolocation_Fields/Pressure[]";
1724 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1725 }
1726
1727 static void register_n2o_product(void)
1728 {
1729 harp_ingestion_module *module;
1730 harp_product_definition *product_definition;
1731 harp_variable_definition *variable_definition;
1732 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1733 const char *description;
1734 const char *path;
1735
1736 module = harp_ingestion_register_module("MLS_L2_N2O", "MLS", "AURA_MLS", "ML2N2O", "MLS N2O profile",
1737 ingestion_init_n2o, ingestion_done);
1738
1739 /* N2O product */
1740 product_definition = harp_ingestion_register_product(module, "MLS_L2_N2O", NULL, read_dimensions);
1741 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1742 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1743
1744 /* datetime */
1745 path = "/HDFEOS/SWATHS/N2O/Geolocation_Fields/Time[]";
1746 register_datetime_variable(product_definition, path);
1747
1748 /* longitude and latitude */
1749 path = "/HDFEOS/SWATHS/N2O/Geolocation_Fields/Longitude[]";
1750 register_longitude_variable(product_definition, path);
1751 path = "/HDFEOS/SWATHS/N2O/Geolocation_Fields/Latitude[]";
1752 register_latitude_variable(product_definition, path);
1753
1754 /* pressure */
1755 path = "/HDFEOS/SWATHS/N2O/Geolocation_Fields/Pressure[]";
1756 register_pressure_variable(product_definition, path);
1757
1758 /* N2O_volume_mixing_ratio */
1759 description = "N2O volume mixing ratio";
1760 variable_definition =
1761 harp_ingestion_register_variable_full_read(product_definition, "N2O_volume_mixing_ratio", harp_type_double, 2,
1762 dimension_type, NULL, description, "ppv", NULL, read_value);
1763 path = "/HDFEOS/SWATHS/N2O/Data_Fields/L2gpValue[]";
1764 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1765
1766 /* N2O_volume_mixing_ratio_uncertainty */
1767 description = "uncertainty of the N2O volume mixing ratio";
1768 variable_definition =
1769 harp_ingestion_register_variable_full_read(product_definition, "N2O_volume_mixing_ratio_uncertainty",
1770 harp_type_double, 2, dimension_type, NULL, description, "ppv", NULL,
1771 read_error);
1772 path = "/HDFEOS/SWATHS/N2O/Data_Fields/L2gpPrecision[]";
1773 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1774
1775 /* N2O_volume_mixing_ratio_validity */
1776 description = "quality flag for the N2O volume mixing ratio";
1777 variable_definition =
1778 harp_ingestion_register_variable_full_read(product_definition, "N2O_volume_mixing_ratio_validity",
1779 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1780 read_validity);
1781 path = "/HDFEOS/SWATHS/N2O/Data_Fields/Status[], /HDFEOS/SWATHS/N2O/Data_Fields/Quality[], "
1782 "/HDFEOS/SWATHS/N2O/Data_Fields/Convergence[], /HDFEOS/SWATHS/N2O/Data_Fields/L2gpPrecision[], "
1783 "/HDFEOS/SWATHS/N2O/Geolocation_Fields/Pressure[]";
1784 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1785 }
1786
1787 static void register_o3_product(void)
1788 {
1789 harp_ingestion_module *module;
1790 harp_product_definition *product_definition;
1791 harp_variable_definition *variable_definition;
1792 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1793 const char *description;
1794 const char *path;
1795
1796 module = harp_ingestion_register_module("MLS_L2_O3", "MLS", "AURA_MLS", "ML2O3", "MLS O3 profile",
1797 ingestion_init_o3, ingestion_done);
1798
1799 /* O3 product */
1800 product_definition = harp_ingestion_register_product(module, "MLS_L2_O3", NULL, read_dimensions);
1801 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1802 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1803
1804 /* datetime */
1805 path = "/HDFEOS/SWATHS/O3/Geolocation_Fields/Time[]";
1806 register_datetime_variable(product_definition, path);
1807
1808 /* longitude and latitude */
1809 path = "/HDFEOS/SWATHS/O3/Geolocation_Fields/Longitude[]";
1810 register_longitude_variable(product_definition, path);
1811 path = "/HDFEOS/SWATHS/O3/Geolocation_Fields/Latitude[]";
1812 register_latitude_variable(product_definition, path);
1813
1814 /* pressure */
1815 path = "/HDFEOS/SWATHS/O3/Geolocation_Fields/Pressure[]";
1816 register_pressure_variable(product_definition, path);
1817
1818 /* O3_volume_mixing_ratio */
1819 description = "O3 volume mixing ratio";
1820 variable_definition =
1821 harp_ingestion_register_variable_full_read(product_definition, "O3_volume_mixing_ratio", harp_type_double, 2,
1822 dimension_type, NULL, description, "ppv", NULL, read_value);
1823 path = "/HDFEOS/SWATHS/O3/Data_Fields/L2gpValue[]";
1824 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1825
1826 /* O3_volume_mixing_ratio_uncertainty */
1827 description = "uncertainty of the O3 volume mixing ratio";
1828 variable_definition =
1829 harp_ingestion_register_variable_full_read(product_definition, "O3_volume_mixing_ratio_uncertainty",
1830 harp_type_double, 2, dimension_type, NULL, description, "ppv", NULL,
1831 read_error);
1832 path = "/HDFEOS/SWATHS/O3/Data_Fields/L2gpPrecision[]";
1833 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1834
1835 /* O3_volume_mixing_ratio_validity */
1836 description = "quality flag for the O3 volume mixing ratio";
1837 variable_definition =
1838 harp_ingestion_register_variable_full_read(product_definition, "O3_volume_mixing_ratio_validity",
1839 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1840 read_validity);
1841 path = "/HDFEOS/SWATHS/O3/Data_Fields/Status[], /HDFEOS/SWATHS/O3/Data_Fields/Quality[], "
1842 "/HDFEOS/SWATHS/O3/Data_Fields/Convergence[], /HDFEOS/SWATHS/O3/Data_Fields/L2gpPrecision[], "
1843 "/HDFEOS/SWATHS/O3/Geolocation_Fields/Pressure[]";
1844 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1845 }
1846
1847 static void register_oh_product(void)
1848 {
1849 harp_ingestion_module *module;
1850 harp_product_definition *product_definition;
1851 harp_variable_definition *variable_definition;
1852 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1853 const char *description;
1854 const char *path;
1855
1856 module = harp_ingestion_register_module("MLS_L2_OH", "MLS", "AURA_MLS", "ML2OH", "MLS OH profile",
1857 ingestion_init_oh, ingestion_done);
1858
1859 /* OH product */
1860 product_definition = harp_ingestion_register_product(module, "MLS_L2_OH", NULL, read_dimensions);
1861 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1862 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1863
1864 /* datetime */
1865 path = "/HDFEOS/SWATHS/OH/Geolocation_Fields/Time[]";
1866 register_datetime_variable(product_definition, path);
1867
1868 /* longitude and latitude */
1869 path = "/HDFEOS/SWATHS/OH/Geolocation_Fields/Longitude[]";
1870 register_longitude_variable(product_definition, path);
1871 path = "/HDFEOS/SWATHS/OH/Geolocation_Fields/Latitude[]";
1872 register_latitude_variable(product_definition, path);
1873
1874 /* pressure */
1875 path = "/HDFEOS/SWATHS/OH/Geolocation_Fields/Pressure[]";
1876 register_pressure_variable(product_definition, path);
1877
1878 /* OH_volume_mixing_ratio */
1879 description = "OH volume mixing ratio";
1880 variable_definition =
1881 harp_ingestion_register_variable_full_read(product_definition, "OH_volume_mixing_ratio", harp_type_double, 2,
1882 dimension_type, NULL, description, "ppv", NULL, read_value);
1883 path = "/HDFEOS/SWATHS/OH/Data_Fields/L2gpValue[]";
1884 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1885
1886 /* OH_volume_mixing_ratio_uncertainty */
1887 description = "uncertainty of the OH volume mixing ratio";
1888 variable_definition =
1889 harp_ingestion_register_variable_full_read(product_definition, "OH_volume_mixing_ratio_uncertainty",
1890 harp_type_double, 2, dimension_type, NULL, description, "ppv", NULL,
1891 read_error);
1892 path = "/HDFEOS/SWATHS/OH/Data_Fields/L2gpPrecision[]";
1893 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1894
1895 /* OH_volume_mixing_ratio_validity */
1896 description = "quality flag for the OH volume mixing ratio";
1897 variable_definition =
1898 harp_ingestion_register_variable_full_read(product_definition, "OH_volume_mixing_ratio_validity",
1899 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1900 read_validity);
1901 path = "/HDFEOS/SWATHS/OH/Data_Fields/Status[], /HDFEOS/SWATHS/OH/Data_Fields/Quality[], "
1902 "/HDFEOS/SWATHS/OH/Data_Fields/Convergence[], /HDFEOS/SWATHS/OH/Data_Fields/L2gpPrecision[], "
1903 "/HDFEOS/SWATHS/OH/Geolocation_Fields/Pressure[]";
1904 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1905 }
1906
1907 static void register_rhi_product(void)
1908 {
1909 harp_ingestion_module *module;
1910 harp_product_definition *product_definition;
1911 harp_variable_definition *variable_definition;
1912 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1913 const char *description;
1914 const char *path;
1915
1916 module = harp_ingestion_register_module("MLS_L2_RHI", "MLS", "AURA_MLS", "ML2RHI",
1917 "MLS relative humidity with respect to ice profile",
1918 ingestion_init_rhi, ingestion_done);
1919
1920 /* RHI product */
1921 product_definition = harp_ingestion_register_product(module, "MLS_L2_RHI", NULL, read_dimensions);
1922 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1923 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1924
1925 /* datetime */
1926 path = "/HDFEOS/SWATHS/RHI/Geolocation_Fields/Time[]";
1927 register_datetime_variable(product_definition, path);
1928
1929 /* longitude and latitude */
1930 path = "/HDFEOS/SWATHS/RHI/Geolocation_Fields/Longitude[]";
1931 register_longitude_variable(product_definition, path);
1932 path = "/HDFEOS/SWATHS/RHI/Geolocation_Fields/Latitude[]";
1933 register_latitude_variable(product_definition, path);
1934
1935 /* pressure */
1936 path = "/HDFEOS/SWATHS/RHI/Geolocation_Fields/Pressure[]";
1937 register_pressure_variable(product_definition, path);
1938
1939 /* relative_humidity_ice */
1940 description = "relative humidity with respect to ice";
1941 variable_definition =
1942 harp_ingestion_register_variable_full_read(product_definition, "relative_humidity_ice", harp_type_double, 2,
1943 dimension_type, NULL, description, "%", NULL, read_value);
1944 path = "/HDFEOS/SWATHS/RHI/Data_Fields/L2gpValue[]";
1945 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1946
1947 /* relative_humidity_ice_uncertainty */
1948 description = "uncertainty of the relative humidity with respect to ice";
1949 variable_definition =
1950 harp_ingestion_register_variable_full_read(product_definition, "relative_humidity_ice_uncertainty",
1951 harp_type_double, 2, dimension_type, NULL, description, "%", NULL,
1952 read_error);
1953 path = "/HDFEOS/SWATHS/RHI/Data_Fields/L2gpPrecision[]";
1954 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
1955
1956 /* relative_humidity_ice_validity */
1957 description = "quality flag for the relative humidity with respect to ice";
1958 variable_definition =
1959 harp_ingestion_register_variable_full_read(product_definition, "relative_humidity_ice_validity",
1960 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
1961 read_validity);
1962 path = "/HDFEOS/SWATHS/RHI/Data_Fields/Status[], /HDFEOS/SWATHS/RHI/Data_Fields/Quality[], "
1963 "/HDFEOS/SWATHS/RHI/Data_Fields/Convergence[], /HDFEOS/SWATHS/RHI/Data_Fields/L2gpPrecision[], "
1964 "/HDFEOS/SWATHS/RHI/Geolocation_Fields/Pressure[]";
1965 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
1966 }
1967
1968 static void register_so2_product(void)
1969 {
1970 harp_ingestion_module *module;
1971 harp_product_definition *product_definition;
1972 harp_variable_definition *variable_definition;
1973 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
1974 const char *description;
1975 const char *path;
1976
1977 module = harp_ingestion_register_module("MLS_L2_SO2", "MLS", "AURA_MLS", "ML2SO2", "MLS SO2 profile",
1978 ingestion_init_so2, ingestion_done);
1979
1980 /* SO2 product */
1981 product_definition = harp_ingestion_register_product(module, "MLS_L2_SO2", NULL, read_dimensions);
1982 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
1983 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
1984
1985 /* datetime */
1986 path = "/HDFEOS/SWATHS/SO2/Geolocation_Fields/Time[]";
1987 register_datetime_variable(product_definition, path);
1988
1989 /* longitude and latitude */
1990 path = "/HDFEOS/SWATHS/SO2/Geolocation_Fields/Longitude[]";
1991 register_longitude_variable(product_definition, path);
1992 path = "/HDFEOS/SWATHS/SO2/Geolocation_Fields/Latitude[]";
1993 register_latitude_variable(product_definition, path);
1994
1995 /* pressure */
1996 path = "/HDFEOS/SWATHS/SO2/Geolocation_Fields/Pressure[]";
1997 register_pressure_variable(product_definition, path);
1998
1999 /* SO2_volume_mixing_ratio */
2000 description = "SO2 volume mixing ratio";
2001 variable_definition =
2002 harp_ingestion_register_variable_full_read(product_definition, "SO2_volume_mixing_ratio", harp_type_double, 2,
2003 dimension_type, NULL, description, "ppv", NULL, read_value);
2004 path = "/HDFEOS/SWATHS/SO2/Data_Fields/L2gpValue[]";
2005 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
2006
2007 /* SO2_volume_mixing_ratio_uncertainty */
2008 description = "uncertainty of the SO2 volume mixing ratio";
2009 variable_definition =
2010 harp_ingestion_register_variable_full_read(product_definition, "SO2_volume_mixing_ratio_uncertainty",
2011 harp_type_double, 2, dimension_type, NULL, description, "ppv", NULL,
2012 read_error);
2013 path = "/HDFEOS/SWATHS/SO2/Data_Fields/L2gpPrecision[]";
2014 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
2015
2016 /* SO2_volume_mixing_ratio_validity */
2017 description = "quality flag for the SO2 volume mixing ratio";
2018 variable_definition =
2019 harp_ingestion_register_variable_full_read(product_definition, "SO2_volume_mixing_ratio_validity",
2020 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
2021 read_validity);
2022 path = "/HDFEOS/SWATHS/SO2/Data_Fields/Status[], /HDFEOS/SWATHS/SO2/Data_Fields/Quality[], "
2023 "/HDFEOS/SWATHS/SO2/Data_Fields/Convergence[], /HDFEOS/SWATHS/SO2/Data_Fields/L2gpPrecision[], "
2024 "/HDFEOS/SWATHS/SO2/Geolocation_Fields/Pressure[]";
2025 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
2026 }
2027
2028 static void register_t_product(void)
2029 {
2030 harp_ingestion_module *module;
2031 harp_product_definition *product_definition;
2032 harp_variable_definition *variable_definition;
2033 harp_dimension_type dimension_type[2] = { harp_dimension_time, harp_dimension_vertical };
2034 const char *description;
2035 const char *path;
2036
2037 module = harp_ingestion_register_module("MLS_L2_T", "MLS", "AURA_MLS", "ML2T", "MLS temperature profile",
2038 ingestion_init_t, ingestion_done);
2039
2040 /* T product */
2041 product_definition = harp_ingestion_register_product(module, "MLS_L2_T", NULL, read_dimensions);
2042 harp_product_definition_add_mapping(product_definition, quality_flag_description1, NULL);
2043 harp_product_definition_add_mapping(product_definition, quality_flag_description2, NULL);
2044
2045 /* datetime */
2046 path = "/HDFEOS/SWATHS/Temperature/Geolocation_Fields/Time[]";
2047 register_datetime_variable(product_definition, path);
2048
2049 /* longitude and latitude */
2050 path = "/HDFEOS/SWATHS/Temperature/Geolocation_Fields/Longitude[]";
2051 register_longitude_variable(product_definition, path);
2052 path = "/HDFEOS/SWATHS/Temperature/Geolocation_Fields/Latitude[]";
2053 register_latitude_variable(product_definition, path);
2054
2055 /* pressure */
2056 path = "/HDFEOS/SWATHS/Temperature/Geolocation_Fields/Pressure[]";
2057 register_pressure_variable(product_definition, path);
2058
2059 /* temperature */
2060 description = "temperature";
2061 variable_definition =
2062 harp_ingestion_register_variable_full_read(product_definition, "temperature", harp_type_double, 2,
2063 dimension_type, NULL, description, "K", NULL, read_value);
2064 path = "/HDFEOS/SWATHS/Temperature/Data_Fields/L2gpValue[]";
2065 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
2066
2067 /* temperature_uncertainty */
2068 description = "uncertainty of the temperature";
2069 variable_definition =
2070 harp_ingestion_register_variable_full_read(product_definition, "temperature_uncertainty", harp_type_double, 2,
2071 dimension_type, NULL, description, "K", NULL, read_error);
2072 path = "/HDFEOS/SWATHS/Temperature/Data_Fields/L2gpPrecision[]";
2073 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, NULL);
2074
2075 /* temperature_validity */
2076 description = "quality flag for the temperature";
2077 variable_definition =
2078 harp_ingestion_register_variable_full_read(product_definition, "temperature_validity",
2079 harp_type_int32, 2, dimension_type, NULL, description, NULL, NULL,
2080 read_validity);
2081 path = "/HDFEOS/SWATHS/Temperature/Data_Fields/Status[], /HDFEOS/SWATHS/Temperature/Data_Fields/Quality[], "
2082 "/HDFEOS/SWATHS/Temperature/Data_Fields/Convergence[], /HDFEOS/SWATHS/Temperature/Data_Fields/L2gpPrecision[], "
2083 "/HDFEOS/SWATHS/Temperature/Geolocation_Fields/Pressure[]";
2084 harp_variable_definition_add_mapping(variable_definition, NULL, NULL, path, "see generic mapping description");
2085 }
2086
2087 int harp_ingestion_module_mls_l2_init(void)
2088 {
2089 register_bro_product();
2090 register_ch3cl_product();
2091 register_ch3cn_product();
2092 register_ch3oh_product();
2093 register_clo_product();
2094 register_co_product();
2095 register_gph_product();
2096 register_h2o_product();
2097 register_hcl_product();
2098 register_hcn_product();
2099 register_hno3_product();
2100 register_ho2_product();
2101 register_hocl_product();
2102 register_iwc_product();
2103 register_n2o_product();
2104 register_o3_product();
2105 register_oh_product();
2106 register_rhi_product();
2107 register_so2_product();
2108 register_t_product();
2109
2110 return 0;
2111 }