OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
fixrgb.c
Go to the documentation of this file.
1 #include <stdio.h>
2 
3 /*
4  This routine zeros any pixels with zero values in ANY of the RGB pnm file.
5  It removes the blue/pink stripes that can occur in the SEAWIFS TC images.
6  */
7 
8 int main(int argc, char *argv[]) {
9  unsigned char c[3];
10  unsigned char zero = 0;
11  FILE * fp[3];
12  int n, m;
13 
14  fp[0] = fopen(argv[1], "rb+");
15  n = 0;
16  m = 0;
17  while (1) {
18  fread(&c[0], 1, 1, fp[0]);
19  m++;
20  if (c[0] == 0x0a) n++;
21  if (n == 4) break;
22  }
23 
24  fp[1] = fopen(argv[2], "rb+");
25  fseek(fp[1], m, SEEK_SET);
26 
27  fp[2] = fopen(argv[3], "rb+");
28  fseek(fp[2], m, SEEK_SET);
29 
30  while (1) {
31  fread(&c[0], 1, 1, fp[0]);
32  if (feof(fp[0]) != 0) break;
33  fread(&c[1], 1, 1, fp[1]);
34  fread(&c[2], 1, 1, fp[2]);
35 
36  if (c[0] == 0 && c[1] == 0 && c[2] == 0) continue;
37 
38  if (c[0] == 0 || c[1] == 0 || c[2] == 0) {
39  fseek(fp[0], -1, SEEK_CUR);
40  fseek(fp[1], -1, SEEK_CUR);
41  fseek(fp[2], -1, SEEK_CUR);
42 
43  fwrite(&zero, 1, 1, fp[0]);
44  fwrite(&zero, 1, 1, fp[1]);
45  fwrite(&zero, 1, 1, fp[2]);
46  }
47  }
48 
49  fclose(fp[0]);
50  fclose(fp[1]);
51  fclose(fp[2]);
52 
53  return 0;
54 }
int main(int argc, char *argv[])
Definition: fixrgb.c:8
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed as required for compatibility with version of the SDP toolkit Corrected test output file names to end in per delivery and then split off a new MYD_PR03 pcf file for Aqua Added AssociatedPlatformInstrumentSensor to the inventory metadata in MOD01 mcf and MOD03 mcf Created new versions named MYD01 mcf and MYD03 where AssociatedPlatformShortName is rather than Terra The program itself has been changed to read the Satellite Instrument validate it against the input L1A and LUT and to use it determine the correct files to retrieve the ephemeris and attitude data from Changed to produce a LocalGranuleID starting with MYD03 if run on Aqua data Added the Scan Type file attribute to the Geolocation copied from the L1A and attitude_angels to radians rather than degrees The accumulation of Cumulated gflags was moved from GEO_validate_earth_location c to GEO_locate_one_scan c
Definition: HISTORY.txt:464