MISR Toolkit  1.5.1
MtkOrbitToPath.c
Go to the documentation of this file.
1 /*===========================================================================
2 = =
3 = MtkOrbitToPath =
4 = =
5 =============================================================================
6 
7  Jet Propulsion Laboratory
8  MISR
9  MISR Toolkit
10 
11  Copyright 2005, California Institute of Technology.
12  ALL RIGHTS RESERVED.
13  U.S. Government Sponsorship acknowledged.
14 
15 ============================================================================*/
16 
17 #include "MisrOrbitPath.h"
18 #include "MisrError.h"
19 
20 static const int orbit_path[1000] = {
21 0, 0, 0, 0, 159, 175, 191, 206, 222, 5, 21, /* 0 - 10 */
22  37, 53, 69, 85, 101, 116, 132, 148, 164, 180, /* 11 - 20 */
23  196, 212, 228, 11, 26, 42, 58, 74, 90, 106, /* 21 - 30 */
24  122, 138, 154, 0, 0, 0, 0, 0, 0, 0, /* 31 - 40 */
25  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 34 - 145 */
26  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* fill with zeros */
27  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
28  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
29  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
30  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
31  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
32  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
33  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
34  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 131 - 140 */
35  0, 0, 0, 0, 0, 32, 48, 64, 80, 95, /* 141 - 150 */
36  111, 127, 143, 159, 175, 191, 207, 223, 5, 21, /* 151 - 160 */
37  37, 53, 69, 85, 101, 117, 132, 148, 164, 180, /* 161 - 170 */
38  196, 212, 228, 11, 27, 42, 58, 74, 90, 106, /* 171 - 180 */
39  122, 138, 154, 170, 185, 201, 217, 233, 16, 32, /* 181 - 190 */
40  48, 64, 80, 95, 111, 127, 143, 159, 175, 191, /* 191 - 200 */
41  207, 223, 5, 21, 37, 53, 69, 85, 101, 117, /* 201 - 210 */
42  133, 148, 164, 180, 196, 212, 228, 11, 27, 43, /* 211 - 220 */
43  58, 74, 90, 106, 122, 138, 154, 170, 186, 201, /* 221 - 230 */
44  217, 233, 16, 32, 48, 64, 80, 95, 111, 127, /* 231 - 240 */
45  143, 159, 175, 191, 207, 223, 5, 21, 37, 53, /* 241 - 250 */
46  69, 85, 101, 117, 133, 148, 164, 180, 196, 212, /* 251 - 260 */
47  228, 11, 27, 43, 58, 74, 90, 106, 122, 138, /* 261 - 270 */
48  154, 170, 186, 201, 217, 233, 16, 32, 48, 64, /* 271 - 280 */
49  80, 96, 111, 127, 143, 159, 175, 191, 207, 223, /* 281 - 290 */
50  6, 21, 37, 53, 69, 85, 101, 117, 133, 148, /* 291 - 300 */
51  164, 180, 196, 212, 228, 11, 27, 43, 58, 74, /* 301 - 310 */
52  90, 106, 122, 138, 154, 170, 186, 201, 217, 233, /* 311 - 320 */
53  16, 32, 48, 64, 80, 96, 111, 127, 143, 159, /* 321 - 330 */
54  175, 191, 207, 223, 6, 21, 37, 53, 69, 85, /* 331 - 340 */
55  101, 117, 133, 149, 164, 180, 196, 212, 228, 11, /* 341 - 350 */
56  27, 43, 59, 74, 90, 106, 122, 138, 154, 170, /* 351 - 360 */
57  186, 202, 217, 233, 16, 32, 48, 64, 80, 96, /* 361 - 370 */
58  112, 127, 143, 159, 175, 191, 207, 223, 6, 22, /* 371 - 380 */
59  38, 53, 69, 85, 101, 117, 133, 149, 165, 181, /* 381 - 390 */
60  196, 212, 228, 11, 27, 43, 59, 75, 91, 106, /* 391 - 400 */
61  122, 138, 154, 170, 186, 202, 218, 1, 16, 32, /* 401 - 410 */
62  48, 64, 80, 96, 112, 128, 144, 159, 175, 191, /* 411 - 420 */
63  207, 223, 6, 22, 38, 54, 70, 85, 101, 117, /* 421 - 430 */
64  133, 149, 165, 181, 197, 213, 228, 11, 27, 43, /* 431 - 440 */
65  59, 75, 91, 107, 123, 138, 154, 170, 186, 202, /* 441 - 450 */
66  218, 1, 17, 33, 49, 64, 80, 96, 112, 128, /* 451 - 460 */
67  144, 160, 176, 192, 207, 223, 6, 22, 38, 54, /* 461 - 470 */
68  70, 86, 102, 117, 133, 149, 165, 181, 197, 213, /* 471 - 480 */
69  229, 12, 27, 43, 59, 75, 91, 107, 123, 139, /* 480 - 490 */
70  155, 171, 186, 202, 218, 1, 17, 33, 49, 65, /* 491 - 500 */
71  81, 96, 112, 128, 144, 160, 176, 192, 208, 224, /* 501 - 510 */
72  6, 22, 38, 54, 70, 86, 102, 118, 134, 149, /* 511 - 520 */
73  165, 181, 197, 213, 229, 12, 28, 44, 59, 75, /* 521 - 530 */
74  91, 107, 123, 139, 155, 171, 187, 203, 218, 1, /* 531 - 540 */
75  17, 33, 49, 65, 81, 97, 113, 128, 144, 0, /* 541 - 550 */
76  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 551 - 560 */
77  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 561 - 570 */
78  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 571 - 580 */
79  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 581 - 590 */
80  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 591 - 600 */
81  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 601 - 610 */
82  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 611 - 620 */
83  0, 0, 0, 0, 0, 0, 0, 0, 18, 34, /* 621 - 630 */
84  49, 65, 81, 0, 0, 129, 145, 161, 177, 192, /* 631 - 640 */
85  208, 224, 7, 23, 39, 55, 71, 87, 103, 118, /* 641 - 650 */
86  134, 150, 166, 182, 198, 0, 0, 0, 28, 44, /* 651 - 660 */
87  0, 76, 92, 108, 124, 140, 156, 171, 187, 203, /* 661 - 670 */
88  219, 2, 18, 34, 50, 66, 81, 97, 113, 129, /* 671 - 680 */
89  145, 161, 177, 193, 209, 225, 7, 23, 39, 55, /* 681 - 690 */
90  71, 87, 0, 0, 135, 150, 166, 182, 198, 214, /* 691 - 700 */
91  230 , 13, 29, 45, 61, 76, 92, 108, 124, 140, /* 701 - 710 */
92  156, 172, 188, 204, 219, 2, 18, 34, 50, 66, /* 711 - 720 */
93  82, 98, 114, 130, 145, 161, 177, 193, 209, 225, /* 721 - 730 */
94  8, 24, 40, 55, 71, 87, 103, 119, 135, 151, /* 731 - 740 */
95  167, 183, 199, 214, 230, 13, 29, 45, 61, 77, /* 741 - 750 */
96  93, 109, 124, 140, 156, 172, 188, 204, 220, 3, /* 751 - 760 */
97  19, 34, 50, 66, 82, 98, 114, 130, 146, 162, /* 761 - 770 */
98  178, 193, 209, 225, 8, 24, 40, 56, 72, 88, /* 771 - 780 */
99  103, 119, 135, 151, 167, 183, 199, 215, 231, 14, /* 781 - 790 */
100  29, 45, 61, 77, 93, 109, 125, 141, 157, 172, /* 791 - 800 */
101  188, 204, 220, 3, 19, 35, 51, 67, 83, 98, /* 801 - 810 */
102  114, 130, 146, 162, 178, 194, 210, 226, 9, 24, /* 811 - 820 */
103  40, 56, 72, 88, 104, 120, 136, 152, 168, 183, /* 821 - 830 */
104  199, 215, 231, 14, 30, 46, 62, 78, 94, 110, /* 831 - 840 */
105  125, 141, 157, 173, 189, 205, 221, 4, 20, 36, /* 841 - 850 */
106  52, 68, 83, 99, 115, 131, 147, 163, 179, 195, /* 851 - 860 */
107  211, 227, 10, 26, 41, 57, 73, 0, 105, 121, /* 861 - 870 */
108  137, 153, 169, 185, 201, 217, 233, 16, 31, 47, /* 871 - 880 */
109  63, 79, 95, 111, 127, 143, 159, 175, 191, 207, /* 881 - 890 */
110  223, 6, 22, 38, 54, 69, 85, 101, 117, 133, /* 891 - 900 */
111  149, 165, 181, 197, 213, 229, 12, 28, 44, 60, /* 901 - 910 */
112  76, 92, 108, 124, 139, 155, 171, 187, 203, 219, /* 911 - 920 */
113  2, 18, 34, 50, 66, 82, 98, 114, 130, 146, /* 921 - 930 */
114  162, 178, 194, 210, 226, 9, 25, 41, 57, 73, /* 931 - 940 */
115  89, 104, 120, 136, 152, 168, 184, 200, 216, 232, /* 941 - 950 */
116  15, 31, 47, 0, 79, 95, 111, 0, 143, 159, /* 951 - 960 */
117  175, 191, 207, 223, 6, 22, 38, 54, 70, 86, /* 961 - 970 */
118  102, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 971 - 980 */
119  0, 0, 61, 77, 93, 109, 125, 141, 157, 173, /* 981 - 990 */
120  189, 205, 221, 4, 20, 36, 52, 68, 84 /* 991 - 999 */
121 };
122 
136  int orbit,
137  int *path )
138 {
139  MTKt_status status_code; /* Return status of this function */
140  int first_path_num = 177; /* path number counted as first for
141  purposes of converting orbit to path */
142 
143  if (path == NULL)
145 
146  if (orbit < 4)
148 
149  if (orbit < 1000)
150  if (orbit_path[orbit] == 0)
151  return MTK_FAILURE;
152  else
153  *path = orbit_path[orbit];
154  else
155  *path = (first_path_num - 1 + orbit * 16) % 233 + 1;
156 
157  return MTK_SUCCESS;
158 
159 ERROR_HANDLE:
160  return status_code;
161 }
#define MTK_ERR_CODE_JUMP(code)
Definition: MisrError.h:175
MTKt_status MtkOrbitToPath(int orbit, int *path)
Given orbit number return path number.
static const int orbit_path[1000]
MTKt_status
Definition: MisrError.h:11

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:51