Vertical: z sign convention is guessed in plots and ignored in matching
@otzi5300 ci sta già lavorando.
Dal 24/9/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Vertical data has no declared z convention (positive up or positive down). Matching ignores the question, and the plots guess.
Matching
_interpolate_to_obs_depths interpolates observation z directly against model z. An observation given as positive-down depth, which is how CTD casts are usually logged, fails against a MIKE 3 dfsu:
import mikeio
import modelskill as ms
df = mikeio.read("docs/data/vertical/VerticalProfile_obs1.dfs0").to_dataframe() # z: -30..0
mr = ms.model_result("docs/data/vertical/sigma_z_coast.dfsu", item="Salinity")
ms.match(ms.VerticalObservation(df, item="Salinity", z_item="z", x=657500, y=6553600), mr)
# 108 matched points
ms.match(ms.VerticalObservation(df.assign(z=-df["z"]), item="Salinity", z_item="z", x=657500, y=6553600), mr)
# ValueError: zero-size array to reduction operation maximum which has no identity
The error does not point at the cause. If the two z ranges only touch at the surface, the match returns just the z=0 points and raises no error.
Plots
VerticalPlotter._pos_z inverts the y-axis in profile() and hovmoller() when abs(z.max()) > abs(z.min()). All-positive elevations above the seabed (z = 0..30, surface at 30) are taken as depths and drawn upside down. For mixed-sign z the result depends on which extreme is larger.
Proposal
VerticalObservationandVerticalModelResulttakepositive: Literal["up", "down"] | None = None. Resolve it fromz.attrs["positive"](CF convention), then the argument, then default to"up"(the MIKE convention). After constructionz.attrs["positive"]is always set. Do not infer it from the sign of the values.match()converts the observation z to the model's convention.- The plots read the attribute;
_pos_zis removed with no fallback. - The user guide states the convention and shows the
positiveargument.
- Lingua principale
- Python
- Stelle
- 56
- Fork
- 9
- Merge medio
- 1h 24m
- PR unite (30g)
- 2
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DHI/modelskill
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
DHI/modelskill#628 ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
DHI/modelskill#714 · 1 reazione ·
-
An already-validated Dataset silently discards x, y, item and the other constructor argumentsApertabug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
DHI/modelskill#713 ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 72/100
DHI/modelskill#712 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
DHI/modelskill#706 · 2 commenti ·
Tutte le issue di DHI/modelskill
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
kornia/kornia#5263 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
approved correction metadata
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
acl-org/acl-anthology#10133 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
BasedHardware/omi#20084 ·
I maintainer di solito rispondono entro 1 giorno
-
bug needs-acceptance wg/evaluation-quality
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
vllm-project/semantic-router#4424 ·
I maintainer di solito rispondono entro 1 giorno