Skip to content

Conversation

@dwolfsch
Copy link
Contributor

Updates the ellipsoid method of the scarp script, so that users can now define more specific ellispoids

dwolfsch and others added 25 commits April 24, 2025 10:35
Run file for com6RockAvalanche Scarp
Config-File for scarp.py
Scarp.py creates scarps, that can be used as an Input for com6RockAvalanche
- Refactored `runCom6Scarp.py` to accept an input directory instead of a configuration file path.
- Added TODO comments for further improvements in `scarp.py`, `scarpCfg.ini`, and `runCom6Scarp.py` regarding default parameter handling and output file management.
- Implement shapefile input for feature coordinates and perimeter.
- Remove raster input options for coordinates and perimeter.
- Adapt `scarp.py` to use new input method and updated config.
- Adjust `runCom6Scarp.py` to use refactored `scarp.py` functions.
- Remove obsolete output paths from config file.
Run file for com6RockAvalanche Scarp
Config-File for scarp.py
Scarp.py creates scarps, that can be used as an Input for com6RockAvalanche
- Refactored `runCom6Scarp.py` to accept an input directory instead of a configuration file path.
- Added TODO comments for further improvements in `scarp.py`, `scarpCfg.ini`, and `runCom6Scarp.py` regarding default parameter handling and output file management.
- Implement shapefile input for feature coordinates and perimeter.
- Remove raster input options for coordinates and perimeter.
- Adapt `scarp.py` to use new input method and updated config.
- Adjust `runCom6Scarp.py` to use refactored `scarp.py` functions.
- Remove obsolete output paths from config file.
- Implement shapefile input for feature coordinates and perimeter.
- Adapt Readme
- commit includes test data in data/scarpExample
  - Run file for com6RockAvalanche Scarp
  - Create scarpCfg.ini
  - Config-File for scarp.py
  - Create scarp.py
  - scarp.py creates scarps, that can be used as an Input for com6RockAvalanche
  - com6RockAvalanche: update scarp.py, runCom6Scarp.py & scarpCfg.ini, add readme
- Refactored `runCom6Scarp.py` to accept an input directory instead of a configuration file path.
- Added TODO comments for further improvements in `scarp.py`, `scarpCfg.ini`, and `runCom6Scarp.py` regarding default parameter handling and output file management.

feat(com6RockAvalanche): implement shapefile input for scarp

- Implement shapefile input for feature coordinates and perimeter.
- Remove raster input options for coordinates and perimeter.
- Adapt `scarp.py` to use new input method and updated config.
- Adjust `runCom6Scarp.py` to use refactored `scarp.py` functions.
- Remove obsolete output paths from config file.
…fo; remove codeclimate

- Add instructions for input files, including elevation DEM and shapefile
- Specify output files and their locations in the directory structure
- Include steps for preparing the configuration file for scarp calculations
- Clarify the usage of the script for running SCARP calculations
Updates the ellipsoid function of the scarp script.
Comment on lines +324 to +338
if 0 <= center_row < n and 0 <= center_col < m:
slopeAzimuth = slopeDir[center_row, center_col]
slopeAzimuth = (slopeAzimuth + 2 * np.pi) % (2 * np.pi)
slopeMag = slopeMagnitude[center_row, center_col]

if not np.isnan(slopeAzimuth) and slopeMag > 0:
normal_dx = np.cos(slopeAzimuth)
normal_dy = np.sin(slopeAzimuth)
slopeAngle = math.atan(slopeMag)
dxOffset = -offset[k] * normal_dx * math.sin(slopeAngle)
dyOffset = -offset[k] * normal_dy * math.sin(slopeAngle)
dzOffset = -offset[k] * math.cos(slopeAngle)
else:
dxOffset = dyOffset = dzOffset = 0
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

Deeply nested control flow (level = 4) [qlty:nested-control-flow]

Comment on lines +357 to +362
if distance <= 1:
baseDepth = maxDepth[k] * (1 - distance)
tiltEffect = math.tan(math.radians(tilt[k])) * (
dxRot * np.cos(tiltDir[k]) + dyRot * np.sin(tiltDir[k])
)
totalDepth = baseDepth + tiltEffect + z0
Copy link
Contributor

Choose a reason for hiding this comment

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

Deeply nested control flow (level = 4) [qlty:nested-control-flow]

maxdepth_value = value
if name == "semimajor":
semimajor_value = value
if name == "tilt":
Copy link
Contributor

Choose a reason for hiding this comment

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

Deeply nested control flow (level = 4) [qlty:nested-control-flow]

semimajor_value = value
if name == "tilt":
tilt_value = value
if name == "direc":
Copy link
Contributor

Choose a reason for hiding this comment

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

Deeply nested control flow (level = 4) [qlty:nested-control-flow]

tilt_value = value
if name == "direc":
direc_value = value
if name == "offset":
Copy link
Contributor

Choose a reason for hiding this comment

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

Deeply nested control flow (level = 4) [qlty:nested-control-flow]

@fso42
Copy link
Contributor

fso42 commented Aug 18, 2025

closing in favor of #1172

@fso42 fso42 closed this Aug 18, 2025
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