Skip to content

Commit

Permalink
"intify" axis number
Browse files Browse the repository at this point in the history
  • Loading branch information
sdunesme committed Jul 5, 2024
1 parent 1278973 commit a4b47ef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
16 changes: 8 additions & 8 deletions fct/profiles/TalwegElevationProfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
from shapely.geometry import LineString, asShape
import xarray as xr

from ..cli import starcall
from ..tileio import as_window
from ..config import (
from fct.cli import starcall
from fct.tileio import as_window
from fct.config import (
DatasetParameter,
LiteralParameter
)
from ..corridor.ValleyBottomFeatures import MASK_VALLEY_BOTTOM
from ..metadata import set_metadata
# from ..plotting.PlotCorridor import (
from fct.corridor.ValleyBottomFeatures import MASK_VALLEY_BOTTOM
from fct.metadata import set_metadata
# from fct.plotting.PlotCorridor import (
# SetupPlot,
# SetupMeasureAxis,
# FinalizePlot
Expand Down Expand Up @@ -152,7 +152,7 @@ def arguments():
with fiona.open(talweg_shapefile) as fs:
for feature in fs:

axis = feature['properties']['AXIS']
axis = int(feature['properties']['AXIS'])
talweg = np.asarray(feature['geometry']['coordinates'])

yield (
Expand Down Expand Up @@ -187,7 +187,7 @@ def TalwegElevation(params: Parameters, processes: int = 6, **kwargs) -> xr.Data
with click.progressbar(fs) as iterator:
for feature in iterator:

axis = feature['properties']['AXIS']
axis = int(feature['properties']['AXIS'])
talweg = np.asarray(feature['geometry']['coordinates'])
axis_values = extract_talweg_data(axis, talweg, params)
values.append(axis_values)
Expand Down
4 changes: 2 additions & 2 deletions fct/profiles/ValleyBottomElevationProfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from shapely.geometry import LineString
import xarray as xr

from ..config import config, DatasetParameter
from .TalwegElevationProfile import (
from fct.config import config, DatasetParameter
from fct.profiles.TalwegElevationProfile import (
Parameters as RefaxisParameters,
TalwegElevation as RefaxisElevation
)
Expand Down
1 change: 1 addition & 0 deletions tutorials/03-metrics/03-metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
params = ValleyBottomHeight.Parameters()
params.talweg = dict(key='metrics_refaxis_points', tiled=False, subdir='NETWORK/METRICS')
params.measure = 'medialaxis_measure'
params.nearest = 'medialaxis_nearest'

river_profile = ValleyBottomHeight.ValleyBottomHeight(swath_bounds=swath_bounds, params=params, processes=p)
river_profile.to_netcdf(f'{config.workdir}/NETWORK/METRICS/HEIGHT_FLOODPLAIN.nc')
Expand Down

0 comments on commit a4b47ef

Please sign in to comment.