Skip to content

Commit

Permalink
Merge pull request #731 from MetOffice/transect_fixes
Browse files Browse the repository at this point in the history
Fix bug in transect operator
  • Loading branch information
jwarner8 authored Jul 5, 2024
2 parents c7efcbc + 14c533d commit 75a93fe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
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

0 comments on commit 75a93fe

Please # to comment.