Commit bfe7fca3 authored by Timothy Shippert's avatar Timothy Shippert
Browse files

Fixed a 7nch bug which created the Ios in the wrong place (for the wrong

channel).
parent 81b16cde
......@@ -264,7 +264,7 @@ DATA* ComputeNewData (DATA *D)
int getStartEndTime (DATA *, long *, long *);
int getStartEndTime3 (DATA *, long *, long *);
DATA *barnard_langley (DATA *, float *);
int michalsky_langley (DATA *, DATA *, float *);
int michalsky_langley (DATA *, DATA *, float *, int);
int writeWavelengthAttr (DATA *, int);
char *head_id;
......@@ -384,7 +384,7 @@ DATA* ComputeNewData (DATA *D)
bw_exit(newD, "Problem in Barnard; continuing to next processing interval");
}
if ( (status = michalsky_langley (D, newD, (float *) &gNomCal)) < 0) {
if ( (status = michalsky_langley (D, newD, (float *) &gNomCal, broadband_exists)) < 0) {
bw_exit(newD, "Problem in Michalsky; continuing to next processing interval");
};
......
......@@ -55,12 +55,12 @@ float michalsky_sdist; /* To capture sdist from gest_solar_geom */
*
* Inputs:
*******************************************************************************/
int michalsky_langley (DATA *D, DATA *newD, float *gNomCal)
int michalsky_langley (DATA *D, DATA *newD, float *gNomCal, int broadband_exists)
{
/* functions used by michalsky_langley (... */
int setup_for_michalsky (DATA *);
int write_newD (DATA *, float *);
int write_newD (DATA *, float *, int);
int status;
setup_for_michalsky (D);
......@@ -70,7 +70,7 @@ int michalsky_langley (DATA *D, DATA *newD, float *gNomCal)
langley (); /* This is michalsky code */
if ((status = write_newD (newD, gNomCal)) < 0) {
if ((status = write_newD (newD, gNomCal, broadband_exists)) < 0) {
bw_return(-1, "Michalsky: problem writing newD");
}
......@@ -219,7 +219,7 @@ int setup_for_michalsky (DATA *D)
return (TRUE);
} /* setup_for_michalsky (... */
int write_newD (DATA *newD, float *gNomCal)
int write_newD (DATA *newD, float *gNomCal, int broadband_exists)
{
int o, f, t, ot, r, valid_idx;
int nobs[NOUTPLATS], chn;
......@@ -259,8 +259,12 @@ int write_newD (DATA *newD, float *gNomCal)
* barnard fld start + NCHANNELS = michalsky fld start
*/
/* broadband need to be first in output */
chn = (r == 0) ? NCHANNELS - 1 : r - 1;
if (broadband_exists) {
/* broadband need to be first in output */
chn = (r == 0) ? NCHANNELS - 1 : r - 1;
} else {
chn = r;
}
if ((int) michalsky_ret[t][chn].op_depth == -9999)
{
......@@ -351,7 +355,12 @@ int write_newD (DATA *newD, float *gNomCal)
for (r=0; r<NCHANNELS; r++)
{
/* broadband need to be first in output */
chn = (r == 0) ? NCHANNELS - 1 : r - 1;
if (broadband_exists) {
/* broadband need to be first in output */
chn = (r == 0) ? NCHANNELS - 1 : r - 1;
} else {
chn = r;
}
newD->BWdata[PLOT][o][0][LN_I + NCHANNELS + r][valid_idx][0] =
michalsky_lnI[ot][chn];
newD->BWdata[PLOT][o][0][REJECTED + NCHANNELS + r][valid_idx][0] =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment