Views
No views yet
$ pip install -e .$ pip install --no-dependencies -e .ldcast-models.zip. The default is to unzip it to the models directory, but you can also use another location.ldcast.forecast.Forecast class, which will set up all models and data transformations and is callable with a past precipitation array.1from ldcast import forecast
2
3fc = forecast.Forecast(
4 ldm_weights_fn=ldm_weights_fn, autoenc_weights_fn=autoenc_weights_fn
5)
6R_pred = fc(R_past)ldm_weights_fn is the path to the LDM weights and autoenc_weights_fn is the path to the autoencoder weights. R_past is a NumPy array of precipitation rates with shape (timesteps, height, width) where timesteps must be 4 and height and width must be divisible by 32.ldcast.forecast.ForecastDistributed class. The usage is similar to the Forecast class, for example:1from ldcast import forecast
2
3fc = forecast.ForecastDistributed(
4 ldm_weights_fn=ldm_weights_fn, autoenc_weights_fn=autoenc_weights_fn
5)
6R_pred = fc(R_past, ensemble_members=32)R_past should be of shape (cases, timesteps, height, width) where cases is the number of cases you want to process. For each case, ensemble_members predictions are produced (this is the last axis of R_pred). ForecastDistributed automatically distributes the workload to multiple GPUs if you have them.scripts directory. First download the ldcast-demo-20210622.zip file from the Zenodo repository, then unzip it in the data directory. Then run$ python forecast_demo.pyldcast-demo-video-20210622.zip in the data repository. See the function forecast_demo in forecast_demo.py see how the Forecast class works. To run an ensemble mean of 8 members using the ForecastDistributed class, you can use:$ python forecast_demo.py --ensemble-members=8ldcast-datasets.zip file to the data directory.scripts directory, run$ python train_autoenc.py --model_dir="../models/autoenc_train"../models/autoenc_train directory (feel free to change this).nan. If this happens, try restarting from the latest checkpoint:$ python train_autoenc.py --model_dir="../models/autoenc_train" --ckpt_path="../models/autoenc_train/<checkpoint_file>"<checkpoint_file> should be the latest checkpoint in the ../models/autoenc_train/ directory.scripts directory, run$ python train_genforecast.py --model_dir="../models/genforecast_train"$ python train_genforecast.py --model_dir="../models/genforecast_train" --config=<path_to_config_file>config directory. The training checkpoints will be saved in the ../models/genforecast_train directory (again, this can be changed freely).scripts directory:eval_genforecast.py to evaluate LDCasteval_dgmr.py to evaluate DGMR (requires tensorflow installation and the DGMR model from https://github.com/deepmind/deepmind-research/tree/master/nowcasting placed in the models/dgmr directory)eval_pysteps.py to evaluate PySTEPS (requires pysteps installation)metrics.py to produce metrics from the evaluation results produced with the functions in scripts aboveplot_genforecast.py to make plots from the results generated