Skip to content

Commit

Permalink
Update past forecast track
Browse files Browse the repository at this point in the history
  • Loading branch information
SorooshMani-NOAA committed Oct 24, 2023
1 parent 0b274e0 commit 6cd79d3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
7 changes: 2 additions & 5 deletions docker/info/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ RUN conda install mamba -n base -c conda-forge && \
mamba env create --prefix $ENV_PREFIX --file /tmp/environment.yml --force && \
mamba clean --all --yes

RUN git clone https://github.com/oceanmodeling/stormevents && \
git -C stormevents checkout 2ebcc72 && \
conda run -p $ENV_PREFIX --no-capture-output \
pip install ./stormevents && \
rm -rf stormevents
RUN conda run -p $ENV_PREFIX --no-capture-output \
pip install stormevents==2.1.2

ENV CONDA_DIR /opt/conda

Expand Down
28 changes: 16 additions & 12 deletions docker/info/docker/hurricane_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ def main(args):
# NOTE: Track taken from `StormEvent` object is up to now only.
# See GitHub issue #57 for StormEvents
track = VortexTrack(nhc_code, file_deck='a', advisories=[advisory])
windswath_dict = track.wind_swaths(wind_speed=34)
windswaths = windswath_dict[advisory]

df_dt = pd.DataFrame(columns=['date_time'])

Expand All @@ -98,12 +96,16 @@ def main(args):
].track_start_time.iloc[-1]

gdf_track = track.data[track.data.track_start_time == track_start]
# Append before track from previous forecasts:
gdf_track = pd.concat((
track.data[
(track.data.track_start_time < track_start)
& (track.data.forecast_hours == 0)
],
gdf_track
))
df_dt['date_time'] = (track.start_date, track.end_date)

logger.info(f"Fetching {advisory} windswath...")
windswath = windswaths[
track_start.strftime("%Y%m%dT%H%M%S")
]

logger.info("Fetching water level measurements from COOPS stations...")
coops_ssh = event.coops_product_within_isotach(
Expand All @@ -121,12 +123,6 @@ def main(args):
# Put both dates as now(), for pyschism to setup forecast
df_dt['date_time'] = (now, now)

logger.info(f"Fetching {advisory} windswath...")
latest_advistory_stamp = max(pd.to_datetime(list(windswaths.keys())))
windswath = windswaths[
latest_advistory_stamp.strftime("%Y%m%dT%H%M%S")
]

coops_ssh = None

# NOTE: Fake besttrack: Since PySCHISM supports "BEST" track
Expand All @@ -136,6 +132,14 @@ def main(args):
gdf_track.forecast_hours = 0
track = VortexTrack(storm=gdf_track, file_deck='b', advisories=['BEST'])

windswath_dict = track.wind_swaths(wind_speed=34)
windswaths = windswath_dict['BEST'] # Faked BEST
logger.info(f"Fetching {advisory} windswath...")
windswath_time = min(pd.to_datetime(list(windswaths.keys())))
windswath = windswaths[
windswath_time.strftime("%Y%m%dT%H%M%S")
]

else:

logger.info("Fetching b-deck track info...")
Expand Down
2 changes: 1 addition & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ resource "aws_ecs_task_definition" "odssm-info-task" {
container_definitions = jsonencode([
{
name = "info"
image = "${aws_ecr_repository.odssm-repo["odssm-info"].repository_url}:v0.10"
image = "${aws_ecr_repository.odssm-repo["odssm-info"].repository_url}:v0.11"

essential = true

Expand Down

0 comments on commit 6cd79d3

Please sign in to comment.