Skip to content

Commit

Permalink
update data and plots to run through feb 2023; include time series of…
Browse files Browse the repository at this point in the history
… annual maxima at different durations in data/outputs
  • Loading branch information
jdossgollin committed Jan 17, 2024
1 parent 8d47a23 commit cc5a85d
Show file tree
Hide file tree
Showing 24 changed files with 542 additions and 46 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
nohup.out

data/raw/
data/processed/
.snakemake/
Expand Down
4 changes: 2 additions & 2 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ rule ghcn_subset:
script=scriptdir("ghcn_subset.py"),
stations=datadir("raw", "ghcnd_stations.txt"),
output:
datadir("processed", "ghnd", "valid_stations.csv"),
datadir("processed", "ghcnd", "valid_stations.csv"),
shell:
"python {input.script} -i {input.stations} -o {output}"

Expand All @@ -201,7 +201,7 @@ rule ghcn_subset:
rule historical_exceedance:
input:
script=scriptdir("ghcn_return_period.py"),
stations=datadir("processed", "ghnd", "valid_stations.csv"),
stations=datadir("processed", "ghcnd", "valid_stations.csv"),
output:
datadir("processed", "ghcnd", "return_periods.csv"),
shell:
Expand Down
Binary file added data/outputs/hdd_annual_ercot.nc
Binary file not shown.
Binary file modified fig/ERCOT_HDD_IDF_MLE_popweighted.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fig/ERCOT_HDD_IDF_MLE_popweighted.pdf
Binary file not shown.
Binary file modified fig/ERCOT_HDD_IDF_MLE_unweighted.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fig/ERCOT_HDD_IDF_MLE_unweighted.pdf
Binary file not shown.
Binary file modified fig/ERCOT_HDD_IDF_plotpos_popweighted.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fig/ERCOT_HDD_IDF_plotpos_popweighted.pdf
Binary file not shown.
Binary file modified fig/ERCOT_HDD_IDF_plotpos_unweighted.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fig/ERCOT_HDD_IDF_plotpos_unweighted.pdf
Binary file not shown.
Binary file modified fig/HDD_pop_weighted_ts.pdf
Binary file not shown.
Binary file modified fig/historic_events_bk.pdf
Binary file not shown.
Binary file modified fig/historic_events_era5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fig/historic_events_era5.pdf
Binary file not shown.
Binary file modified fig/historic_events_era5_TX.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fig/historic_events_era5_TX.pdf
Binary file not shown.
Binary file modified fig/local_rt_era5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fig/local_rt_era5.pdf
Binary file not shown.
Binary file modified fig/local_rt_ghcnd.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fig/local_rt_ghcnd.pdf
Binary file not shown.
10 changes: 8 additions & 2 deletions scripts/era5_return.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ def main() -> None:
parser.add_argument("-o", "--outfile", type=str)
args = parser.parse_args()

temp = xr.open_mfdataset(args.infiles)["t2m"].compute()
# this makes the workflow easier to debug and run in a notebook vs
# using args.infiles and args.outfile
infiles = args.infiles
outfile = args.outfile

# read in the raw data
temp = xr.open_mfdataset(infiles)["t2m"].compute().isel(expver=1).drop_vars("expver")
temp_roll = xr.concat(
[
temp.rolling(time=dur).mean().assign_coords({"duration": dur})
Expand Down Expand Up @@ -57,7 +63,7 @@ def main() -> None:
dict(longitude=lon, latitude=lat, duration=duration)
] = rt_estimate

era5_return.to_netcdf(args.outfile, format="NETCDF4")
era5_return.to_netcdf(outfile, format="NETCDF4")


if __name__ == "__main__":
Expand Down
488 changes: 478 additions & 10 deletions scripts/hdd_idf.ipynb

Large diffs are not rendered by default.

84 changes: 52 additions & 32 deletions scripts/local_return_period.ipynb

Large diffs are not rendered by default.

0 comments on commit cc5a85d

Please sign in to comment.