AIRS Code Collection
Functions
map_rad.c File Reference

Extract maps of radiance data. More...

#include "libairs.h"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

Extract maps of radiance data.

Definition in file map_rad.c.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 28 of file map_rad.c.

30 {
31
32 static airs_rad_gran_t airs_rad_gran;
33 static wave_t wave, wave2;
34
35 /* Check arguments... */
36 if (argc < 6)
37 ERRMSG("Give parameters: <ctl> <l1b_file1> <l1b_file2> <nu> <wave.tab>");
38
39 /* Get control parameters... */
40 const int bg_poly_x =
41 (int) scan_ctl(argc, argv, "BG_POLY_X", -1, "5", NULL);
42 const int bg_poly_y =
43 (int) scan_ctl(argc, argv, "BG_POLY_Y", -1, "0", NULL);
44 const int bg_smooth_x =
45 (int) scan_ctl(argc, argv, "BG_SMOOTH_X", -1, "0", NULL);
46 const int bg_smooth_y =
47 (int) scan_ctl(argc, argv, "BG_SMOOTH_Y", -1, "0", NULL);
48 const double gauss_fwhm = scan_ctl(argc, argv, "GAUSS_FWHM", -1, "0", NULL);
49 const double var_dh = scan_ctl(argc, argv, "VAR_DH", -1, "0", NULL);
50
51 /* Get channel.. */
52 double nu = atof(argv[4]);
53
54 /* Read AIRS data... */
55 printf("Read AIRS Level-1B data file: %s\n", argv[2]);
56 airs_rad_rdr(argv[2], &airs_rad_gran);
57
58 /* Convert radiance data to wave struct... */
59 rad2wave(&airs_rad_gran, &nu, 1, &wave);
60
61 /* Check if second file is available... */
62 if (argv[3][0] != '-') {
63
64 /* Read AIRS data... */
65 printf("Read AIRS Level-1B data file: %s\n", argv[3]);
66 airs_rad_rdr(argv[3], &airs_rad_gran);
67
68 /* Convert radiance data to wave struct... */
69 rad2wave(&airs_rad_gran, &nu, 1, &wave2);
70
71 /* Merge with first file... */
72 merge_y(&wave, &wave2);
73 }
74
75 /* Compute background... */
76 background_poly(&wave, bg_poly_x, bg_poly_y);
77 background_smooth(&wave, bg_smooth_x, bg_smooth_y);
78
79 /* Gaussian filter... */
80 gauss(&wave, gauss_fwhm);
81
82 /* Compute variance... */
83 variance(&wave, var_dh);
84
85 /* Write files... */
86 write_wave(argv[5], &wave);
87
88 return EXIT_SUCCESS;
89}
double scan_ctl(int argc, char *argv[], const char *varname, int arridx, const char *defvalue, char *value)
Search control parameter file for variable entry.
Definition: jurassic.c:5114
#define ERRMSG(...)
Print error message and quit program.
Definition: jurassic.h:237
void merge_y(wave_t *wave1, wave_t *wave2)
Merge wave structs in y-direction.
Definition: libairs.c:765
void background_smooth(wave_t *wave, int npts_x, int npts_y)
Smooth background.
Definition: libairs.c:176
void rad2wave(airs_rad_gran_t *gran, double *nu, int nd, wave_t *wave)
Convert AIRS radiance data to wave analysis struct.
Definition: libairs.c:1461
void background_poly(wave_t *wave, int dim_x, int dim_y)
Get background based on polynomial fits.
Definition: libairs.c:126
void variance(wave_t *wave, double dh)
Compute local variance.
Definition: libairs.c:1584
void gauss(wave_t *wave, double fwhm)
Apply Gaussian filter to perturbations...
Definition: libairs.c:579
void write_wave(char *filename, wave_t *wave)
Write wave analysis data.
Definition: libairs.c:1741
Wave analysis data.
Definition: libairs.h:287
Here is the call graph for this function: