Skip to content

Update elevation script to use cell_id structure#205

Open
lelavathy wants to merge 4 commits intomainfrom
fix/maliau-elevation-script
Open

Update elevation script to use cell_id structure#205
lelavathy wants to merge 4 commits intomainfrom
fix/maliau-elevation-script

Conversation

@lelavathy
Copy link
Copy Markdown
Collaborator

This update modifies the Maliau elevation preprocessing script so that the
output dataset follows the Virtual Ecosystem (VE) spatial data structure and
addresses the issue reported in “Input data is flipped when mapped on grid
#1054” #1054

Key changes include:

Replacing the 2D spatial dimensions (x, y) with a single cell_id
dimension consistent with VE grid structure.

Flattening the elevation grid using row-major ordering with a top-left
origin (cell_id = 0 at the top-left cell).

Explicitly controlling the orientation of the y-axis to prevent the grid
from being flipped when mapped to VE cells.

Storing per-cell spatial coordinates (x, y, and UTM coordinates) so
that each cell_id can be correctly mapped back to its spatial position.

These changes ensure that the elevation dataset aligns with the VE grid
layout and prevent the input data from being vertically flipped when mapped
onto the simulation grid.

@lelavathy lelavathy requested a review from annarallings March 5, 2026 06:03
@davidorme
Copy link
Copy Markdown
Collaborator

I very strongly recommend not doing this. This is a VE model coding problem. I completely understand that the result is annoying to deal with and you get the flipped outputs, but let us fix the problem in the model.

That fix isn't going to happen immediately, but changing the inputs makes them harder to visualise and it is much harder to debug potential issues with cell_id coding. Stick with XY and let us make it work from the model end.

@annarallings
Copy link
Copy Markdown
Collaborator

Could we maybe put this as an issue in the VE repo? Something to tackle later (if it isn't already in there)

@davidorme
Copy link
Copy Markdown
Collaborator

Could we maybe put this as an issue in the VE repo? Something to tackle later (if it isn't already in there)

It's there: ImperialCollegeLondon/virtual_ecosystem#1054

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.

3 participants