The MIT License (MIT)
Copyright (c) 2016,2017 Massachusetts Institute of Technology

Authors: Justin Li, Cody Rude
This software has been created in projects supported by the US National
Science Foundation and NASA (PI: Pankratius)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


In [1]:
%matplotlib notebook
import matplotlib.pyplot as plt

In [2]:
# Gravity Recovery and Climate Experiment (GRACE) Data
# Source: http://grace.jpl.nasa.gov/
# Current surface mass change data, measuring equivalent water thickness in cm, versus time
# with a resolution of 1x1 degree

In [3]:
from skdaccess.geo.grace import DataFetcher as GR_DF
from skdaccess.utilities.grace_util import computeEWD
from skdaccess.framework.param_class import *

In [4]:
geo_point = AutoList([(38, -117)]) # location in Nevada
grace_fetcher = GR_DF([geo_point],start_date='2010-01-01',end_date='2014-01-01')

In [5]:
grace_data_wrapper = grace_fetcher.output() # Get a data wrapper
grace_data = grace_data_wrapper.get() # Get GRACE data

In [6]:
grace_data['38, -117'].head()


Out[6]:
CSR GFZ JPL
Date
2010-01-17 00:00:00 -1.564813 -2.012964 -3.849506
2010-02-15 12:00:00 3.270973 2.980853 2.286743
2010-03-17 00:00:00 5.448462 3.252425 5.566326
2010-04-16 12:00:00 6.534275 4.658304 4.388913
2010-05-17 00:00:00 6.079895 4.922144 2.370604

In [7]:
# Calibrate GRACE
scale_factor = grace_data_wrapper.info('38, -117')['scale_factor']
combined_ewd = computeEWD(grace_data['38, -117'], scale_factor)

In [8]:
# Plot calibrated data
plt.figure();
plt.plot(combined_ewd);
plt.tight_layout()