forked from gmcgarragh/seviri_util
-
Notifications
You must be signed in to change notification settings - Fork 0
/
preproc.h
84 lines (73 loc) · 4.04 KB
/
preproc.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
/*******************************************************************************
*
* Copyright (C) 2014-2018 Greg McGarragh <[email protected]>
* Copyright (C) 2018 Simon Proud <[email protected]>
*
* This source code is licensed under the GNU General Public License (GPL),
* Version 3. See the file COPYING for more details.
*
******************************************************************************/
#ifndef PREPROC_H
#define PREPROC_H
#include "external.h"
#include "read_write.h"
#ifdef __cplusplus
extern "C" {
#endif
/* The pre-processed SEVIRI data struct with supporting time, lat/lon and
geometry arrays and arrays of physical units. */
struct seviri_preproc_data {
int memory_alloc_d; /* non-zero if memory has been allocated */
uint n_bands; /* number of bands read in */
uint n_lines; /* number of lines read in */
uint n_columns; /* number of columns read in */
float fill_value; /* fill value of the image data */
/* the following image arrays are n_lines * n_columns */
double *time; /* image of Julian Day Number */
float *lat; /* image of latitude */
float *lon; /* image of longitude */
float *sza; /* image of solar zenith angle (degrees: 0.0 -- 180.0) */
float *saa; /* image of solar azimuth angle (degrees: 0.0 -- 360.0) */
float *vza; /* image of viewing zenith angle (degrees: 0.0 -- 180.0) */
float *vaa; /* image of viewing azimuth angle (degrees: 0.0 -- 360.0) */
float **data; /* array of pointers to images of length n_bands */
float *data2; /* array of image data of length n_bands * n_lines * n_columns */
};
int seviri_preproc(const struct seviri_data *d, struct seviri_preproc_data *d2,
const enum seviri_units *band_units, int rss, int do_gsics,
char satposstr[128], int do_not_alloc);
int seviri_read_and_preproc_nat(const char *filename,
struct seviri_preproc_data *preproc,
uint n_bands, const uint *band_ids,
const enum seviri_units *band_units,
enum seviri_bounds bounds,
uint line0, uint line1, uint column0, uint column1,
double lat0, double lat1, double lon0, double lon1,
int do_gsics, char satposstr[128], int do_not_alloc);
int seviri_read_and_preproc_hrit(const char *indir, const char *timeslot,
const int satnum,
struct seviri_preproc_data *preproc,
uint n_bands, const uint *band_ids,
const enum seviri_units *band_units,
enum seviri_bounds bounds,
uint line0, uint line1, uint column0, uint column1,
double lat0, double lat1, double lon0, double lon1,
int rss, int iodc, int do_gsics, char satposstr[128],
int do_not_alloc);
int seviri_read_and_preproc(const char *filename,
struct seviri_preproc_data *preproc,
uint n_bands, const uint *band_ids,
const enum seviri_units *band_units,
enum seviri_bounds bounds,
uint line0, uint line1, uint column0, uint column1,
double lat0, double lat1, double lon0, double lon1,
int do_gsics, char satposstr[128], int do_not_alloc);
int seviri_preproc_free(struct seviri_preproc_data *d);
int seviri_get_dimens(const char *filename, uint *i_line, uint *i_column,
uint *n_lines, uint *n_columns, enum seviri_bounds bounds,
uint line0, uint line1, uint column0, uint column1,
double lat0, double lat1, double lon0, double lon1);
#ifdef __cplusplus
}
#endif
#endif /* PREPROC_H */