Skip to content

Fix CTD tutorial variable column name - #422

Merged
ShaivanBhagat merged 2 commits into
Parcels-code:mainfrom
ShaivanBhagat:fix/ctd-variable-name
Nov 4, 2026
Merged

ShaivanBhagat merged 2 commits into
Parcels-code:mainfrom
ShaivanBhagat:fix/ctd-variable-name

Conversation

@ShaivanBhagat

Copy link
Copy Markdown
Contributor

when running the ctd tutorial for biogeochemical variables, ctd_build_2d_arrays runs into column not found issue.
VARIABLES refers to the ds_names (chl, no3, phyc ...) but this is never called. Instead ctd_build_2d_arrays looks for columns names such as chlorophyll, phytoplankton, nitrate from plot_variable. However, the parquet file has data in the former format.

This fixes that the correct column names (biogeochemical) are called.

ctd_build_2d_arrays was passed the display key (e.g. "oxygen") instead of
the actual dataset column (ds_name, e.g. "o2"), so plotting any variable
other than temperature/salinity/ph failed with a missing-column error.
Look up VARIABLES[plot_variable]["ds_name"] so oxygen/nitrate/phosphate/
phytoplankton/primary_production/chlorophyll resolve to o2/no3/po4/phyc/
nppv/chl respectively.

@erikvansebille erikvansebille left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch, thanks for updating @ShaivanBhagat! Can you merge this, or shall I do it?

@ShaivanBhagat
ShaivanBhagat merged commit cfba60f into Parcels-code:main Nov 4, 2026
11 of 12 checks passed
@ShaivanBhagat
ShaivanBhagat deleted the fix/ctd-variable-name branch November 4, 2026 12:11
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.

2 participants