diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9de84a7..c9fc908 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,9 +28,10 @@ repos: rev: "7.1.1" hooks: - id: flake8 - args: [--max-line-length=88] + args: [--max-line-length=88, "--ignore=E203,W503"] - repo: https://github.com/codespell-project/codespell rev: v2.3.0 hooks: - id: codespell + args: [--ignore-words-list=readin] diff --git a/README.md b/README.md index cd8e08b..1f046fb 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,17 @@ Repository for a fire spread forecast model, generating hourly fire radiative power (FRP) prediction for air quality forecasting applications. -## Required python libraries +## Required Python libraries -- Numpy -- pandas -- SciPy +- Keras +- Matplotlib (for output plotting only) - MetPy -- datetime - netCDF4 -- Matplotlib (for output plotting only) +- NumPy +- pandas +- SciPy - Tensorflow -- Keras +- xarray - XGBoost ## Components @@ -73,7 +73,7 @@ Trained machine learning models are available in `model/fira_models.zip` 1. Filename format: `[input name].[start time].f[simuluation time].nc` `input name` and `start time` can be specified in namelist. -2. Input netcdf file components: +2. Input netCDF file components: | **Variable Name** | **Variable Description** | | ------------------- | ---------------------------------------------------------------------------------- | @@ -110,7 +110,7 @@ Trained machine learning models are available in `model/fira_models.zip` 1. Filename format: `[output name].[start time].f[forecast hour].nc` `output name` and `start time` can be specified in namelist. -2. Output netcdf file components: +2. Output netCDF file components: | **Variable Name** | **Variable Description** | | ------------------- | ---------------------------------------------------------------------- | diff --git a/src/fire_inputgen.py b/src/fire_inputgen.py index c1a1578..dc900e5 100755 --- a/src/fire_inputgen.py +++ b/src/fire_inputgen.py @@ -645,6 +645,7 @@ def main_driver(initial_hour, forecast_hour, f_input, f_output, lat_lim, lon_lim lw[lw == 0] = np.nan # fire frame + INPUTFRAME = LATFRAME = LONFRAME = None for j in np.arange(1, num + 1, 1): total = total + 1 index = np.argwhere(lw == j) @@ -680,7 +681,7 @@ def main_driver(initial_hour, forecast_hour, f_input, f_output, lat_lim, lon_lim loc[0] - fsize : loc[0] + fsize + 1, loc[1] - fsize : loc[1] + fsize + 1 ] - if "INPUTFRAME" in locals(): + if INPUTFRAME is not None: INPUTFRAME = np.append(INPUTFRAME, np.expand_dims(X_fire, axis=0), axis=0) LATFRAME = np.append(LATFRAME, np.expand_dims(X_lat, axis=0), axis=0) LONFRAME = np.append(LONFRAME, np.expand_dims(X_lon, axis=0), axis=0)