forked from gmcgarragh/seviri_util
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinternal.h
115 lines (88 loc) · 3.38 KB
/
internal.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*******************************************************************************
*
* Copyright (C) 2014-2018 Greg McGarragh <mcgarragh@atm.ox.ac.uk>
* Copyright (C) 2018 Simon Proud <simon.proud@physics.ox.ac.uk>
*
* This source code is licensed under the GNU General Public License (GPL),
* Version 3. See the file COPYING for more details.
*
******************************************************************************/
#ifndef INTERNAL_H
#define INTERNAL_H
#include <errno.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "external.h"
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************************************************
* Configuration related
******************************************************************************/
#define VERBOSE 0
/*******************************************************************************
* Some mathematical constants
******************************************************************************/
#ifdef M_PI
#define PI M_PI
#else
#define PI 3.14159265358979323846264338327
#endif
#define D2R (PI / 180.0)
#define R2D (180.0 / PI)
/*******************************************************************************
* Some macros
******************************************************************************/
/* Min/Max macros */
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
/*******************************************************************************
* SEVIRI realated constants
******************************************************************************/
#define IMAGE_SIZE_VIR_LINES 3712
#define IMAGE_SIZE_VIR_COLUMNS 3712
#define IMAGE_SIZE_VIR_RSS_LINES 1392
#define IMAGE_SIZE_VIR_RSS_COLUMNS 3712
#define IMAGE_SIZE_HRV_LINES 11136
#define IMAGE_SIZE_HRV_COLUMNS 5568
/*******************************************************************************
* Fill values for various data types
******************************************************************************/
#define FILL_VALUE_US USHRT_MAX
#define FILL_VALUE_I INT_MAX
#define FILL_VALUE_F -999.
/*******************************************************************************
* Struct for scaling factors required to convert pixel corrdinates to
* projection coordinates.
******************************************************************************/
struct nav_scaling_factors {
double CFAC;
double LFAC;
double COFF;
double LOFF;
};
/*******************************************************************************
*
******************************************************************************/
extern const ushort satellite_ids[];
extern const ushort n_satellites;
extern const double channel_center_wavelength[];
extern const double band_solar_irradiance[][SEVIRI_N_BANDS];
extern const double bt_nu_c[][SEVIRI_N_BANDS];
extern const double bt_A[][SEVIRI_N_BANDS];
extern const double bt_B[][SEVIRI_N_BANDS];
extern const struct nav_scaling_factors nav_scaling_factors_vir;
extern const struct nav_scaling_factors nav_scaling_factors_hrv;
/*******************************************************************************
*
******************************************************************************/
#include "misc_util.h"
#include "nav_util.h"
#include "read_write.h"
#ifdef __cplusplus
}
#endif
#endif /* INTERNAL_H */