Skip to content

Commit

Permalink
Tidied
Browse files Browse the repository at this point in the history
  • Loading branch information
RachelMurray-Watson committed Jan 14, 2025
1 parent 4a1567c commit 86878eb
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/scripts/climate_change/CIL_CMIP6_downscaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def extract_nc_files_from_unzipped_folders(directory):
nc_file_directory = os.path.join(base_dir, 'nc_files')
# NB these are daily
scenarios = ["ssp245", "ssp585"]

scenarios = ["spp585"]
data_by_model_and_grid = {}
for scenario in scenarios:
print(scenario)
Expand All @@ -162,9 +162,9 @@ def extract_nc_files_from_unzipped_folders(directory):
file_pattern = os.path.join(file_path_downscaled, "CIL_subset_ssp245_*.nc")
data_all_models = xr.open_mfdataset(file_pattern, combine='nested', concat_dim="time")
data_all_models.compute()

data_all_models.to_netcdf(output_file)
#data_all_models = xr.open_dataset(file_path_downscaled)
#output_dir = "/Users/rem76/Desktop/Climate_change_health/Data/Precipitation_data/Downscaled_CMIP6_data_CIL/"
#output_path = os.path.join(output_dir, output_file)
#data_all_models.to_netcdf(output_path)

## Get models of interest - min, med, max
# Assuming 'pr' is the variable representing precipitation in the dataset
Expand All @@ -186,7 +186,6 @@ def extract_nc_files_from_unzipped_folders(directory):
max_model = max_model_object.values.item()

models_of_interest = [min_model, median_model, max_model]
#models_of_interest = [median_model]

print("Models of interest", models_of_interest)
# see which facilities have reporting data and data on latitude and longitude
Expand Down

0 comments on commit 86878eb

Please sign in to comment.