oceanmodeling / ondemand-storm-workflow

Other
2 stars 1 forks source link

getting `ValueError` for running workflow for `Irene 2011` #29

Closed FariborzDaneshvar-NOAA closed 11 months ago

FariborzDaneshvar-NOAA commented 11 months ago

./workflow.sh irene 2011 command failed at Creating OFCL track for 48 hours before landfall forecast... step with the following error message:

2023-09-13:22:58:20,589 INFO     [hurricane_data.py:104] Creating OFCL track for 48 hours before landfall forecast...
Traceback (most recent call last):
  File "/opt/conda/envs/info/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/conda/envs/info/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/scripts/hurricane_data.py", line 323, in <module>
    main(args)
  File "/scripts/hurricane_data.py", line 110, in main
    leastdiff_idx = np.argmin(abs(start_times - prescribed))
  File "/opt/conda/envs/info/lib/python3.9/site-packages/pandas/core/ops/common.py", line 76, in new_method
    return method(self, other)
  File "/opt/conda/envs/info/lib/python3.9/site-packages/pandas/core/arraylike.py", line 198, in __rsub__
    return self._arith_method(other, roperator.rsub)
  File "/opt/conda/envs/info/lib/python3.9/site-packages/pandas/core/series.py", line 5820, in _arith_method
    return base.IndexOpsMixin._arith_method(self, other, op)
  File "/opt/conda/envs/info/lib/python3.9/site-packages/pandas/core/base.py", line 1381, in _arith_method
    result = ops.arithmetic_op(lvalues, rvalues, op)
  File "/opt/conda/envs/info/lib/python3.9/site-packages/pandas/core/ops/array_ops.py", line 275, in arithmetic_op
    res_values = op(left, right)
  File "/opt/conda/envs/info/lib/python3.9/site-packages/pandas/core/roperator.py", line 15, in rsub
    return right - left
  File "/opt/conda/envs/info/lib/python3.9/site-packages/pandas/core/ops/common.py", line 76, in new_method
    return method(self, other)
  File "/opt/conda/envs/info/lib/python3.9/site-packages/pandas/core/arrays/datetimelike.py", line 1420, in __sub__
    result = self._sub_datetime_arraylike(other)
  File "/opt/conda/envs/info/lib/python3.9/site-packages/pandas/core/arrays/datetimelike.py", line 1106, in _sub_datetime_arraylike
    raise ValueError("cannot add indices of unequal length")
ValueError: cannot add indices of unequal length
ERROR conda.cli.main_run:execute(49): `conda run python -m hurricane_data --date-range-outpath /lustre/hurricanes/irene_2011_a045d496-3273-4b66-bcb6-02749ea49e2c/setup/dates.csv --track-outpath /lustre/hurricanes/irene_2011_a045d496-3273-4b66-bcb6-02749ea49e2c/nhc_track/hurricane-track.dat --swath-outpath /lustre/hurricanes/irene_2011_a045d496-3273-4b66-bcb6-02749ea49e2c/windswath --station-data-outpath /lustre/hurricanes/irene_2011_a045d496-3273-4b66-bcb6-02749ea49e2c/coops_ssh/stations.nc --station-location-outpath /lustre/hurricanes/irene_2011_a045d496-3273-4b66-bcb6-02749ea49e2c/setup/stations.csv --past-forecast --hours-before-landfall -1 --lead-times /lustre/static_data/leadtimes.json irene 2011` failed. (See above for error)
SorooshMani-NOAA commented 11 months ago

@FariborzDaneshvar-NOAA thanks for bringing this to my attention. I just realized some storms have multiple entries for lead times, due to having multiple landfalls. For now I'll modify the code to just pick the first landfall. I'll let you know once I update the code so that you can test and close this ticket. Thanks!

FariborzDaneshvar-NOAA commented 11 months ago

@SorooshMani-NOAA Thanks for looking into this and fixing it. With the new fix, the workflow is working now!