Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

calibration.c 6.1 KiB

2 anos atrás
2 anos atrás
2 anos atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * aptdec - A lightweight FOSS (NOAA) APT decoder
  3. * Copyright (C) 2019-2022 Xerbo (xerbo@protonmail.com)
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. #include "calibration.h"
  19. #include "util.h"
  20. const calibration_t calibration[3] = {{.name = "NOAA-15",
  21. .prt =
  22. {
  23. {1.36328e-06f, 0.051045f, 276.60157f}, // PRT 1
  24. {1.47266e-06f, 0.050909f, 276.62531f}, // PRT 2
  25. {1.47656e-06f, 0.050907f, 276.67413f}, // PRT 3
  26. {1.47656e-06f, 0.050966f, 276.59258f} // PRT 4
  27. },
  28. .visible = {{.low = {0.0568f, -2.1874f}, .high = {0.1633f, -54.9928f}, .cutoff = 496.0f},
  29. {.low = {0.0596f, -2.4096f}, .high = {0.1629f, -55.2436f}, .cutoff = 511.0f}},
  30. .rad =
  31. {
  32. {925.4075f, 0.337810f, 0.998719f}, // Channel 4
  33. {839.8979f, 0.304558f, 0.999024f}, // Channel 5
  34. {2695.9743f, 1.621256f, 0.998015f} // Channel 3B
  35. },
  36. .cor =
  37. {
  38. {-4.50f, {0.0004524f, -0.0932f, 4.76f}}, // Channel 4
  39. {-3.61f, {0.0002811f, -0.0659f, 3.83f}}, // Channel 5
  40. {0.0f, {0.0f, 0.0f, 0.0f}} // Channel 3B
  41. }},
  42. {.name = "NOAA-18",
  43. .prt =
  44. {
  45. {1.657e-06f, 0.05090f, 276.601f}, // PRT 1
  46. {1.482e-06f, 0.05101f, 276.683f}, // PRT 2
  47. {1.313e-06f, 0.05117f, 276.565f}, // PRT 3
  48. {1.484e-06f, 0.05103f, 276.615f} // PRT 4
  49. },
  50. .visible = {{.low = {0.06174f, -2.434f}, .high = {0.1841f, -63.31f}, .cutoff = 501.54f},
  51. {.low = {0.07514f, -2.960f}, .high = {0.2254f, -78.55f}, .cutoff = 500.40f}},
  52. .rad =
  53. {
  54. {928.1460f, 0.436645f, 0.998607f}, // Channel 4
  55. {833.2532f, 0.253179f, 0.999057f}, // Channel 5
  56. {2659.7952f, 1.698704f, 0.996960f} // Channel 3B
  57. },
  58. .cor =
  59. {
  60. {-5.53f, {0.00052337f, -0.11069f, 5.82f}}, // Channel 4
  61. {-2.22f, {0.00017715f, -0.04360f, 2.67f}}, // Channel 5
  62. {0.0f, {0.0f, 0.0f, 0.0f}} // Channel 3B
  63. }},
  64. {.name = "NOAA-19",
  65. .prt =
  66. {
  67. {1.405783e-06f, 0.051111f, 276.6067f}, // PRT 1
  68. {1.496037e-06f, 0.051090f, 276.6119f}, // PRT 2
  69. {1.496990e-06f, 0.051033f, 276.6311f}, // PRT 3
  70. {1.493110e-06f, 0.051058f, 276.6268f} // PRT 4
  71. },
  72. .visible = {{.low = {0.05555f, -2.159f}, .high = {0.1639f, -56.33f}, .cutoff = 496.43f},
  73. {.low = {0.06614f, -2.565f}, .high = {0.1970f, -68.01f}, .cutoff = 500.37f}},
  74. .rad =
  75. {
  76. {928.9f, 0.53959f, 0.998534f}, // Channel 4
  77. {831.9f, 0.36064f, 0.998913f}, // Channel 5
  78. {2670.0f, 1.67396f, 0.997364f} // Channel 3B
  79. },
  80. .cor = {
  81. {-5.49f, {0.00054668f, -0.11187f, 5.70f}}, // Channel 4
  82. {-3.39f, {0.00024985f, -0.05991f, 3.58f}}, // Channel 5
  83. {0.0f, {0.0f, 0.0f, 0.0f}} // Channel 3B
  84. }}};
  85. calibration_t get_calibration(int satid) {
  86. switch (satid) {
  87. case 15:
  88. return calibration[0];
  89. case 18:
  90. return calibration[1];
  91. case 19:
  92. return calibration[2];
  93. default:
  94. error("Invalid satid in get_calibration()"); /* following is only to shut up the compiler */
  95. return calibration[0];
  96. }
  97. }