Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tc_tracks_forecast seems to fail for new files #157

Open
ThomasRoosli opened this issue Jan 28, 2025 · 1 comment
Open

tc_tracks_forecast seems to fail for new files #157

ThomasRoosli opened this issue Jan 28, 2025 · 1 comment

Comments

@ThomasRoosli
Copy link
Collaborator

tc tracks downloads files automatically from an FTP server of ECMWF. It used to work and now it fails.
The files are named differently now as the were before and the filter in

test = TCForecast()
test.fetch_ecmwf(remote_dir='20250115000000')
works, wereas
test = TCForecast()
test.fetch_ecmwf()
will fail with a FileNotFoundError, this used to work.

Possible solution:
The filter in

remotefiles = fnmatch.filter(remotefiles_temp, '*ECEP*')
needs to be adapted, to correctly filter the filenames currently in the ftp.

PS: the working example will only work for +-14 days. Afterwards the respective files will no longer be available at the ftp server of ECMWF
PPS: the ci_overnight test of climada_petals could be adapted to test this ftp connection.

@elianekobler
Copy link
Collaborator

The provided test works for me in an environment with climada_python v4.1.1 and climada_petals v4.1.0 installed.
It also works sometimes on n2o, with recent climada versions: when running a bash script to execute fetch_ecmwf() in the command line it works, when running the same bash script with a cronjob it is working sometimes and sometimes not.
When it is not working I get the following error:

Traceback (most recent call last):
  File "/home/climada_workspace/climada_petals/climada_petals/hazard/tc_tracks_forecast.py", line 215, in fetch_bufr_ftp
    raise FileNotFoundError(msg)
FileNotFoundError: No tracks found at ftp://{}/{}

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/wcr/tc_imp_forecast/TC_imp_forecast/git_repo/TC_impact_forecast_sandbox/plot_tracks_overview_daily.py", line 37, in <module>
    tr_fcast.fetch_ecmwf()
  File "/home/climada_workspace/climada_petals/climada_petals/hazard/tc_tracks_forecast.py", line 149, in fetch_ecmwf
    files = self.fetch_bufr_ftp(target_dir, remote_dir)
  File "/home/climada_workspace/climada_petals/climada_petals/hazard/tc_tracks_forecast.py", line 233, in fetch_bufr_ftp
    raise type(err)('Error while downloading BUFR TC tracks: ' + str(err)) from err
FileNotFoundError: Error while downloading BUFR TC tracks: No tracks found at ftp://{}/{}

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

No branches or pull requests

2 participants