Skip to content

Conversation

xkykai
Copy link
Collaborator

@xkykai xkykai commented Oct 3, 2025

Closes #643

@xkykai xkykai marked this pull request as draft October 3, 2025 22:52
Comment on lines +139 to +143
is_three_dimensional(metadata::CopernicusMetadata) =
metadata.name == :temperature ||
metadata.name == :salinity ||
metadata.name == :u_velocity ||
metadata.name == :v_velocity
Copy link
Member

@glwagner glwagner Oct 3, 2025

Choose a reason for hiding this comment

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

I think you should blacklist the 2D variables rather than whitelisting 3D variables, since most variables are 3D

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here I was trying to follow the design pattern here:

if is_three_dimensional(metadata)

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can achieve this by using a ! conditional because is_three_dimensional == !is_two_dimensional

Copy link
Collaborator

Choose a reason for hiding this comment

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

for example:

is_three_dimensional(metadata::CopernicusMetadata) =
    !(metadata.name == :ice_concentration ||
      metadata.name == :ice_thickness)

Comment on lines +147 to +148
if !is_three_dimensional(metadata)
return (0, 1)
Copy link
Member

Choose a reason for hiding this comment

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

Would it be better to build a Flat grid for 2D variables? Why do the z_interfaces matter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this line seems to want to take something for z, I tried returning nothing but I guess it didn't work

grid = LatitudeLongitudeGrid(arch, FT; halo, longitude, latitude, z,

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, the size and the halo must be 2-tuples to use nothing in z.

halo = (3, 3, 3),
cache_inpainted_data = true)
cache_inpainted_data = true,
fill_nans = nothing)
Copy link
Member

Choose a reason for hiding this comment

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

why not just use true or false here? Also I am confused --- shouldn't this be handled by inpainting? Inpainting is generally the process of removing invalid entries. Usually we inpaint NaNs with fancy propagation method, but just replacing them with a neutral value (like 0) could be implemented as an additional inpainting option.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I suppose you're right, we should do it via inpainting. Currently there is no zero inpainting available, so I suppose the solution is to write a zero inpainting method and then change default_inpainting so that it deals with CopernicusMetadata differently? It seems like for ECCO no inpainting is required for sea ice

function default_inpainting(metadata)

Copy link
Member

Choose a reason for hiding this comment

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

Yes, the purpose of the default_inpainting is to allow dispatch on metadata type

@xkykai xkykai marked this pull request as ready for review October 4, 2025 00:03
Copy link

codecov bot commented Oct 4, 2025

Codecov Report

❌ Patch coverage is 0% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 22.96%. Comparing base (dac9760) to head (59d3004).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/DataWrangling/Copernicus/Copernicus.jl 0.00% 13 Missing ⚠️
src/DataWrangling/inpainting.jl 0.00% 12 Missing ⚠️
src/DataWrangling/DataWrangling.jl 0.00% 1 Missing ⚠️
src/DataWrangling/metadata_field.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #644      +/-   ##
==========================================
- Coverage   23.04%   22.96%   -0.08%     
==========================================
  Files          48       48              
  Lines        2990     3009      +19     
==========================================
+ Hits          689      691       +2     
- Misses       2301     2318      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

using CopernicusMetadata to set sea ice fails because it is a 2D field

3 participants