fig = plt.figure(figsize=(width, height)) avgp = [] avgv = [] provs = ["Churchill Province", "Superior Province", "Slave Province", "Grenville Province"] color = ["b", "g", "m", "y", "k", "c"] handles = () labels = () plt.subplots_adjust(left=None, bottom=None, right=0.75, top=None, wspace=None, hspace=0.05) for (ii, province) in enumerate(provs): d.reset() arg = Args() arg.addQuery("geoprov", "in", province) d2 = Params(stnfile, ["hk::H", "hk::R"], arg) d.sync(d2) prov = province.replace(" ", "") dk, avgdk, bins, ptype = getdata("kan", d, m, vdict, prov) avgp.append(avgdk) ax = plt.subplot(4, 1, ii + 1) n, bins, patches = plt.hist( dk, bins=bins, histtype="bar", color=color[ii], rwidth=1, alpha=0.6, label=province )
arg3 = Args() arg3.addQuery("hk::H", "lt", "35") arg4 = Args() fstns = os.environ['HOME'] + '/thesis/stations.json' a = Params(fstns, arg1, ["mb::H"]) b = Params(fstns, arg2, ["mb::H"]) c = Params(fstns, arg2, ["hk::H"]) d = Params(fstns, arg3, ["hk::H"]) e = Params(fstns, arg3, ["wm::H"]) f = Params(fstns, arg4, ["wm::H"]) lena = len(a.mb_H) a.sync(b) assert len(a.reset().mb_H) == lena assert np.equal(a.sync(b).mb_H, b.sync(a).mb_H).all() c.sync(d.sync(e.sync(f))) for ii in range(len(f.stns)): assert c.stns[ii] == f.stns[ii] assert c.hk_H[ii] == d.hk_H[ii] assert f.sync(d) == f.reset().sync(e) c.reset() d.reset() e.reset() f.reset()
arg3.addQuery("hk::H", "lt", "35") arg4 = Args() fstns = os.environ['HOME'] + '/thesis/stations.json' a = Params(fstns, arg1, ["mb::H"]) b = Params(fstns, arg2, ["mb::H"]) c = Params(fstns, arg2, ["hk::H"]) d = Params(fstns, arg3, ["hk::H"]) e = Params(fstns, arg3, ["wm::H"]) f = Params(fstns, arg4, ["wm::H"]) lena = len(a.mb_H) a.sync(b) assert len(a.reset().mb_H) == lena assert np.equal(a.sync(b).mb_H, b.sync(a).mb_H).all() c.sync(d.sync(e.sync(f))) for ii in range(len(f.stns)): assert c.stns[ii] == f.stns[ii] assert c.hk_H[ii] == d.hk_H[ii] assert f.sync(d) == f.reset().sync(e) c.reset() d.reset() e.reset() f.reset()
provs = [ "Churchill Province", "Superior Province", "Slave Province", "Grenville Province" ] color = ['b', 'g', 'm', 'y', 'k', 'c'] handles = () labels = () plt.subplots_adjust(left= None, bottom=None, right = 0.75, top=None, wspace=None, hspace=0.05) for (ii, province) in enumerate(provs): d.reset() arg = Args() arg.addQuery("geoprov", "in", province) d2 = Params(stnfile, ["hk::H","hk::R"], arg) d.sync(d2) prov = province.replace(" ", "") dk, avgdk, bins, ptype = getdata("kan", d, m, vdict, prov) avgp.append( avgdk ) ax = ( plt.subplot(4,1,ii + 1) ) n, bins, patches = plt.hist(dk, bins = bins, histtype = "bar", color = color[ii], rwidth = 1, alpha = 0.6, label = province)