Skip to content

Adding function to overplot specific QC tests on 1D time-series data#996

Open
cgodine wants to merge 4 commits intoARM-DOE:mainfrom
cgodine:ShadeIndividualBits
Open

Adding function to overplot specific QC tests on 1D time-series data#996
cgodine wants to merge 4 commits intoARM-DOE:mainfrom
cgodine:ShadeIndividualBits

Conversation

@cgodine
Copy link
Contributor

@cgodine cgodine commented Mar 6, 2026

Currently, there is functionality to overplot QC variables by assessment type (#244). However, this plots only by the assessment type. I have added code that will plot specific QC tests by test/bit number. Passing an integer of the test number will overplot that test's flagged data onto the plot:
test_overplot_bit

Passing a list of integers will plot those test numbers:
test_overplot_bit_multi

Copy link
Collaborator

@zssherman zssherman left a comment

Choose a reason for hiding this comment

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

Thanks @cgodine for the PR! Code looks good to me! Test wise the images aren't matching so might be an issue between the generated and test images, might need to just recreate them and confirm they match

@cgodine
Copy link
Contributor Author

cgodine commented Mar 9, 2026

@zssherman the original test images had the Data Quality Office watermark on them, which is why I assumed tests were failing. I recreated images and they passed local pytest run, so I replaced old ones. It looks like they're still failing so I will need to investigate further.

][bit - 1]

# Get the proper keys for plot color
if 'Bad' in bit_assessment:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you need to revisit this part of the code. the variable is plot_color but you're assigning an assessment to it. When I tried to overplot Suspect data, this failed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed variable to plot_assessment to better reflect what is being assigned. Also fixed the logic for determining which assessment category the bit is in by using the assessment_overplot_category dict passed in the keyword args. Suspect data should now be plotted as such.

lines.extend(qc_ax)
labels.append(assessment)
add_legend = True
plot_color = assessment_overplot_category_color[bit_assessment]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should return a color but then that's difference from the Incorrect/Suspect being assigned a couple lines up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed this with the rename of the variable and improvements to logic.

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.

Shade time series data where individual qc bits are tripped

3 participants