-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharea.c
989 lines (936 loc) · 28.8 KB
/
charea.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
/* 5/23/2022 I went through the McIDAS sensor list and added several more sensors that have been added --DPR */
/* 8/09/2018 Noticed new entries for GOES-17-GOES19 and NOAA20-NOAA23 so I added those --DPR */
/* 2/15/2018 FIrst found a typoe for meteosat-11 then I changed it to met11 to be in line with our other met data */
/* 2/13/2018 fixed transpostion of himawari-9 and himawaricast8 which was also mislabeled as "himawaricast" */
/* 2/8/2018 added goes-16-l2 products and found trmm wasn't listed -DPR */
/* 2/2/208 added himawari-9, and himawaricast9 */
/* 9/12/2016 added insat3d-img, insat3d-snd, landsat1-8,and himawaricast8*/
/* 6/5/2015 changed mtsat-3 to himawari-8 */
/* 9/19/2013 updated Sensor Table (saSensorTab) with
more sats */
/* 6/22/2006 updated the Sensor Table (saSensorTab) with
a whole slew of new sats */
/* 10/31/2001 re-added some code to check for little endian
stuff that somehow got removed over the ages. --dpr */
/* 5/30/2001 made a change to check for more then 32 bands
if iAreaDir[2] is greater than or equal to 101, which
is terra and above --dpr */
/*Probably around version 4.0 added more modis support
and changed output if charea itself is just run with no file
to usage 5/16/2001 */
/*charea.c reads the areadir of AREA format files and echos
back a name in a sensor_band_ccyy_jday_time format. Supports
gregorian dates with the -g flag and returns name of month with
-m flag */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define BAND1 1
#define BAND2 2
#define BAND3 3
#define BAND4 4
#define BAND5 5
#define BAND6 6
#define BAND7 7
#define BAND8 8
#define BAND9 9
#define BAND10 10
#define BAND11 11
#define BAND12 12
#define BAND13 13
#define BAND14 14
#define BAND15 15
#define BAND16 16
#define BAND17 17
#define BAND18 18
#define BAND19 19
#define BAND20 20
#define BAND21 21
#define BAND22 22
#define BAND23 23
#define BAND24 24
#define BAND25 25
#define BAND26 26
#define BAND27 27
#define BAND28 28
#define BAND29 29
#define BAND30 30
#define BAND31 31
#define BAND32 32
#define BAND33 1
#define BAND34 2
#define BAND35 3
#define BAND36 4
#define BAND37 5
#define BAND38 6
static int iaGregDayTab[2][13] =
{
{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
{0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
};
static int iaJulDayTab[2][13] =
{
{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365},
{0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366}
};
static char *saMonthName[] =
{
"Illegal month",
"jan", "feb", "mar",
"apr", "may", "jun",
"jul", "aug", "sep",
"oct", "nov", "dec"
};
int get_year(int jday);
int get_jday(int jday);
int cmp_bits(unsigned long iBands);
int cmp_bits2(unsigned long iBands);
int get_month( int jday, int iLeap);
int get_greg(int jday, int iLeap);
int swap_int_4(int *);
static char *saSensorTab[]=
{
/*0-5 */ "Derived_Data", "Test_Pattern", "graphics", "Misc", "PDUS_MET_VIS", "PDUS_MET_IR",
/*6-11 */ "PDUS_MET_WV", "Radar", "Misc_Aircraft", "Raw_MET", "composite", "blank",
/*12-17 */ "GMS_VIS", "GMS_IR", "ATS6-VIS", "ATS6-IR", "sms1-vis", "sms1-ir",
/*18-23 */ "sms2-vis", "sms2-ir", "goes1-vis", "goes1-ir", "goes2-vis", "goes2-ir",
/*24-29 */ "goes3-vis", "goes3-ir", "goes4-vis", "goes4-ir", "goes5-vis", "goes5-ir",
/*30-35 */ "goes6-vis", "goes6-ir", "goes7-vis", "goes7-ir", "fy-2b", "fy-2c",
/*36-41 */ "fy-2d", "fy-2e", "fy-2f", "fy-2g", "fy-2h", "tirosn",
/*42-47 */ "noaa6", "noaa7", "noaa8", "noaa9", "venus", "voyager1",
/*48-53 */ "voyager2", "galileo", "hubble", "met8", "met9", "met10",
/*54-59 */ "met3", "met4", "met5", "met6", "met7", "blank",
/*60-65 */ "noaa10", "noaa11", "noaa12", "noaa13", "noaa14", "noaa15",
/*66-71 */ "noaa16", "noaa17", "noaa18", "noaa19", "goes8", "goes8sndr",
/*72-77 */ "goes9", "goes9sndr", "goes10", "goes10sndr", "goes11", "goes11sndr",
/*78-83 */ "goes12", "goes12sndr", "erbe", "blank", "gms4", "gms5",
/*84-89 */ "mtsat-1r", "mtsat-2", "himawari-8", "dmspf8", "dmspf9", "dmspf10",
/*90-95 */ "dmspf11", "dmspf12", "dmspf13", "dmspf14", "dmspf15", "fy1b",
/*96-101 */ "fy1c", "fy1d", "blank", "blank", "blank", "terra",
/*102-107*/ "terra-cld", "terra-geo", "terra-aer", "blank", "terra-top", "terra-atm",
/*108-113*/ "terra-gus", "terra-ret", "blank", "aqua", "aqua-cld", "aqua-geo",
/*114-119*/ "aqua-aer", "blank", "aqua-top", "aqua-atm", "aqua-gus", "aqua-ret",
/*120-125*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*126-131*/ "blank", "blank", "terra-sst", "terra-lst", "blank", "blank",
/*132-137*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*138-143*/ "aqua-sst", "aqua-lst", "blank", "blank", "blank", "blank",
/*144-149*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*150-155*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*156-161*/ "blank", "blank", "blank", "blank", "terra-ndvi", "terra-cref",
/*162-167*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*168-173*/ "blank", "blank", "aqua-ndvi", "aqua-cref", "blank", "blank",
/*174-179*/ "ewsg1", "ewsg1sndr", "ewsg2", "ewsg2sndr", "ewsg3", "ewsg3sndr",
/*180-185*/ "goes13", "goes13sndr", "goes14", "goes14sndr", "goes15", "goes15sndr",
/*186-191*/ "goes16", "goes16-l2", "goes17", "goes17-l2", "goes18", "goes18-l2",
/*192-197*/ "goes19", "goes19-l2", "blank", "dmsp_f16", "dmsp_f17", "blank",
/*198-203*/ "blank", "blank", "airs-l1b", "blank", "blank", "blank",
/*204-209*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*210-215*/ "amsre-l1b", "amsre-rain", "blank", "blank", "blank", "blank",
/*216-221*/ "amsu_a-lwp", "blank", "blank", "blank", "trmm", "gms1",
/*222-227*/ "gms2", "gms3", "blank", "blank", "blank", "blank",
/*228-233*/ "blank", "blank", "kalpana1", "insat3d-img","insat3d-snd", "blank",
/*234-239*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*240-245*/ "metopa", "metopb", "metopc", "blank", "blank", "blank",
/*246-251*/ "blank", "blank", "blank", "blank", "coms1", "blank",
/*252-257*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*258-263*/ "blank", "blank", "blank", "landsat1", "landsat2", "landsat3",
/*264-269*/ "landsat4", "landsat5", "landsat6", "landsat7", "landsat8", "blank",
/*270-275*/ "blank", "blank", "blank", "blank", "blank", "fy3a",
/*276-281*/ "fy3b", "fy3c", "blank", "blank", "blank", "blank",
/*282-287*/ "blank", "blank", "blank", "blank", "himawaricast8","himawari-9",
/*288-293*/ "himawaricast9","himawaricast8/9","blank", "blank", "blank", "blank",
/*294-299*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*300-305*/ "npp-viirs", "noaa20", "noaa21", "noaa22", "noaa23", "blank",
/*306-311*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*312-317*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*318-223*/ "blank", "blank", "snppsdr", "noaa20sdr", "noaa21sdr", "noaa22sdr",
/*324-329*/ "noaa23sdr", "snppedr", "noaa20edr", "noaa21edr", "noaa22edr", "noaa23edr",
/*330-335*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*336-341*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*342-347*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*348-353*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*354-359*/ "met11", "blank", "blank", "blank", "blank", "blank",
/*360-365*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*366-371*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*372-377*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*378-383*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*384-389*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*390-395*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*396-401*/ "blank", "blank", "blank", "blank", "s_pole_comp", "n_pole_comp",
/*402-407*/ "blank", "blank", "blank", "blank", "blank", "blank",
/*408-413*/ "blank", "blank", "megha-tropic", "blank", "blank", "blank",
};
static char *saBitMap[]=
{
"0", "1", "2", "12", "3", "13", "23", "123", "4", "14", "24", "124","34", "134", "234", "1234", "5",
"15", "25", "125", "35", "135", "235", "1235", "45", "145", "245", "1245","345", "1345", "2345", "12345"
};
char sBands[80]="-";
int iMultiBand=0;
int iModisFlag=0;
int main (int argc, char *argv[])
{
FILE *fp_in;
int iAreaDir[64];
int i=0;
char sErrorOut[80];
char cToken;
int iYear, iJday, iTime, iBand, iTotalArgs, iMonth=0;
int iLeap, iGreg=0;
static char sSndr[]="sndr";
while (--argc > 0 && (*++argv)[0] == '-')
{
while ( cToken = *++argv[0])
{
switch (cToken)
{
case 'm':
iMonth=1;
break;
case 'g':
iGreg=1;
break;
default:
printf("\nusage:charea [-mg] AREA0001\n");
exit(2);
break;
}
}
}
if (( fp_in = fopen (argv[0], "r")) == NULL)
{
printf("\nusage:charea [-mg] AREA0001\n");
exit(1);
}
fread(iAreaDir, sizeof(int), 64, fp_in);
if ( iAreaDir[1] != 4 ) /*Test to see if bits are flipped */
{
for( i=0;i<64;++i)
{
swap_int_4(&iAreaDir[i]);
}
}
iYear=(get_year(iAreaDir[3]));
iJday=( iAreaDir[3] % 1000);
iTime=( iAreaDir[4] / 100);
iLeap= iYear%4 == 0 && iYear%100 !=0 || iYear%400 == 0;
if(strstr(saSensorTab[iAreaDir[2]],sSndr) != NULL)
{
if (( iMonth == 1 ) && ( iGreg == 0 ))
{
printf("%s_%s_%04d_%03d_%04d",saSensorTab[iAreaDir[2]],saMonthName[get_month(iJday,iLeap)],iYear,iJday,iTime);
}
else if (( iGreg == 1 ) && ( iMonth == 0 ))
{
printf("%s_%04d_%02d_%02d_%04d",saSensorTab[iAreaDir[2]],iYear,get_month(iJday,iLeap),get_greg(iJday,iLeap),
iTime);
}
else if (( iGreg == 1 ) && ( iMonth == 1 ))
{
printf("%s_%s_%04d_%02d_%02d_%04d",saSensorTab[iAreaDir[2]],saMonthName[get_month(iJday,iLeap)],
iYear,get_month(iJday,iLeap),get_greg(iJday,iLeap),iTime);
}
else
{
printf("%s_%04d_%03d_%04d",saSensorTab[iAreaDir[2]],iYear,iJday,iTime);
}
}
else
{
if((iAreaDir[2] >= 101) && (iAreaDir[2] <= 138))
{
iModisFlag=1;
}
cmp_bits(iAreaDir[18]);
if ((iAreaDir[19] != 0) && ( iModisFlag == 1 ))
{
cmp_bits2(iAreaDir[19]);
}
if(( iMonth == 1 ) && ( iGreg == 0 ))
{
printf("%s_%s_%s_%04d_%03d_%04d",saSensorTab[iAreaDir[2]],saMonthName[get_month(iJday,iLeap)],sBands,iYear,
iJday,iTime);
}
else if (( iGreg == 1 ) && ( iMonth == 0 ))
{
printf("%s_%s_%04d_%02d_%02d_%04d",saSensorTab[iAreaDir[2]],sBands,iYear,get_month(iJday,iLeap),
get_greg(iJday,iLeap),iTime);
}
else if (( iGreg == 1 ) && ( iMonth == 1 ))
{
printf("%s_%s_%s_%04d_%02d_%02d_%04d",saSensorTab[iAreaDir[2]],saMonthName[get_month(iJday,iLeap)],
sBands,iYear,get_month(iJday,iLeap),get_greg(iJday,iLeap),iTime);
}
else
{
printf("%s_%s_%04d_%03d_%04d",saSensorTab[iAreaDir[2]],sBands,iYear,iJday,iTime);
}
}
/* printf("\n%s",sBands); */
printf("\n");
return(0);
}
int get_month(int jday,int leap)
{
int count=0;
for( count=0; count <=12; ++count)
{
if ( jday > iaJulDayTab[leap][count] && jday <= iaJulDayTab[leap][count + 1])
{
return(count + 1 );
}
}
}
int get_year(int jday)
{
int iYear, ccyy;
iYear=jday / 1000;
if(iYear >= 100)
{
return ((iYear % 100) + 2000);
}
else
{
return(1900 + iYear);
}
}
int get_greg(int jday, int iLeap)
{
int i;
int date;
for(i=0; i <= 12; ++i)
{
if (( jday > iaJulDayTab[iLeap][i] ) && ( jday <= iaJulDayTab[iLeap][i+1]))
{
date=jday - iaJulDayTab[iLeap][i];
}
}
return(date);
}
int swap_int_4(int *tni4) /* 4 byte signed integers */
{
*tni4=(((*tni4>>24)&0xff) | ((*tni4&0xff)<<24) |
((*tni4>>8)&0xff00) | ((*tni4&0xff00)<<8));
}
cmp_bits2(unsigned long iBands)
{
int i=0,y=0;
unsigned long mask =0x00000001;
char sSort[80];
for (i=1;i<7;++i)
{
if (mask & iBands)
{
switch(i)
{
case BAND33:
{
if (iMultiBand > 0 )
{
strcat(sBands,"33");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"33");
++iMultiBand;
break;
}
}
case BAND34:
{
if (iMultiBand > 0 )
{
strcat(sBands,"34");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"34");
++iMultiBand;
break;
}
}
case BAND35:
{
if (iMultiBand > 0 )
{
strcat(sBands,"35");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"35");
++iMultiBand;
break;
}
}
case BAND36:
{
if (iMultiBand > 0 )
{
strcat(sBands,"36");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"36");
++iMultiBand;
break;
}
}
case BAND37:
{
if (iMultiBand > 0 )
{
strcat(sBands,"37");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"37");
++iMultiBand;
break;
}
}
case BAND38:
{
if (iMultiBand > 0 )
{
strcat(sBands,"38");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"38");
++iMultiBand;
break;
}
}
default:
{
continue;
}
} /*switch*/
} /*if*/
/*DEBUG: where 'corrupt' was created */
if(iModisFlag > 0 && iMultiBand == 38 )
{
strcpy(sBands,"all");
return;
}
mask <<=1;
} /*for*/
}
cmp_bits(unsigned long iBands)
{
int i=0,y=0;
unsigned long mask =0x00000001;
char sSort[80];
for (i=1;i<39;++i)
{
if (mask & iBands)
{
switch(i)
{
case BAND1:
{
if (iMultiBand > 0 )
{
strcat(sBands,"1");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"1");
++iMultiBand;
break;
}
}
case BAND2:
{
if (iMultiBand > 0 )
{
strcat(sBands,"2");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"2");
++iMultiBand;
break;
}
}
case BAND3:
{
if (iMultiBand > 0 )
{
strcat(sBands,"3");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"3");
++iMultiBand;
break;
}
}
case BAND4:
{
if (iMultiBand > 0 )
{
strcat(sBands,"4");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"4");
++iMultiBand;
break;
}
}
case BAND5:
{
if (iMultiBand > 0 )
{
strcat(sBands,"5");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"5");
++iMultiBand;
break;
}
}
case BAND6:
{
if (iMultiBand > 0 )
{
strcat(sBands,"6");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"6");
++iMultiBand;
break;
}
}
case BAND7:
{
if (iMultiBand > 0 )
{
strcat(sBands,"7");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"7");
++iMultiBand;
break;
}
}
case BAND8:
{
if (iMultiBand > 0 )
{
strcat(sBands,"8");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"8");
++iMultiBand;
break;
}
}
case BAND9:
{
if (iMultiBand > 0 )
{
strcat(sBands,"9");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"9");
++iMultiBand;
break;
}
}
case BAND10:
{
if (iMultiBand > 0 )
{
strcat(sBands,"10");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"10");
++iMultiBand;
break;
}
}
case BAND11:
{
if (iMultiBand > 0 )
{
strcat(sBands,"11");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"11");
++iMultiBand;
break;
}
}
case BAND12:
{
if (iMultiBand > 0 )
{
strcat(sBands,"12");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"12");
++iMultiBand;
break;
}
}
case BAND13:
{
if (iMultiBand > 0 )
{
strcat(sBands,"13");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"13");
++iMultiBand;
break;
}
}
case BAND14:
{
if (iMultiBand > 0 )
{
strcat(sBands,"14");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"14");
++iMultiBand;
break;
}
}
case BAND15:
{
if (iMultiBand > 0 )
{
strcat(sBands,"15");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"15");
++iMultiBand;
break;
}
}
case BAND16:
{
if (iMultiBand > 0 )
{
strcat(sBands,"16");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"16");
++iMultiBand;
break;
}
}
case BAND17:
{
if (iMultiBand > 0 )
{
strcat(sBands,"17");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"17");
++iMultiBand;
break;
}
}
case BAND18:
{
if (iMultiBand > 0 )
{
strcat(sBands,"18");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"18");
++iMultiBand;
break;
}
}
case BAND19:
{
if (iMultiBand > 0 )
{
strcat(sBands,"19");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"19");
++iMultiBand;
break;
}
}
case BAND20:
{
if (iMultiBand > 0 )
{
strcat(sBands,"20");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"20");
++iMultiBand;
break;
}
}
case BAND21:
{
if (iMultiBand > 0 )
{
strcat(sBands,"21");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"21");
++iMultiBand;
break;
}
}
case BAND22:
{
if (iMultiBand > 0 )
{
strcat(sBands,"22");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"22");
++iMultiBand;
break;
}
}
case BAND23:
{
if (iMultiBand > 0 )
{
strcat(sBands,"23");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"23");
++iMultiBand;
break;
}
}
case BAND24:
{
if (iMultiBand > 0 )
{
strcat(sBands,"24");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"24");
++iMultiBand;
break;
}
}
case BAND25:
{
if (iMultiBand > 0 )
{
strcat(sBands,"25");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"25");
++iMultiBand;
break;
}
}
case BAND26:
{
if (iMultiBand > 0 )
{
strcat(sBands,"26");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"26");
++iMultiBand;
break;
}
}
case BAND27:
{
if (iMultiBand > 0 )
{
strcat(sBands,"27");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"27");
++iMultiBand;
break;
}
}
case BAND28:
{
if (iMultiBand > 0 )
{
strcat(sBands,"28");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"28");
++iMultiBand;
break;
}
}
case BAND29:
{
if (iMultiBand > 0 )
{
strcat(sBands,"29");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"29");
++iMultiBand;
break;
}
}
case BAND30:
{
if (iMultiBand > 0 )
{
strcat(sBands,"30");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"30");
++iMultiBand;
break;
}
}
case BAND31:
{
if (iMultiBand > 0 )
{
strcat(sBands,"31");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"31");
++iMultiBand;
break;
}
}
case BAND32:
{
if (iMultiBand > 0 )
{
strcat(sBands,"32");
++iMultiBand;
break;
}
else
{
strcpy(sBands,"32");
++iMultiBand;
break;
}
}
default:
{
continue;
}
} /*switch*/
} /*if*/
/*DEBUG: Where corrupt was put in string */
if(iModisFlag > 0 && iMultiBand == 38)
{
strcpy(sBands,"all");
return;
}
mask <<=1;
} /*for*/
}