diff --git a/CHANGELOG.md b/CHANGELOG.md index 180ded48..32972c10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add functions used for producing RFF weights. ([PR #66](https://github.com/ClimateImpactLab/dscim/pull/66), [@davidrzhdu](https://github.com/davidrzhdu)) ### Changed +- Included US territories in damages and economic variable subsetting. ([PR #78](https://github.com/ClimateImpactLab/dscim/pull/78), [@JMGilbert](https://github.com/JMGilbert)) - Changed format of `eta_rhos` to allow for multiple values of `rho` for the same `eta`. ([PR #65](https://github.com/ClimateImpactLab/dscim/pull/65), [@JMGilbert](https://github.com/JMGilbert)) - Remove diagnostics module. ([PR #60](https://github.com/ClimateImpactLab/dscim/pull/60), [@JMGilbert](https://github.com/JMGilbert)) - Remove old/unnecessary files. ([PR #57](https://github.com/ClimateImpactLab/dscim/pull/57), [@JMGilbert](https://github.com/JMGilbert)) diff --git a/src/dscim/preprocessing/preprocessing.py b/src/dscim/preprocessing/preprocessing.py index 7752bfc5..67fb2eec 100644 --- a/src/dscim/preprocessing/preprocessing.py +++ b/src/dscim/preprocessing/preprocessing.py @@ -257,7 +257,25 @@ def subset_USA_reduced_damages( f"{input_path}/{sector}/{recipe}_{reduction}_eta{eta}.zarr", ) - subset = ds.sel(region=[i for i in ds.region.values if "USA" in i]) + US_territories = [ + "USA", + "XBK", + "GUM", + "XHO", + "XJV", + "XJA", + "XKR", + "XMW", + "XNV", + "MNP", + "XPL", + "PRI", + "VIR", + "XWK", + ] + subset = ds.sel( + region=[i for i in ds.region.values if any(j in i for j in US_territories)] + ) for var in subset.variables: subset[var].encoding.clear() @@ -285,7 +303,25 @@ def subset_USA_ssp_econ( consolidated=True, ) - zarr = zarr.sel(region=[i for i in zarr.region.values if "USA" in i]) + US_territories = [ + "USA", + "XBK", + "GUM", + "XHO", + "XJV", + "XJA", + "XKR", + "XMW", + "XNV", + "MNP", + "XPL", + "PRI", + "VIR", + "XWK", + ] + zarr = zarr.sel( + region=[i for i in zarr.region.values if any(j in i for j in US_territories)] + ) for var in zarr.variables: zarr[var].encoding.clear()