Skip to content
Open
Show file tree
Hide file tree
Changes from 108 commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
289be25
added two new scripts to create lidar info for bridges
AliForghani-NOAA Dec 27, 2024
fdbdb6d
implementing bridges lidar info for healing REM
AliForghani-NOAA Dec 27, 2024
f59c182
assign crs to lidar rasters and redesigned creation of HUC6 elev diff…
AliForghani-NOAA Dec 28, 2024
0b69b12
fixed the alighment of rasters before making diff
AliForghani-NOAA Dec 28, 2024
4bcc6c3
added bridge lidar info into the FIM wrkflow
AliForghani-NOAA Jan 3, 2025
ae95b1a
added multiprocessing for making osm rasters using lidar las files
AliForghani-NOAA Jan 8, 2025
48a18dd
renamed the bridge data scripts and heal bridges elev using 3m cells …
AliForghani-NOAA Jan 14, 2025
204320a
added multiprocessing and logging for making dem diff
AliForghani-NOAA Jan 17, 2025
7d50bba
added logging into make osm rasters
AliForghani-NOAA Jan 17, 2025
8f754b1
added making vrt for diff raster files
AliForghani-NOAA Jan 18, 2025
fbd2ea5
made a copy of dem diff for branch zero
AliForghani-NOAA Jan 18, 2025
91aa6d4
temporarily used osm lines for an arbitrary HUC8 only for debugging
AliForghani-NOAA Jan 20, 2025
77e1056
Merge branch 'dev' into dev-lidar-bridge2
AliForghani-NOAA Jan 22, 2025
97ce7b5
applied linting
AliForghani-NOAA Jan 22, 2025
13a839a
updated pull osm to make two separate gpkg files for conus and alaska
AliForghani-NOAA Jan 22, 2025
0b2aca5
updated making raster s for alaska
AliForghani-NOAA Jan 22, 2025
b643993
updated dem diff to handle both HUC6 or HUC8 dems
AliForghani-NOAA Jan 23, 2025
e3a0a00
fixed projection issue in making lidar rasters
AliForghani-NOAA Jan 23, 2025
9142ea3
added a summary table showing classifications stats for all lidar data
AliForghani-NOAA Jan 23, 2025
bd5ec0a
fixed a linting
AliForghani-NOAA Jan 23, 2025
01e8993
added the dem diff raster links for Alaska
AliForghani-NOAA Jan 26, 2025
3eaed46
resolved merge conflict
AliForghani-NOAA Jan 27, 2025
f774856
changed clipping method for diff dem to near so neighboring cells do …
AliForghani-NOAA Jan 28, 2025
e9fc1d9
updated pre-clipping code with newalaska osm data
AliForghani-NOAA Jan 31, 2025
bc651f7
fix error msgs
RobHanna-NOAA Feb 3, 2025
b21650c
Merge Ali's update to Rob
RobHanna-NOAA Feb 3, 2025
6039452
Merge conflict fix
RobHanna-NOAA Feb 3, 2025
bd083e5
Merge branch 'dev' of https://github.com/NOAA-OWP/inundation-mapping …
RobHanna-NOAA Feb 3, 2025
bfbfa2d
linting fixes
RobHanna-NOAA Feb 3, 2025
d798914
linting
AliForghani-NOAA Feb 4, 2025
0577620
corrected no data
AliForghani-NOAA Feb 4, 2025
05e6b66
pull osm is good, pre-abandon fixes
RobHanna-NOAA Feb 4, 2025
76250cb
Merge branch 'dev-lidar-bridge2' of https://github.com/NOAA-OWP/inund…
RobHanna-NOAA Feb 4, 2025
c3dda2a
linting fixes
RobHanna-NOAA Feb 4, 2025
cdbdf17
linting fix plus bridge type changeds
RobHanna-NOAA Feb 5, 2025
72ec928
fixed zonal stats for small bridges
AliForghani-NOAA Feb 7, 2025
820b129
Merge branch 'dev-lidar-bridge2' of https://github.com/NOAA-OWP/inund…
AliForghani-NOAA Feb 7, 2025
4ba6774
linting bug fixed
AliForghani-NOAA Feb 7, 2025
5aa8278
pull osm done
RobHanna-NOAA Feb 8, 2025
dd41b01
Merge branch 'dev-lidar-bridge2' of https://github.com/NOAA-OWP/inund…
RobHanna-NOAA Feb 8, 2025
39c0dea
add more logs and progress bar for getting lidar
AliForghani-NOAA Feb 8, 2025
844dec3
added exception for getting lidar
AliForghani-NOAA Feb 8, 2025
5ae5728
used threshold terminalogy for non-lidar
AliForghani-NOAA Feb 10, 2025
a44754d
used threshold terminology in aggregate by huc
AliForghani-NOAA Feb 10, 2025
98df252
used threshold terminology in bridge_inundation.py
AliForghani-NOAA Feb 10, 2025
79a1484
create conda env tools and notes
RobHanna-NOAA Feb 10, 2025
3fefe88
udpate to ignore bridge txt file
RobHanna-NOAA Feb 10, 2025
05d85bc
linting fix
RobHanna-NOAA Feb 10, 2025
ecc87a1
fix .gitignore
RobHanna-NOAA Feb 12, 2025
bea7892
fix gitignore to skip txt and yml files
RobHanna-NOAA Feb 12, 2025
429402d
linting fixes
RobHanna-NOAA Feb 12, 2025
e70fced
linting exceptions
RobHanna-NOAA Feb 13, 2025
7207576
linting fixes
RobHanna-NOAA Feb 13, 2025
61b5f80
toml fixes
RobHanna-NOAA Feb 13, 2025
5667fd2
used ProcessPoolExecutor for parallel processing
AliForghani-NOAA Feb 13, 2025
68a4a57
added args for the numbers of jobs
AliForghani-NOAA Feb 13, 2025
da4c812
added info for existence of lidar or not for bridge risk status report
AliForghani-NOAA Feb 14, 2025
8e67cbd
added bad sites list that must be excluded for lidar download
AliForghani-NOAA Feb 14, 2025
bdddd39
Merge branch 'dev-lidar-bridge2' of https://github.com/NOAA-OWP/inund…
AliForghani-NOAA Feb 14, 2025
980549e
make sure bad sites are excluded
AliForghani-NOAA Feb 14, 2025
9139381
added evaluated flow into bridge rist report
AliForghani-NOAA Feb 14, 2025
263be09
Updates to msg plus add jobs to make dems
RobHanna-NOAA Feb 18, 2025
e75d83e
udpate for huc column case
RobHanna-NOAA Feb 18, 2025
1b6832d
Update bash_variables
RobHanna-NOAA Feb 18, 2025
3446029
huc name case issue fix
RobHanna-NOAA Feb 18, 2025
62a994d
fix line at the end of the file
RobHanna-NOAA Feb 19, 2025
04ec4ad
updated the paths to new input data
AliForghani-NOAA Feb 21, 2025
be62576
Merge branch 'dev' into dev-lidar-bridge2
AliForghani-NOAA Feb 21, 2025
b4bf013
Update CHANGELOG.md
AliForghani-NOAA Mar 4, 2025
3b974f5
Update CHANGELOG.md
AliForghani-NOAA Mar 4, 2025
6eaa9d1
Update get_sample_data.py for dev-lidar-bridge2
mluck Mar 6, 2025
6332788
Update changelog
mluck Mar 6, 2025
b0b7bff
linting
mluck Mar 6, 2025
7660391
Merge branch 'dev' into dev-update-sample-data-v2
mluck Mar 14, 2025
b12809d
fix local inputs
mluck Mar 14, 2025
0b05c4a
minor edits
mluck Mar 14, 2025
41fbcd8
make ras2fim folder
mluck Mar 14, 2025
eaf1a03
Merge branch 'dev' into dev-update-sample-data-v2
mluck Mar 31, 2025
b386af2
Add edits
mluck Mar 31, 2025
db3e0b4
Merge branch 'dev' into dev-update-sample-data-v1
mluck Apr 2, 2025
aee40ba
Fix for no HUC data found
mluck Apr 2, 2025
d4c4642
Copy bridge elev diff DEM and make bridge elev diff VRT
mluck Apr 9, 2025
7d4a4eb
Merge branch 'dev' into dev-update-sample-data-v2
mluck May 29, 2025
5d05a44
add slope data
mluck Jun 3, 2025
ad448c4
Merge branch 'dev' into dev-update-sample-data-v2
mluck Jun 3, 2025
53b5aba
Merge branch 'dev' into dev-update-sample-data-v2
mluck Jun 14, 2025
4c60203
small fix to changelog
RobHanna-NOAA Jun 17, 2025
28b405a
WIP for udpate for new inputs and input errors
RobHanna-NOAA Jun 18, 2025
a448bee
WIP adjustments to get samples
RobHanna-NOAA Jun 20, 2025
d22f320
Merge branch 'dev' of https://github.com/NOAA-OWP/inundation-mapping …
RobHanna-NOAA Jun 20, 2025
4d94916
Merge branch 'dev' into dev-update-sample-data-v2
mluck Jun 24, 2025
d7965ce
Merge branch 'dev' of https://github.com/NOAA-OWP/inundation-mapping …
RobHanna-NOAA Jun 24, 2025
d15e064
wip fixes
RobHanna-NOAA Aug 18, 2025
4c138db
Merge branch 'dev'
RobHanna-NOAA Aug 18, 2025
e309cbf
udpate changelog
RobHanna-NOAA Aug 18, 2025
49ec7e4
Merge branch 'dev-update-sample-data-v2' of https://github.com/NOAA-O…
RobHanna-NOAA Aug 18, 2025
8afa877
WIP - added s3 hooks
RobHanna-NOAA Aug 25, 2025
e8f342c
local create files completed
Aug 26, 2025
5594071
fix loading bug, re-arrange variables loading
Aug 28, 2025
1ec96bd
s3 working, local working, fails alpha and s3 benchmark pulls
RobHanna-NOAA Aug 28, 2025
3c91bf6
done, now workign with efs and esip
RobHanna-NOAA Sep 3, 2025
e6ee8fc
Update CHANGELOG.md
RobHanna-NOAA Sep 3, 2025
fe0c4f1
re-add makedirs line
RobHanna-NOAA Sep 4, 2025
0a2c799
Upgrade s3 communication tools to add generic aws exception handler
RobHanna-NOAA Sep 10, 2025
c5259de
linting fixes
RobHanna-NOAA Sep 10, 2025
74e05a7
Merge branch 'dev' of https://github.com/NOAA-OWP/inundation-mapping …
RobHanna-NOAA Sep 15, 2025
fa5af45
fix string contains bug
RobHanna-NOAA Sep 16, 2025
598aeda
fix typo
RobHanna-NOAA Sep 16, 2025
8de4dc7
Merge dev and minor adjustments
RobHanna-NOAA Sep 26, 2025
23bdbe4
Minor adust based on merge dev
RobHanna-NOAA Sep 26, 2025
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
3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ Generally, you do not copy this part into the ChangeLog. These are some quick no
- [ ] FIM S3
- [ ] ESIP
- [ ] Dev1
- [ ] UCS2


- Please use caution in removing older version unless it is at least two versions ago. Confirm with DevOps if cleanup might be involved.

- If new or updated data sets, has the FIM code, including running fim_pipeline.sh, been updated and tested with the new/adjusted data? You can dev test against subsets if you like.
Expand Down
3 changes: 3 additions & 0 deletions data/aws/aws_base.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
from utils.shared_functions import FIM_Helpers as fh


# Aug 22, 2025: This is largely deprecated but still usable, but most of the
# calls to S3 shoudl be through the new s3_shared_functions.py file
# See more recent usage via /data/get_sample_data.py
class AWS_Base(object):
'''
This class implements all common variables related when communicating to AWS
Expand Down
Empty file modified data/aws/aws_creds_template.env
100644 → 100755
Empty file.
118 changes: 118 additions & 0 deletions data/aws/aws_shared_functions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#!/usr/bin/env python3

import boto3
import botocore.exceptions


# -------------------------------------------------
def aws_exception_handler(ex):
"""
There are a number of places in this code that can throw exceptions of all types.
This helps with message standarization.

This part will handle the ones it can and return msg's so the client can decide
how to managed it.

A few exceptions will re-throw new exceptions.

"""
msg = ""

if isinstance(ex, botocore.exceptions.NoCredentialsError): # 1000
# bad credentials, NoCredentialsErrors
msg = (
"ERROR: Bad AWS Credentials: There are a number of ways this can fail. You may be missing"
" or have invalid aws access key, aws secret access key or aws region values (case-sensitive)."
" It is also possible that you may have used implicit aws credentials using a default"
" aws credentials file which may be out of sync.\n\n"
" Note: It is possible it has expired. Check your arg values, ensure it has"
" quotes around the arg value or check with your aws bucket owner."
)

elif isinstance(ex, botocore.exceptions.NoAuthTokenError): # 1002
msg = (
"ERROR: AWS Auth Token Error: Part of the authorization process to talk to AWS often, but not"
" always, uses AWS Authorization Tokens. Depending on how you are using AWS authenication, such as"
" AWS Access Key / AWS Secret Key, aws credentials file, there is an error. Review your AWS"
" credentials arguments, file, system, other (case-sensitive)."
)

elif (
(isinstance(ex, botocore.exceptions.NoRegionError))
or (isinstance(ex, botocore.exceptions.InvalidRegionError))
or (isinstance(ex, botocore.exceptions.UnknownRegionError))
): # 1003
msg = (
"ERROR: AWS No Region Value, Invalid or Unknown Region Defined: An aws region value,"
" such as 'us-east-1', needs to be defined, is missing or is invalid (case-sensitive)."
" Review your AWS credentials arguments, file, system, other."
)

# This can be used to catch more specific errors usuall after the client has been created succssfully
elif isinstance(ex, botocore.exceptions.ClientError): # 1001
# Common possibilities are:
# AccessDeniedException
# ValidationException
# NoSuchEntityException
# InvalidParameterException

# Access the error code and message
error_code = ex.response['Error']['Code']
error_message = ex.response['Error']['Message']

if error_code == 'NoSuchBucket':
msg = (
"ERROR: no such bucket: The aws bucket name does not exist."
" Please check the spelling (case-sensitive) or with the aws bucket owner."
)

elif error_code == 'AccessDeniedException':
msg = (
"ERROR: AccessDeniedException: Your authorization to talk to AWS is just fine,"
" but permission to talk to the object (S3 bucket, Step function, etc) is not authorized.\n"
" Talk to your AWS administrator about it."
)

elif error_code == 'SignatureDoesNotMatch':
msg = (
"ERROR: SignatureDoesNotMatch: This generally means the AWS Secret Access key is incorrect."
" Please check the value or with the aws bucket owner. Note: some AWS SA keys can have legitimate"
" non alpha-chars like forward slashs and sometimes copy / paste can mess it up."
)

elif error_code == "404": # File/object does not exist
msg = "ERROR: (404) File or object does not exist"

else:
# catch whatever is left over.
msg = (
"ERROR: Undefined AWS ClientError:"
" An AWS client error has occurred which can be a wide range of possibilities. "
" Please review your AWS credential information in case that it the issue (case-sensitive)."
"\n\n Details: "
f"\n Operation: {ex.operation_name}"
f"\n Error Code: {error_code}"
f"\n Error Message: {error_message}"
)

elif isinstance(ex, botocore.exceptions.BotoCoreError):
# This category encompasses exceptions related to client-side issues within Boto3
# or its underlying library, Botocore, rather than errors returned by AWS services.
# But can also include things like:
# ConnectTimeoutError
# ConnectionClosedError
# EndpointConnectionError

msg = (
"ERROR: BotoCoreError: There are a wide number of things that can occur for"
"this type of error to occur. Generally is with something about communication / connection"
" talking to AWS, but it can also point to a python package problem. It can also be that you"
" supplied in invalid aws region value. Please try it again to see if the error continues.\n\n"
f" Details from AWS: {ex}"
)

else:
# anything left over here we will rethrow, likely not an AWS error
raise (ex)

return msg
3 changes: 3 additions & 0 deletions data/aws/s3.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
'''


# Aug 22, 2025: This is largely deprecated but still usable, but most of the
# calls to S3 shoudl be through the new s3_shared_functions.py file
# See more recent usage via /data/get_sample_data.py
class S3(AWS_Base):
def put_to_bucket(self, src_folder_path, aws_target_path, whitelist_file_path=None):
'''
Expand Down
Loading