Skip to content

Instantly share code, notes, and snippets.

@mankoff
Last active June 12, 2022 11:47
Show Gist options
  • Save mankoff/7d5eb8dee1fa7e5aa6ae44957caa9b45 to your computer and use it in GitHub Desktop.
Save mankoff/7d5eb8dee1fa7e5aa6ae44957caa9b45 to your computer and use it in GitHub Desktop.
freshwater v2 vs v3 update

Table of contents

Introduction

This document shows changes between the v2 and v3 freshwater discharge product.

Code and text difference

Changes to the code and manuscript can be seen by viewing the difference between the latest (eventually: v3 tag) and the earlier (v2 tag) of the git repository on GitHub (insert link).

Data difference

The data product has changed for the following reasons:

  • Upgrade BedMachine from v3 to v4
  • Upgrade regional climate model (RCM) inputs

The BedMachine upgrade can lead to significant regional changes, because upstream subglacial ice basins may change their boundaries.

By chance, the arbitrary box in the README.org used to demonstrate how to to use the data and provided code interface has a significant change, nearly doubling the discharge into this box. Here we explore why, and perform some quality control. We expect the neighboring basin should decrease discharge by roughly the amount that this basin increases discharge.

Old vs new discharge

The original README example discharge graphic is re-created here, except we use the command-line interface rather than the Python interface to collect the data, then plot and compare.

Extract time series

Graphics

Original README graphic

./api_example.png

Recreate using ‘old’ data

df = pd.read_csv('./dat/old_roi.csv', index_col=0)
df[['MAR_ice','RACMO_ice']]\
    .loc['2012-04-01':'2012-11-15']\
    .rolling(5)\
    .mean()\
    .plot(drawstyle='steps')
savefig('./old_roi.png', bbox_inches='tight')
  • Although the colors are different, the data in the plot appears to be exactly the same.

./old_roi.png

Recreate using ‘new’ data

df = pd.read_csv('./dat/new_roi.csv', index_col=0)
df[['MAR_ice','RACMO_ice']]\
    .loc['2012-04-01':'2012-11-15']\
    .rolling(5)\
    .mean()\
    .plot(drawstyle='steps')
savefig('./new_roi.png', bbox_inches='tight')
Note
graphics appear roughly the same, but the x-axis has nearly doubled.

./new_roi.png

Old vs new map

The easiest way to view the changes between the two graphics below is to open each in a new browser tab or window, and then use your keyboard to toggle back-and-forth between the two.

Old - overview

./old_overview_map.png

New - overview

./new_overview_map.png

Old - detail

./old_detail_map.png

New - detail

./new_detail_map.png

Compare using upstream basins

Recreate using ‘old’ data

df = pd.read_csv('./dat/old_roi.csv', index_col=0)
df.loc['2012-04-01':'2012-11-15']\
  .rolling(5)\
  .mean()\
  .plot(drawstyle='steps')
savefig('./old_all.png', bbox_inches='tight')

./old_all.png

Recreate using ‘new’ data

df = pd.read_csv('./dat/new_roi.csv', index_col=0)
df.loc['2012-04-01':'2012-11-15']\
  .rolling(5)\
  .mean()\
  .plot(drawstyle='steps')
savefig('./new_all.png', bbox_inches='tight')

./new_all.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment