Repository navigation
Irregular grid - #1213
Merged
Merged
Irregular grid#1213
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI summary:
Irregular (lat, lon) data for all six fields
Adds field data defined on an irregular set of (lat, lon) positions, for example satellite footprints. All six fields accept it: atmosphere, surface and subsurface, each in a spectral and a non-spectral version.
New types (
src/core/geodesy/irregular_spherical_grid.*)IrregularSphericalGrid: a list of (lat, lon) positions. Interpolation weights are the normalised inverse squared angular distance to every position, and a query exactly at a position returns that position's value.IrregularGeodeticData2,IrregularGeodeticData3,IrregularSpectralGeodeticData2,IrregularSpectralGeodeticData3: data on that grid, optionally with frequency and/or altitude grids. They have XML IO, formatting and Python bindings.The method is meant for queries near the positions, such as tracking footprints. Far from all of them the weights tend towards a plain average.
Integration
SurfaceDataIrregularGeodeticData2AtmData,SubsurfaceDataIrregularGeodeticData3SurfaceSpectralDataIrregularSpectralGeodeticData2AtmSpectralData,SubsurfaceSpectralDataIrregularSpectralGeodeticData3data_type,ok(), XML through the data variant, and implicit construction from Python. NLTE level densities from LTE supportIrregularGeodeticData3too.log_interpolationis supported.Nearest.Fixes and behaviour changes
Flat weights outside the grid: in
AtmData,SubsurfaceDataandSurfaceData,at()andflat_weight()now derive from one extrapolation step. Before, the weights always described linear extrapolation, whatever the flag. Now:Zerogives no weights.Nearestgives the weights at the grid edge.Nonethrows in both.This changes Jacobians for retrievals that reach outside a field's grid.
SurfaceDataprecedence:Nonenow takes precedence overZero, as in the other fields, and the error message changed to match the spectral fields.Empty grids now throw a clear error instead of reading
front()of an empty grid.Exhaustive visits: visits over field data use one overload per type, or end in a
static_assertnaming the last known type. A new variant alternative now fails to compile instead of silently taking a default branch.Other changes
lagrange_typenow spells out its requirements and accepts runtime-sized lags (distance_lag_t).gridded_data_tgrids must satisfy a newgrid_typeconcept.atm,surfaceandsubsurfacelinkgeodesy.doc/arts/dev.doc.rstdocuments two rules:*Name*must name an existing workspace item... :class:line per type it can hold. Thechecktarget enforces this; barectestdoesn't.Tests
tests/core/surf/irregular_fields.py: all six fields against an independent numpy reference. It covers values, log interpolation, flat weights (checked by finite differences in the log case), every altitude/frequency extrapolation mode and an XML round trip.tests/core/atm/field_extrapolation_weights.py: in every extrapolation mode, the flat weights ofAtmData,SubsurfaceDataandSurfaceDatareproduce the value.tests/core/surf/irreg_surface.py: a plotting example onSurfaceData, which checks that the data are reproduced at their positions and that every value stays between their minimum and maximum.ninja checkpasses, 323/323.🤖 Generated with Claude Code