JURASSIC
Functions
brightness.c File Reference

Convert radiance to brightness temperature. More...

#include "jurassic.h"

Go to the source code of this file.

Functions

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

Detailed Description

Convert radiance to brightness temperature.

Definition in file brightness.c.

Function Documentation

◆ main()

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

Definition at line 27 of file brightness.c.

29 {
30
31 /* Check arguments... */
32 if (argc != 3 && argc != 7)
33 ERRMSG
34 ("Give parameters: [ <rad> <nu> | "
35 " <rad0> <rad1> <drad> <nu0> <nu1> <dnu> ]");
36
37 /* Calculate single value... */
38 if (argc == 3) {
39
40 /* Read arguments... */
41 double rad = atof(argv[1]);
42 double nu = atof(argv[2]);
43
44 /* Compute brightness temperature... */
45 printf("%.10g\n", BRIGHT(rad, nu));
46
47 }
48
49 /* Calculate table... */
50 else if (argc == 7) {
51
52 /* Read arguments... */
53 double rad0 = atof(argv[1]);
54 double rad1 = atof(argv[2]);
55 double drad = atof(argv[3]);
56 double nu0 = atof(argv[4]);
57 double nu1 = atof(argv[5]);
58 double dnu = atof(argv[6]);
59
60 /* Write header... */
61 printf("# $1 = radiance [W/(m^2 sr cm^-1)]\n"
62 "# $2 = wavenumber [cm^-1]\n"
63 "# $3 = brightness temperature [K]\n");
64
65 /* Compute brightness temperature... */
66 for (double rad = rad0; rad <= rad1; rad += drad) {
67 printf("\n");
68 for (double nu = nu0; nu <= nu1; nu += dnu)
69 printf("%.10g %.4f %.10g\n", rad, nu, BRIGHT(rad, nu));
70 }
71 }
72
73 return EXIT_SUCCESS;
74}
#define BRIGHT(rad, nu)
Compute brightness temperature.
Definition: jurassic.h:126
#define ERRMSG(...)
Print error message and quit program.
Definition: jurassic.h:237