gher-uliege / DIVAnd.jl

DIVAnd performs an n-dimensional variational analysis of arbitrarily located observations
GNU General Public License v2.0
72 stars 11 forks source link

Optional parameter qv_flags not taken into account in `NCODV.load` #72

Closed ctroupin closed 4 years ago

ctroupin commented 4 years ago

I'm reading a netCDF file produced by ODV and I'm checking how many good data, probably good, ... data points we have.

@time obsval, obslon, obslat, obsdepth, obstime, obsid = NCODV.load(Float64, datafile, 
    "Water body salinity"; qv_flags = ["probably_good_value"]);

but the number of data points found is the same whatever the values in qv_flags (list of strings with the quality flags to be kept).

At the beginning of the function NCODV.load we have accepted_status_flags = qv_flags, which is used as the argument of function flagvalues:

accepted_status_flag_values =
            flagvalues(ncv_ancillary.attrib, accepted_status_flags)

but in flag_values function the 1st line says accepted_status_flags = ["good_value", "probably_good_value"], so the argument of NCODV.load is not used.

Does that make sense?

Alexander-Barth commented 4 years ago

Good catch! I removed this line accepted_status_flags = ["good_value", "probably_good_value"]. Does it work now for you?

ctroupin commented 4 years ago

Great! Acknowledgement to Helge for reporting the results of some tests.