diff --git a/README.md b/README.md index 3525099..5380a2f 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,14 @@ Near real-time rainfall monitoring. Part of the project RIPOSTE for Cameroon Red Cross Society. ## Description -The pipeline roughly consists of three steps: +Data consumed: +- Level 3 IMERG Early Run: PPS Near Real-time, see https://gpm.nasa.gov/data/directory +- Value: 1-day precipitation accumulation (mm) +- Link to download: https://jsimpsonhttps.pps.eosdis.nasa.gov/imerg/gis/early/ +- Temporal range: most recent past days (e.g. last 14 days) -- Extract daily data on rainfall measurement of the past days (e.g. last 14 days) from [NOAA's GPM](https://gpm.nasa.gov/data/directory) +The pipeline roughly consists of three steps: +- Extract the 1-day data on rainfall measurement as above. - Transform the data into pre-defined areas (health districts) and calculate average rainfall of the past days. Then determine which area has its average rainfall higher than pre-defined thresholds. - Send this data as alert to the EspoCRM for the NS. diff --git a/nrt_rainfall_pipeline/transform.py b/nrt_rainfall_pipeline/transform.py index 1287586..7ca4b21 100644 --- a/nrt_rainfall_pipeline/transform.py +++ b/nrt_rainfall_pipeline/transform.py @@ -55,6 +55,7 @@ def compute_rainfall(self, country: str, dateend): def __calculate_average_raster(self): """ + Scale precipitation x0.1 Sum precipiatation per cell of all raster files and take average per cell """ all_files = glob.glob(f'{self.inputGPM}/{self.country}_*.tif') @@ -68,7 +69,7 @@ def __calculate_average_raster(self): with rasterio.open(f) as src: result_profile = src.profile result_array = result_array + src.read() - result_array = result_array/n + result_array = result_array*0.1/n file_name = f"{self.country}_{self.datestart.strftime('%Y-%m-%d')}_{self.dateend.strftime('%Y-%m-%d')}" with rasterio.open(f"{self.inputGPM}/{file_name}.tif", 'w', **result_profile) as dst: