Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix bug in transect operator #731

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cset-workflow/meta/rose-meta.conf
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ help=This functionality extracts data for each variable defined in CS_VARS,
such as transects through valleys, or through a front as it passes through.
type=python_boolean
trigger=template variables=CS_STARTCOORDS: True;
trigger=template variables=CS_FINISHCOORDS: True;
trigger=template variables=CS_VARS: True;
template variables=CS_FINISHCOORDS: True;
template variables=CS_VARS: True;
compulsory=true
sort-key=cs1

Expand Down
4 changes: 4 additions & 0 deletions cset-workflow/rose-suite.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ CSET_INPUT_FILE_PATH=""
CSET_LOCAL_CSET_PATH="$HOME/CSET"
CSET_RUNAHEAD_LIMIT=10
!!CSET_TIMES_PER_FILE=0
CS_FINISHCOORDS=""
CS_STARTCOORDS=""
CS_VARS=""
DB_LONG_JOB=False
DETERMINISTIC_PLOT_AGGREGATE_PRECIPITATION=False
DETERMINISTIC_PLOT_CAPE_RATIO=False
Expand All @@ -34,6 +37,7 @@ DOMAIN_MEAN_VERTICAL_PROFILE_MODELLEVEL_SERIES=False
DOMAIN_MEAN_VERTICAL_PROFILE_SERIES=False
DOMAIN_SURFACE_HISTOGRAM_SERIES_FIELD=False
ENSEMBLE_PLOT_SURFACE_AIR_TEMP=False
EXTRACT_TRANSECT=False
FETCH_FCST_OPT_CONF="filesystem"
HOUSEKEEPING_MODE=2
LFRIC_DOMAIN_MEAN_SURFACE_TIME_SERIES=False
Expand Down
4 changes: 2 additions & 2 deletions src/CSET/operators/transect.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def calc_transect(cube: iris.cube.Cube, startcoords: tuple, endcoords: tuple):
)

# Compute minimum gap between x/y spatial coords.
lon_min = np.min(lon_coord.points[1:] - lon_coord.points[:-1])
lat_min = np.min(lat_coord.points[1:] - lat_coord.points[:-1])
lon_min = np.abs(np.min(lon_coord.points[1:] - lon_coord.points[:-1]))
lat_min = np.abs(np.min(lat_coord.points[1:] - lat_coord.points[:-1]))

# For scenarios where coord is at 90 degree to the grid (i.e. no
# latitude/longitude change). Only xmin or ymin will be zero, not both
Expand Down