JCSDA-internal / ioda-converters

Various converters for getting obs data in and out of IODA
9 stars 2 forks source link

Pass TotalBias argument to Ozone.toGeovals #1414

Closed danholdaway closed 9 months ago

danholdaway commented 9 months ago

Description

Our nightly picked up a bug in the Ozone converter code. TotalBias is an undefined variable.

BenjaminRuston commented 9 months ago

Wait,, think the correct approach is none of the toGeovals should have TotalBias

so we should remove this section:

                if (TotalBias):
                    # compute final bias correction
                    key1 = 'Obs_Minus_Forecast_adjusted'
                    key2 = 'Obs_Minus_Forecast_unadjusted'
                    if key1 in self.df.variables.keys() and key2 in self.df.variables.keys():
                        tmp = self.var(key1) - self.var(key2)
                        iodavar = 'GsiBc'
                        gvname = vname, iodavar
                        outdata[gvname] = np.reshape(tmp, dim)
                        VarDims[gvname] = dim_names
                    else:
                        print(f' ... can not add total bias missing {key1} or {key2} from input file')
BenjaminRuston commented 9 months ago

@danholdaway please put ready to merge if this fix works for you and we'll get it in

danholdaway commented 9 months ago

Thanks @BenjaminRuston. Removing it makes sense to me.