From 1f7537d20e0ffa4ccde71a5121bbd62218cf4e4b Mon Sep 17 00:00:00 2001 From: Julieanna Bacon Date: Tue, 12 Mar 2024 16:03:52 -0400 Subject: [PATCH] centering crop preprocess: Updated descriptions in the configuration file and tested process more thoroughly --- config/preprocess_netcdf.toml | 6 ++++-- icedyno/preprocess/crop.py | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/preprocess_netcdf.toml b/config/preprocess_netcdf.toml index b3b34c9..49961d5 100644 --- a/config/preprocess_netcdf.toml +++ b/config/preprocess_netcdf.toml @@ -1,12 +1,14 @@ [CropFiles] # Full relative directory is data/input_dir, data/output_dir input_dir = "ims_1km" + # Change this output_dir name to reflect the window size and center coordinates selected -output_dir = "ims_netcdf_1km_cropped_4_000_000m_window" +# Example: _50000x_15000y +output_dir = "ims_netcdf_1km_cropped_4_000_000m_window # Final shape will be (window_size*2, window_size*2) window_size = 4000 #km # Expect str format in x,y coordinates if provided. Example: "1000, 2000" # Defaults to center of current grid system if "None" -center_coordinates = "1000, 1500"#None" +center_coordinates = "None" diff --git a/icedyno/preprocess/crop.py b/icedyno/preprocess/crop.py index 1c8d42b..12420cb 100644 --- a/icedyno/preprocess/crop.py +++ b/icedyno/preprocess/crop.py @@ -78,7 +78,6 @@ def run(self) -> None: x=slice(x_coord - window, x_coord + window), y=slice(y_coord - window, y_coord + window), ) - # Write the cropped data to a new NetCDF file cropped_ds.to_netcdf(output_filename, engine="h5netcdf")