Skip to content

Commit

Permalink
Removed all references in meas_meta_setup to dateline
Browse files Browse the repository at this point in the history
The projections we use always expect longitudes in the range of
-180 to 180 so there is no need for a dateline test
  • Loading branch information
mollyhardman committed Aug 13, 2024
1 parent 6d19843 commit 4310db6
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions src/prod/meas_meta_setup/meas_meta_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ typedef struct { /* BYU region information storage */
int sav_ipolar[NSAVE];
int sav_ibeam[NSAVE], sav_regnum[NSAVE];
char sav_regname[NSAVE][11], sav_fname2[NSAVE][180];
int sav_dateline[NSAVE],sav_ascdes[NSAVE];
int sav_ascdes[NSAVE];
float sav_tsplit1[NSAVE], sav_tsplit2[NSAVE];
float sav_km[NSAVE];
} region_save;
Expand Down Expand Up @@ -212,7 +212,6 @@ int main(int argc,char *argv[])
short int response_array[MAXFILL+1];

int jrec2[NSAVE]; /* measurement counter for each region */
int dateline; /* when 1, region crosses dateline */

FILE *file_id;

Expand Down Expand Up @@ -1004,7 +1003,6 @@ int main(int argc,char *argv[])
latl=save_area.sav_latl[iregion];
lonh=save_area.sav_lonh[iregion];
lonl=save_area.sav_lonl[iregion];
dateline=save_area.sav_dateline[iregion];

/*
* Apply LTOD considerations: if a
Expand Down Expand Up @@ -1061,14 +1059,10 @@ int main(int argc,char *argv[])
}
}

if (dateline) { /* convert lon to ascending order */
if (lonl < 0.0) lonl=(lonl+360.f);
if (cx < -180.0) cx=(cx+360.f);
} else { /* convert lon to -180 to 180 range */
if (cx > 180.0) cx=(cx-360.f);
if (cx < -180.0) cx=(cx+360.f);
if (cx > 180.0) cx=(cx-360.f);
}
/* convert lon to -180 to 180 range */
if (cx > 180.0) cx=(cx-360.f);
if (cx < -180.0) cx=(cx+360.f);
if (cx > 180.0) cx=(cx-360.f);

/* check to see if center is within region */
if (!((cx > lonl) && (cx < lonh) &&
Expand Down Expand Up @@ -1343,7 +1337,6 @@ FILE * get_meta(char *mname, char *outpath,
float ascale2,bscale2,a02,b02,ydeg2,xdeg2;
int iregion=0,ipolar=0;
char regname[11];
int dateline;
char fname2[180];
char outname[500];
char sensor[40]="SSMI something";
Expand Down Expand Up @@ -1522,12 +1515,6 @@ FILE * get_meta(char *mname, char *outpath,
lonh=(float)atof(++x);
}

if (strstr(line,"Dateline_crossing") != NULL) {
x = strchr(line,'='); x++;
if (*x== 'F' || *x== 'f') dateline=0;
else dateline=1;
}

if (strstr(line,"AscDesc_flag") != NULL) {
x = strchr(line,'=');
asc_des=atoi(++x);
Expand Down Expand Up @@ -1955,7 +1942,6 @@ FILE * get_meta(char *mname, char *outpath,
strncpy(a->sav_fname2[iregion-1],fname2,180);
a->sav_regnum[iregion-1]=regnum;
strncpy(a->sav_regname[iregion-1],regname,10);
a->sav_dateline[iregion-1]=dateline;
a->sav_ascdes[iregion-1]=asc_des;
a->sav_tsplit1[iregion-1]=tsplit1;
a->sav_tsplit2[iregion-1]=tsplit2;
Expand Down

0 comments on commit 4310db6

Please sign in to comment.