29 {
30
31
32 if (argc != 3 && argc != 7)
34 ("Give parameters: [ <t> <nu> | <t0> <t1> <dt> <nu0> <nu1> <dnu> ]");
35
36
37 if (argc == 3) {
38
39
40 double t = atof(argv[1]);
41 double nu = atof(argv[2]);
42
43
44 printf(
"%.10g\n",
PLANCK(t, nu));
45 }
46
47
48 else if (argc == 7) {
49
50
51 double t0 = atof(argv[1]);
52 double t1 = atof(argv[2]);
53 double dt = atof(argv[3]);
54 double nu0 = atof(argv[4]);
55 double nu1 = atof(argv[5]);
56 double dnu = atof(argv[6]);
57
58
59 printf("# $1 = brightness temperature [K]\n"
60 "# $2 = wavenumber [cm^-1]\n"
61 "# $3 = radiance [W/(m^2 sr cm^-1)]\n");
62
63
64 for (double t = t0; t <= t1; t += dt) {
65 printf("\n");
66 for (double nu = nu0; nu <= nu1; nu += dnu)
67 printf(
"%.10g %.4f %.10g\n", t, nu,
PLANCK(t, nu));
68 }
69 }
70
71 return EXIT_SUCCESS;
72}
#define ERRMSG(...)
Print error message and quit program.
#define PLANCK(T, nu)
Compute Planck function.