Skip to content

QC testing, bug fixing and improvements in superfloat_oxygen#131

Open
CarolinaAmadio wants to merge 22 commits into
masterfrom
fix-qc-superfloat
Open

QC testing, bug fixing and improvements in superfloat_oxygen#131
CarolinaAmadio wants to merge 22 commits into
masterfrom
fix-qc-superfloat

Conversation

@CarolinaAmadio
Copy link
Copy Markdown
Collaborator

@CarolinaAmadio CarolinaAmadio commented Apr 10, 2026

This PR improves the superfloat_oxygen script to:

  1. Enable saving statistical information for QC analysis.

  2. Add a drift attribute when the BGC-Argo profile value at 600 m is modified.

  3. Clarify and better document functions.

  4. Fix two bugs (3 bugs).

- Remove unused save_report import from commons_local
- Add save_df_report function to handle CSV report saving and deduplication
- Update Metadata.offset default from -999 to NaN
- Improve report handling robustness and directory creation
- Added full docstring for clim_check
- Fixed trend check bug (TREND_per_YEAR instead of TREND_TIME_SERIES)
- Improved handling of missing or weak trends
- Before: skipped trend analysis if any NaN was present in VAR at Depth == 600
- After: skip trend analysis only if time series is too short or last 3 recent
         observations at 600m are all NaN
- Rewrote function documentation for clarity and correctness
- Fixed NaN handling using safe numeric conversion (pd.to_numeric with errors='coerce')
- Replaced original index-based logic with interpolation-based core extraction
- Added explicit check for empty time series (return False if no valid data)
- Improved criterion: valid if core length > 50% of original series
- Switch to read_adjusted=True for TEMP and PSAL in oxygen conversion
- Add fallback to real-time data when adjusted data is missing or insufficient
- Ensure density is computed from best available T/S profiles
- Distinguish TEMP and PSAL pressure arrays (PresT vs Pres)
- Fallback to real-time data when adjusted TEMP/PSAL are unavailable or too short
- Interpolate TEMP onto PSAL pressure grid when dimensions mismatch
Avoids potential shape mismatch when applying the mask.
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.

1 participant