Skip to content

Commit

Permalink
put back change on lambda function
Browse files Browse the repository at this point in the history
  • Loading branch information
RobHanna-NOAA committed Oct 31, 2024
1 parent d29300f commit c95e6c2
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions Core/LAMBDA/viz_functions/viz_db_ingest/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,6 @@ def lambda_handler(event, context):
ds = xr.open_dataset(download_path)
ds_vars = [var for var in ds.variables]

match = re.search(r'common/data/model/com/nwm/prod/nwm.\d{8}/(.*)', file)
test_bucket = 'hydrovis-ti-deployment-us-east-1'
s3_fname = f'test_nwm_outputs/{match.group(1)}'
local_fname = f'/tmp/{match.group(1)}'
if 'forcing' in file:
interest_val = 'RAINRATE'
elif 'channel_rt' in file:
interest_val = 'streamflow'
elif 'coastal' in file:
interest_val = 'elevation'
elif 'reservoir' in file:
interest_val = 'water_sfc_elev'

try:
check_if_file_exists(test_bucket, s3_fname, download=False)
except:
ds['streamflow'] = (ds['streamflow'] + 1) * 1000
ds.to_netcdf(local_fname)
s3.upload_file(local_fname, test_bucket, s3_fname)

if not target_cols:
target_cols = ds_vars

Expand Down

0 comments on commit c95e6c2

Please sign in to comment.