Skip to content

Commit

Permalink
Merge pull request #13 from Cambridge-ICCS/jatkinson1000-naming-patch
Browse files Browse the repository at this point in the history
Patch whitespace on naming exercise updates
  • Loading branch information
AmyOctoCat committed Jul 3, 2024
2 parents f9a016d + 61e5ced commit 50e4972
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions exercises/01_base_code/precipitation_climatology.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def plot_zonal(data):


def get_country_ann_avg(data, countries):

data_avg = data['pr'].groupby('time.year').mean('time', keep_attrs=True)
data_avg = convert_pr_units(data_avg)

Expand Down Expand Up @@ -115,7 +114,6 @@ def get_country_ann_avg(data, countries):


def plot_enso(data):

enso = data['pr'].sel(lat=slice(-1, 1)).sel(lon=slice(120, 280)).mean(dim="lat", keep_attrs=True)
# print(enso)
# .groupby('time.year').mean('time', keep_attrs=True)
Expand Down Expand Up @@ -240,7 +238,6 @@ def main(pr_file, season="DJF", output_file="output.png", gridlines=False, mask=
plt.savefig(output_file, dpi=200) # Save figure to file

if __name__ == '__main__':

input_file = "../../data/pr_Amon_ACCESS-ESM1-5_historical_r1i1p1f1_gn_201001-201412.nc"
# season_to_plot = "DJF"
# season_to_plot = "MAM"
Expand Down
3 changes: 0 additions & 3 deletions exercises/02_formatting/precipitation_climatology.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def plot_zonal(data):


def get_country_ann_avg(data, countries):

data_avg = data['pr'].groupby('time.year').mean('time', keep_attrs=True)
data_avg = convert_pr_units(data_avg)

Expand Down Expand Up @@ -115,7 +114,6 @@ def get_country_ann_avg(data, countries):


def plot_enso(data):

enso = data['pr'].sel(lat=slice(-1, 1)).sel(lon=slice(120, 280)).mean(dim="lat", keep_attrs=True)
# print(enso)
# .groupby('time.year').mean('time', keep_attrs=True)
Expand Down Expand Up @@ -240,7 +238,6 @@ def main(pr_file, season="DJF", output_file="output.png", gridlines=False, mask=
plt.savefig(output_file, dpi=200) # Save figure to file

if __name__ == '__main__':

input_file = "../../data/pr_Amon_ACCESS-ESM1-5_historical_r1i1p1f1_gn_201001-201412.nc"
# season_to_plot = "DJF"
# season_to_plot = "MAM"
Expand Down

0 comments on commit 50e4972

Please sign in to comment.