From a0df14a586dd3be6e9f2f6c16d9e42f3f3a7754f Mon Sep 17 00:00:00 2001 From: Sai Ma Date: Tue, 6 Aug 2024 05:34:42 +0000 Subject: [PATCH] Display all detail during processing --- scripts/vic_rf_processing_script.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/vic_rf_processing_script.py b/scripts/vic_rf_processing_script.py index d07ebb5..9e38632 100644 --- a/scripts/vic_rf_processing_script.py +++ b/scripts/vic_rf_processing_script.py @@ -399,6 +399,9 @@ def vic_rf_processing( # Plot the water mask wo_mask = wo.frequency > 0.2 + print("predicted") + print(predicted) + predicted_wofs = xr.where(wo_mask == 0, predicted, 0) logger.info("Apply WO Summary masking") @@ -410,6 +413,9 @@ def vic_rf_processing( # Remove the time index from the xr dataarray all_burn = predicted_wofs.Predictions.isel(time=0) + print("all_burn") + print(all_burn) + # Perform an opening morphological operation on the `all_burn` dataarray opened_data = xr.DataArray( morphology.binary_opening(all_burn, morphology.disk(disk_size)), @@ -437,9 +443,15 @@ def vic_rf_processing( pred_tif = output_product_name + f"_{nm_xy}_{nm_date}_pred.tif" + print("all_burn_cleaned") + print(all_burn_cleaned) + + all_burn_cleaned = all_burn_cleaned[0].squeeze() + + print("all_burn_cleaned again") print(all_burn_cleaned) - write_cog(geo_im=all_burn_cleaned[0].squeeze(), fname=pred_tif, overwrite=True, nodata=-999) + write_cog(geo_im=all_burn_cleaned, fname=pred_tif, overwrite=True, nodata=-999) logger.info("Save result as: " + str(pred_tif))