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

Add profile extent qc #133

Merged
merged 5 commits into from
Jan 28, 2025
Merged

Conversation

hgloeckner
Copy link
Contributor

add a test to check that the profile extends (almost) to the aircraft

@hgloeckner hgloeckner mentioned this pull request Jan 17, 2025
@hgloeckner hgloeckner force-pushed the add_profile_extend_qc branch from 91d3696 to c1778d9 Compare January 17, 2025 13:53
Copy link
Contributor

@tmieslinger tmieslinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation of this new QC check seems reasonable. I'd mainly suggest to rename all "_extend" instances to "_extent" as my first intuition was that this function wants to extend the profile instead of checking the extent.
The QC flag profile_extend seems to indeed happen in 12 cases in the current L3_qc data on IPFS. Once even combined with the flag near_surface :)
You told be before, but why exactly do we need this flag?

pydropsonde/helper/quality.py Outdated Show resolved Hide resolved
pydropsonde/processor.py Outdated Show resolved Hide resolved
@hgloeckner
Copy link
Contributor Author

The implementation of this new QC check seems reasonable. I'd mainly suggest to rename all "__extend" instances to "__extent" as my first intuition was that this function wants to extend the profile instead of checking the extent. The QC flag profile_extend seems to indeed happen in 12 cases in the current L3_qc data on IPFS. Once even combined with the flag near_surface :) You told be before, but why exactly do we need this flag?

I don't really understand what you mean here. the profile_extent is independent of the near_surface qc. The former checks whether the profile reaches up to the aircraft (at least sufficiently so) and the other checks that there at least 50 values close to the surface. in the {var}_qc variables, all qcs for that variable are combined in this byte-version, maybe that's where they appear together?

@hgloeckner hgloeckner force-pushed the add_profile_extend_qc branch 2 times, most recently from 2d5910d to b339b17 Compare January 22, 2025 10:47
@tmieslinger
Copy link
Contributor

The implementation of this new QC check seems reasonable. I'd mainly suggest to rename all "__extend" instances to "__extent" as my first intuition was that this function wants to extend the profile instead of checking the extent. The QC flag profile_extend seems to indeed happen in 12 cases in the current L3_qc data on IPFS. Once even combined with the flag near_surface :) You told be before, but why exactly do we need this flag?

I don't really understand what you mean here. the profile_extent is independent of the near_surface qc. The former checks whether the profile reaches up to the aircraft (at least sufficiently so) and the other checks that there at least 50 values close to the surface. in the {var}_qc variables, all qcs for that variable are combined in this byte-version, maybe that's where they appear together?

Sorry, I mixed by statements :) I was wondering when or where we need to know whether the profile extends all the way to the aircraft. Is it for the integrated variables like IWV to be comparable? I am wondering because the aircraft flew at different hight levels anyway. So when is it a problem if the sonde measurements start >10% below the aircraft altitude?

@hgloeckner
Copy link
Contributor Author

The implementation of this new QC check seems reasonable. I'd mainly suggest to rename all "__extend" instances to "__extent" as my first intuition was that this function wants to extend the profile instead of checking the extent. The QC flag profile_extend seems to indeed happen in 12 cases in the current L3_qc data on IPFS. Once even combined with the flag near_surface :) You told be before, but why exactly do we need this flag?

I don't really understand what you mean here. the profile_extent is independent of the near_surface qc. The former checks whether the profile reaches up to the aircraft (at least sufficiently so) and the other checks that there at least 50 values close to the surface. in the {var}_qc variables, all qcs for that variable are combined in this byte-version, maybe that's where they appear together?

Sorry, I mixed by statements :) I was wondering when or where we need to know whether the profile extends all the way to the aircraft. Is it for the integrated variables like IWV to be comparable? I am wondering because the aircraft flew at different hight levels anyway. So when is it a problem if the sonde measurements start >10% below the aircraft altitude?

Ah okay :) Yes, it is basically only necessary for the IWV calculation. We do have different aircraft heights, but somehow, there should still be some cutoff when it does not make sense to calculate it. I think, this test only targets one sonde that is not targeted otherwise for orcestra, which for some reason only has measurements in the last 600m. Maybe we can come up with a better way to flag sondes like that?

@tmieslinger
Copy link
Contributor

The implementation of this new QC check seems reasonable. I'd mainly suggest to rename all "__extend" instances to "__extent" as my first intuition was that this function wants to extend the profile instead of checking the extent. The QC flag profile_extend seems to indeed happen in 12 cases in the current L3_qc data on IPFS. Once even combined with the flag near_surface :) You told be before, but why exactly do we need this flag?

I don't really understand what you mean here. the profile_extent is independent of the near_surface qc. The former checks whether the profile reaches up to the aircraft (at least sufficiently so) and the other checks that there at least 50 values close to the surface. in the {var}_qc variables, all qcs for that variable are combined in this byte-version, maybe that's where they appear together?

Sorry, I mixed by statements :) I was wondering when or where we need to know whether the profile extends all the way to the aircraft. Is it for the integrated variables like IWV to be comparable? I am wondering because the aircraft flew at different hight levels anyway. So when is it a problem if the sonde measurements start >10% below the aircraft altitude?

Ah okay :) Yes, it is basically only necessary for the IWV calculation. We do have different aircraft heights, but somehow, there should still be some cutoff when it does not make sense to calculate it. I think, this test only targets one sonde that is not targeted otherwise for orcestra, which for some reason only has measurements in the last 600m. Maybe we can come up with a better way to flag sondes like that?

Ok, when plotting IWV dependent on altitude we could define a range in altitude that adds most to the total integral. THe highest contribution should come from the BL with decreasing contributions as you go up. Do you think it could make sense to rather have a test for IWV (in the tropics) that will apply a simple fixed height threshold, e.g. the profile has to have measurements up to 10km?

@tmieslinger
Copy link
Contributor

From personal conversation we agreed to split the two points mentioned above:

  1. providing a flag value that hints to the extent of a profile. Maybe the profile_fullness flag should be renamed to profile_data_density or similar to not confuse with profile_extent.
  2. checking for integrated variables such as IWV that there are datapoints throughout the profile up to at least 8km (?). But the latter can be specific to the variable in question.

@hgloeckner hgloeckner force-pushed the add_profile_extend_qc branch from b339b17 to 9024f1f Compare January 27, 2025 15:42
@hgloeckner
Copy link
Contributor Author

hgloeckner commented Jan 27, 2025

From personal conversation we agreed to split the two points mentioned above:

1. providing a flag value that hints to the extent of a profile. Maybe the `profile_fullness` flag should be renamed to `profile_data_density` or similar to not confuse with `profile_extent`.

2. checking for integrated variables such as IWV that there are datapoints throughout the profile up to at least 8km (?). But the latter can be specific to the variable in question.

I used profile_sparsity since we calculate density later. maybe that could lead to confusion.

Other than that, now the extent is dependent on an absolute height value again. It is set to 8000 as a default, but can be changed in the config.

@hgloeckner hgloeckner changed the title Add profile extend qc Add profile extent qc Jan 27, 2025
Copy link
Contributor

@tmieslinger tmieslinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the changes and the renaming seems to be consistent and enter the Level3 files. Should the dropsonde.cfg be changed accordingly to say

[processor.Sonde.filter_qc_fail]
filter_flags = profile_sparcity,near_surface_coverage,alt_near_gpsalt

pydropsonde/helper/quality.py Outdated Show resolved Hide resolved
hgloeckner and others added 3 commits January 28, 2025 15:09
Co-authored-by: Theresa Mieslinger <41184617+tmieslinger@users.noreply.github.com>
@hgloeckner hgloeckner merged commit ced2fa5 into atmdrops:main Jan 28, 2025
5 checks passed
@hgloeckner hgloeckner deleted the add_profile_extend_qc branch February 6, 2025 09:53
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 this pull request may close these issues.

2 participants