In [1]:
%pylab notebook
import matplotlib.pyplot as plt
import numpy as np
Populating the interactive namespace from numpy and matplotlib
In [3]:
%cd /vagrant/source/charistools/test
%ls
/vagrant/source/charistools/test
20010629.MODICE.SOI.EGI.before_fix.txt test_basin.500.melt.png
all_tests.py test_basin.500.tri.imshow.png
all_tests.pyc test_calibration_modelEnv_config.ini
calibration_modelEnv_config.ini test_calibration_modelEnv_config.ini~
calibration_modelEnv_config.ini~ test_convertors.py
compare/ test_convertors.pyc
h23v05.1.v5.dat.npy test.dat
h23v05.1.v6.dat.npy test_files/
h23v05.2.v5.dat.npy test_hypsometry.py
h23v05.2.v6.dat.npy test_hypsometry.pyc
h23v05.3.v5.dat.npy test_meltModels.py
h23v05.3.v6.dat.npy test_meltModels.pyc
h24v05.1.v5.dat.npy test_model_env.ini~
h24v05.1.v6.dat.npy test_modelEnv.py
h24v05.2.v5.dat.npy test_modelEnv.pyc
h24v05.2.v6.dat.npy test_modis_tile_bounds.py
h24v05.3.v5.dat.npy test_modis_tile_bounds.pyc
h24v05.3.v6.dat.npy test_readers.py
__init__.py test_readers.pyc
__init__.pyc test_run_calibration_stats.py
melt_model_config.ini test_run_calibration_stats.py~
modis_tiles_config.ini test_run_calibration_stats.pyc
sca_by_elev.barplot.png test_run_forcings_by_drainageid.py
sca_by_elev.imshow.png test_run_forcings_by_drainageid.py~
SOI_by_elev.2001.0100m.txt test_run_forcings_by_drainageid.pyc
test_ablation_bug.py test_run_forcings_env.ini
test_ablation_bug.py~ test_run_forcings_env.ini~
test_ablation_bug.pyc test_timeSeries.py
test_basin.500.imshow.png test_timeSeries.py~
test_basin.500.input_plot.png test_timeSeries.pyc
In [32]:
h23_v5 = np.load("h23v05.1.v5.dat.npy")
h23_v6 = np.load("h23v05.1.v6.dat.npy")
albedo_h23_v5 = np.load("h23v05.1.v5.dat.albedo.npy")
albedo_h23_v6 = np.load("h23v05.1.v6.dat.albedo.npy")
In [33]:
print(np.amin(h23_v5), np.amax(h23_v5))
print(len(h23_v5[h23_v5 != 0.]))
(0.0, 1.0)
3674
In [34]:
print(np.amin(h23_v6), np.amax(h23_v6))
print(len(h23_v6[h23_v6 != 0.]))
(0.0, 1.0)
3962
In [35]:
fig, ax = plt.subplots(1,2)
ax.shape
ax[0].imshow(h23_v5)
ax[1].imshow(h23_v6)
Out[35]:
<matplotlib.image.AxesImage at 0x7fa194f681d0>
In [36]:
diff = h23_v6 - h23_v5
In [37]:
len(diff[diff != 0])
Out[37]:
288
In [38]:
diff[diff != 0]
Out[38]:
array([ 0.79999995, 0.75 , 0.88 , 0.83999997, 0.81999999,
0.81999999, 0.83999997, 0.77999997, 0.74000001, 0.75999999,
0.81999999, 0.78999996, 0.70999998, 0.81 , 0.88999999,
0.71999997, 0.71999997, 0.81999999, 0.85999995, 0.89999998,
0.78999996, 0.81 , 0.83999997, 0.81999999, 0.83999997,
0.79999995, 0.34999999, 0.78999996, 0.88 , 0.47 ,
0.78999996, 0.59999996, 0.84999996, 0.71999997, 0.74000001,
0.74000001, 0.87 , 0.84999996, 0.88 , 0.37 ,
0.29999998, 0.22999999, 0.75 , 0.63 , 0.66999996,
0.63999999, 0.35999998, 0.55000001, 0.62 , 0.70999998,
0.85999995, 0.78999996, 0.71999997, 0.71999997, 0.82999998,
0.75 , 0.72999996, 0.74000001, 0.75 , 0.69 ,
0.81999999, 0.74000001, 0.71999997, 0.72999996, 0.76999998,
0.70999998, 0.78999996, 0.88 , 0.56999999, 0.53999996,
0.51999998, 0.28999999, 0.28999999, 0.53999996, 0.50999999,
0.56999999, 0.31999999, 0.17 , 0.47999999, 0.48999998,
0.42999998, 0.59999996, 0.56 , 0.41 , 0.63999999,
0.64999998, 0.22999999, 0.22 , 0.51999998, 0.57999998,
0.78999996, 0.78999996, 0.74000001, 0.74000001, 0.75999999,
0.77999997, 0.56999999, 0.52999997, 0.57999998, 0.59999996,
0.88 , 0.72999996, 0.5 , 0.77999997, 0.89999998,
0.88999999, 0.61000001, 0.69999999, 0.75999999, 0.82999998,
0.68000001, 0.66999996, 0.57999998, 0.79999995, 0.56999999,
0.42999998, 0.53999996, 0.79999995, 0.63 , 0.72999996,
0.74000001, 0.22999999, 0.47 , 0.69 , 0.77999997,
0.76999998, 0.71999997, 0.69 , 0.68000001, 0.64999998,
0.42999998, 0.66999996, 0.68000001, 0.88 , 0.88999999,
0.75999999, 0.77999997, 0.63999999, 0.77999997, 0.75999999,
0.81 , 0.70999998, 0.72999996, 0.75999999, 0.72999996,
0.75999999, 0.76999998, 0.77999997, 0.72999996, 0.69999999,
0.78999996, 0.68000001, 0.76999998, 0.79999995, 0.69999999,
0.77999997, 0.81999999, 0.77999997, 0.74000001, 0.74000001,
0.75 , 0.70999998, 0.75 , 0.83999997, 0.55000001,
0.81 , 0.63 , 0.48999998, 0.84999996, 0.82999998,
0.75999999, 0.81 , 0.79999995, 0.76999998, 0.70999998,
0.26999998, 0.76999998, 0.82999998, 0.81 , 0.94999999,
0.94 , 0.82999998, 0.83999997, 0.75999999, 0.88 ,
0.74000001, 0.79999995, 0.41 , 0.56 , 0.39999998,
0.32999998, 0.75 , 0.76999998, 0.75999999, 0.11 ,
0.62 , 0.75999999, 0.76999998, 0.74000001, 0.88 ,
0.74000001, 0.72999996, 0.69999999, 0.88999999, 0.91999996,
0.76999998, 0.71999997, 0.74000001, 0.74000001, 0.70999998,
0.69999999, 0.69 , 0.69999999, 0.84999996, 0.34 ,
0.75 , 0.76999998, 0.69999999, 0.59999996, 0.69 ,
0.69 , 0.64999998, 0.68000001, 0.72999996, 0.74000001,
0.29999998, 0.16 , 0.14999999, 0.19 , 0.19 ,
0.81999999, 0.74000001, 0.65999997, 0.75 , 0.52999997,
0.72999996, 0.69999999, 0.55000001, 0.5 , 0.28 ,
0.78999996, 0.88999999, 0.41999999, 0.63999999, 0.85999995,
0.82999998, 0.69999999, 0.72999996, 0.81 , 0.77999997,
0.61000001, 0.25999999, 0.32999998, 0.69 , 0.81999999,
0.77999997, 0.69 , 0.23999999, 0.12 , 0.37 ,
0.48999998, 0.57999998, 0.63 , 0.57999998, 0.65999997,
0.41999999, 0.56999999, 0.65999997, 0.75 , 0.69 ,
0.55000001, 0.62 , 0.70999998, 0.70999998, 0.78999996,
0.75999999, 0.75999999, 0.45999998, 0.47999999, 0.45999998,
0.72999996, 0.48999998, 0.71999997, 0.95999998, 0.85999995,
0.77999997, 0.94 , 0.94999999], dtype=float32)
In [23]:
3962 - 3674
Out[23]:
288
In [24]:
fig, ax = plt.subplots()
plt.imshow(diff)
Out[24]:
<matplotlib.image.AxesImage at 0x7fa194fdd190>
In [39]:
idx = diff != 0
len(diff[idx])
Out[39]:
288
In [40]:
h23_v5[idx]
Out[40]:
array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0.], dtype=float32)
In [41]:
h23_v6[idx]
Out[41]:
array([ 0.79999995, 0.75 , 0.88 , 0.83999997, 0.81999999,
0.81999999, 0.83999997, 0.77999997, 0.74000001, 0.75999999,
0.81999999, 0.78999996, 0.70999998, 0.81 , 0.88999999,
0.71999997, 0.71999997, 0.81999999, 0.85999995, 0.89999998,
0.78999996, 0.81 , 0.83999997, 0.81999999, 0.83999997,
0.79999995, 0.34999999, 0.78999996, 0.88 , 0.47 ,
0.78999996, 0.59999996, 0.84999996, 0.71999997, 0.74000001,
0.74000001, 0.87 , 0.84999996, 0.88 , 0.37 ,
0.29999998, 0.22999999, 0.75 , 0.63 , 0.66999996,
0.63999999, 0.35999998, 0.55000001, 0.62 , 0.70999998,
0.85999995, 0.78999996, 0.71999997, 0.71999997, 0.82999998,
0.75 , 0.72999996, 0.74000001, 0.75 , 0.69 ,
0.81999999, 0.74000001, 0.71999997, 0.72999996, 0.76999998,
0.70999998, 0.78999996, 0.88 , 0.56999999, 0.53999996,
0.51999998, 0.28999999, 0.28999999, 0.53999996, 0.50999999,
0.56999999, 0.31999999, 0.17 , 0.47999999, 0.48999998,
0.42999998, 0.59999996, 0.56 , 0.41 , 0.63999999,
0.64999998, 0.22999999, 0.22 , 0.51999998, 0.57999998,
0.78999996, 0.78999996, 0.74000001, 0.74000001, 0.75999999,
0.77999997, 0.56999999, 0.52999997, 0.57999998, 0.59999996,
0.88 , 0.72999996, 0.5 , 0.77999997, 0.89999998,
0.88999999, 0.61000001, 0.69999999, 0.75999999, 0.82999998,
0.68000001, 0.66999996, 0.57999998, 0.79999995, 0.56999999,
0.42999998, 0.53999996, 0.79999995, 0.63 , 0.72999996,
0.74000001, 0.22999999, 0.47 , 0.69 , 0.77999997,
0.76999998, 0.71999997, 0.69 , 0.68000001, 0.64999998,
0.42999998, 0.66999996, 0.68000001, 0.88 , 0.88999999,
0.75999999, 0.77999997, 0.63999999, 0.77999997, 0.75999999,
0.81 , 0.70999998, 0.72999996, 0.75999999, 0.72999996,
0.75999999, 0.76999998, 0.77999997, 0.72999996, 0.69999999,
0.78999996, 0.68000001, 0.76999998, 0.79999995, 0.69999999,
0.77999997, 0.81999999, 0.77999997, 0.74000001, 0.74000001,
0.75 , 0.70999998, 0.75 , 0.83999997, 0.55000001,
0.81 , 0.63 , 0.48999998, 0.84999996, 0.82999998,
0.75999999, 0.81 , 0.79999995, 0.76999998, 0.70999998,
0.26999998, 0.76999998, 0.82999998, 0.81 , 0.94999999,
0.94 , 0.82999998, 0.83999997, 0.75999999, 0.88 ,
0.74000001, 0.79999995, 0.41 , 0.56 , 0.39999998,
0.32999998, 0.75 , 0.76999998, 0.75999999, 0.11 ,
0.62 , 0.75999999, 0.76999998, 0.74000001, 0.88 ,
0.74000001, 0.72999996, 0.69999999, 0.88999999, 0.91999996,
0.76999998, 0.71999997, 0.74000001, 0.74000001, 0.70999998,
0.69999999, 0.69 , 0.69999999, 0.84999996, 0.34 ,
0.75 , 0.76999998, 0.69999999, 0.59999996, 0.69 ,
0.69 , 0.64999998, 0.68000001, 0.72999996, 0.74000001,
0.29999998, 0.16 , 0.14999999, 0.19 , 0.19 ,
0.81999999, 0.74000001, 0.65999997, 0.75 , 0.52999997,
0.72999996, 0.69999999, 0.55000001, 0.5 , 0.28 ,
0.78999996, 0.88999999, 0.41999999, 0.63999999, 0.85999995,
0.82999998, 0.69999999, 0.72999996, 0.81 , 0.77999997,
0.61000001, 0.25999999, 0.32999998, 0.69 , 0.81999999,
0.77999997, 0.69 , 0.23999999, 0.12 , 0.37 ,
0.48999998, 0.57999998, 0.63 , 0.57999998, 0.65999997,
0.41999999, 0.56999999, 0.65999997, 0.75 , 0.69 ,
0.55000001, 0.62 , 0.70999998, 0.70999998, 0.78999996,
0.75999999, 0.75999999, 0.45999998, 0.47999999, 0.45999998,
0.72999996, 0.48999998, 0.71999997, 0.95999998, 0.85999995,
0.77999997, 0.94 , 0.94999999], dtype=float32)
In [43]:
albedo_h23_v5[idx]
Out[43]:
array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0.], dtype=float32)
In [44]:
albedo_h23_v6[idx]
Out[44]:
array([-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99., -99., -99., -99., -99., -99., -99., -99., -99., -99.,
-99., -99.], dtype=float32)
In [ ]:
Content source: mjbrodzik/ipython_notebooks
Similar notebooks: