Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply_qc_checks function excludes possibility to control qc flags individually #56

Closed
4 tasks done
Geet-George opened this issue Nov 14, 2023 · 0 comments · Fixed by #62
Closed
4 tasks done

apply_qc_checks function excludes possibility to control qc flags individually #56

Geet-George opened this issue Nov 14, 2023 · 0 comments · Fixed by #62

Comments

@Geet-George
Copy link
Owner

Geet-George commented Nov 14, 2023

Currently, the apply_qc_function applies another function to different qc flags and compiles it into a single flag. For example, if it runs the qc_check_profile_fullness function, then all the attributes of profile_fullness_{variable} are looked at together, and a composite value of True (if all True) or False (if any False) is provided to the attribute profile_fullness.

The current setup excludes the possibility for the user to flexibly select qc flags for different variables and then use these to create L2. To make it more customizable by the user, all qc-related attributes should be kept available for the user to choose from. A new function (maybe called qc_filter or something) can let the user to only select the sonde based on a list of filter_flags. This list will include elements that are qc-related attribute names, and if any of those are False, they will be filtered out from creating L2. The rest of the attributes will be ignored and will be propagated into L2 with their flag values. So, the most conservative QC filter would include all qc-related attributes in the filter_flag and not let any False value pass into L2. The most lenient QC filter would have an empty filter_flag list and allow all sondes pass into L2 (except no launch detected sonde, see commit 4c4085d) with their qc flag values propagated as variable values.

To keep all qc-related attributes together, we could think of creating a class attribute called qc, which would essentially be an empty object instance like type('', (), {})(). Next, any qc attributes can be assigned as object.__setattr__(self.qc,"whatever_name",qc_flag_value). Then, the new function (tentatively named qc_filter) can check only these self.qc attributes against the filter_flags list.

This will still not allow the user to select a subset of the available qc checks. They can only select which attributes will be used for filtering or for propagating. There is no option to skip a QC check/attribute. To make this possible, every function that assigns an attribute to self.qc will come with an optional argument skip that has the default value False. If the value of skip is set to True, the function will simply pass and not do anything. Therefore, the default option is that all QC checks run, but if need be, the user can set some of these QC checks to skip=True and allow only for limited QC checks, which are neither accounted for in filtering nor in propagating further to L2.

filter_flags should have a default value where it filters against all QC attributes. This default value should be of a type so that a user can provide either:

  • individual flag values, e.g. near_surface_coverage_tdry,`profile_fullness_tdry`` OR
  • all flag values of the same type, e.g. all flags starting with profile_fullness_ OR
  • all except values of one type, e.g. all flags except those starting with profile_fullness_
Geet-George added a commit that referenced this issue Nov 15, 2023
>
> the self.qc attribute is still not available in the class. this will be added later on.
> see #56 for a detailed explanation.
Geet-George added a commit that referenced this issue Nov 15, 2023
with the new filter_qc function and the self.qc attrs (upcoming, see #56),
these unused functions are removed. #56 also explains how the whole procedure provides
more flexibility for the user in terms of QC selection of checks and filtering flags.
Geet-George added a commit that referenced this issue Nov 15, 2023
@Geet-George Geet-George linked a pull request Nov 15, 2023 that will close this issue
@Geet-George Geet-George mentioned this issue Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant