You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

122 line
4.3 KiB

  1. /*
  2. * aptdec - A lightweight FOSS (NOAA) APT decoder
  3. * Copyright (C) 2019-2023 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. // clang-format off
  21. const calibration_t calibration[3] = {
  22. {
  23. .name = "NOAA-15",
  24. .prt = {
  25. { 1.36328e-06f, 0.051045f, 276.60157f }, // PRT 1
  26. { 1.47266e-06f, 0.050909f, 276.62531f }, // PRT 2
  27. { 1.47656e-06f, 0.050907f, 276.67413f }, // PRT 3
  28. { 1.47656e-06f, 0.050966f, 276.59258f } // PRT 4
  29. },
  30. .visible = {
  31. {
  32. .low = { 0.0568f, -2.1874f },
  33. .high = { 0.1633f, -54.9928f },
  34. .cutoff = 496.0f
  35. }, {
  36. .low = { 0.0596f, -2.4096f },
  37. .high = { 0.1629f, -55.2436f },
  38. .cutoff = 511.0f
  39. }
  40. },
  41. .rad = {
  42. { 925.4075f, 0.337810f, 0.998719f }, // Channel 4
  43. { 839.8979f, 0.304558f, 0.999024f }, // Channel 5
  44. { 2695.9743f, 1.621256f, 0.998015f } // Channel 3B
  45. },
  46. .cor = {
  47. { -4.50f, { 0.0004524f, -0.0932f, 4.76f } }, // Channel 4
  48. { -3.61f, { 0.0002811f, -0.0659f, 3.83f } }, // Channel 5
  49. { 0.0f, { 0.0f, 0.0f , 0.0f } } // Channel 3B
  50. }
  51. }, {
  52. .name = "NOAA-18",
  53. .prt = {
  54. { 1.657e-06f, 0.05090f, 276.601f }, // PRT 1
  55. { 1.482e-06f, 0.05101f, 276.683f }, // PRT 2
  56. { 1.313e-06f, 0.05117f, 276.565f }, // PRT 3
  57. { 1.484e-06f, 0.05103f, 276.615f } // PRT 4
  58. },
  59. .visible = {
  60. {
  61. .low = { 0.06174f, -2.434f },
  62. .high = { 0.1841f, -63.31f },
  63. .cutoff = 501.54f
  64. }, {
  65. .low = { 0.07514f, -2.960f },
  66. .high = { 0.2254f, -78.55f },
  67. .cutoff = 500.40f
  68. }
  69. },
  70. .rad = {
  71. { 928.1460f, 0.436645f, 0.998607f }, // Channel 4
  72. { 833.2532f, 0.253179f, 0.999057f }, // Channel 5
  73. { 2659.7952f, 1.698704f, 0.996960f } // Channel 3B
  74. },
  75. .cor = {
  76. { -5.53f, { 0.00052337f, -0.11069f, 5.82f } }, // Channel 4
  77. { -2.22f, { 0.00017715f, -0.04360f, 2.67f } }, // Channel 5
  78. { 0.0f, { 0.0f, 0.0f, 0.0f } } // Channel 3B
  79. }
  80. }, {
  81. .name = "NOAA-19",
  82. .prt = {
  83. { 1.405783e-06f, 0.051111f, 276.6067f }, // PRT 1
  84. { 1.496037e-06f, 0.051090f, 276.6119f }, // PRT 2
  85. { 1.496990e-06f, 0.051033f, 276.6311f }, // PRT 3
  86. { 1.493110e-06f, 0.051058f, 276.6268f } // PRT 4
  87. },
  88. .visible = {
  89. {
  90. .low = { 0.05555f, -2.159f },
  91. .high = { 0.1639f, -56.33f },
  92. .cutoff = 496.43f
  93. }, {
  94. .low = { 0.06614f, -2.565f },
  95. .high = { 0.1970f, -68.01f },
  96. .cutoff = 500.37f
  97. }
  98. },
  99. .rad = {
  100. { 928.9f, 0.53959f, 0.998534f }, // Channel 4
  101. { 831.9f, 0.36064f, 0.998913f }, // Channel 5
  102. { 2670.0f, 1.67396f, 0.997364f } // Channel 3B
  103. },
  104. .cor = {
  105. { -5.49f, { 0.00054668f, -0.11187f, 5.70f } }, // Channel 4
  106. { -3.39f, { 0.00024985f, -0.05991f, 3.58f } }, // Channel 5
  107. { 0.0f, { 0.0f, 0.0f, 0.0f } } // Channel 3B
  108. }
  109. }
  110. };
  111. calibration_t get_calibration(aptdec_satellite_t satid) {
  112. switch (satid) {
  113. case NOAA15: return calibration[0];
  114. case NOAA18: return calibration[1];
  115. default: return calibration[2];
  116. }
  117. }