British-Oceanographic-Data-Centre / COAsT

A Coastal Ocean Assessment Tool built as an extendable python framework for nemo models
https://british-oceanographic-data-centre.github.io/COAsT/
MIT License
24 stars 11 forks source link

Profile.process_en4() bug #608

Closed jpolton closed 1 year ago

jpolton commented 1 year ago

nan masking of bad salinity point was misapplied using temperature mask locations:

    ds["practical_salinity"] = xr.where(~reject_tem_lev, ds["practical_salinity"], np.nan)

should read

    ds["practical_salinity"] = xr.where(~reject_sal_lev, ds["practical_salinity"], np.nan)

Also, though data points with bad values were masked with NaN, and profiles with both bad salinity and temperature were removed, profiles with bad temperature or salinity were not masked.

On inspection, other minor issues: