コード例 #1
0
def make_subplots(nrow, ncol, nplots, filenames, columns, name, titles):
    for iplot in range(nplots):
        plt.subplot(nrow, ncol, iplot + 1)
        plt.title(titles[iplot])
        plt.xlabel('Time (years)', fontsize=14, fontweight='bold')
        if iplot == 0:
            plt.ylabel('Temperature (C)', fontsize=14, fontweight='bold')
        elif iplot == 1:
            plt.ylabel('Saturation (-)', fontsize=14, fontweight='bold')

        plt.xlim(-20., 1.e2)
        if iplot == 0: plt.ylim(25., 150.)
        elif iplot == 1: plt.ylim(0., 1.)
        plt.grid(True)

        for icol in range(
                iplot * len(columns) / nplots,
                iplot * len(columns) / nplots + len(columns) / nplots):
            ifile = icol
            data = pft.Dataset(filenames[ifile], 1, columns[icol])
            string = name[icol]
            plt.plot(data.get_array('x'),
                     data.get_array('y'),
                     color=colors[icol],
                     linestyle=linestyles[icol],
                     label=string)
コード例 #2
0
def make_subplots(nrow, ncol, nplots, filenames, columns, name, titles):
  for iplot in range(nplots):
    plt.subplot(nrow,ncol,iplot+1)
    plt.title(titles[iplot])
    plt.xlabel('Time (years)', fontsize=14, fontweight='bold')
    plt.ylabel('Mineral Volume Fraction (-)', fontsize=14, fontweight='bold')

    plt.xlim(0.,1.5e2)
    #plt.ylim(0., 1.e-3)
    plt.grid(True)

    for icol in range(iplot*len(columns)/nplots,iplot*len(columns)/nplots+len(columns)/nplots):
      ifile = icol
      data = pft.Dataset(filenames[ifile],1,columns[icol])
      string = name[icol]
      plt.plot(data.get_array('x'),data.get_array('y'),color=colors[icol],linestyle=linestyles[icol],label=string)
コード例 #3
0
def make_subplots(nrow, ncol, nplots, filenames, columns, name, titles):
    for iplot in range(nplots):
        plt.subplot(nrow, ncol, iplot + 1)
        plt.title(titles[iplot])
        plt.xlabel('Time (years)', fontsize=14, fontweight='bold')
        plt.ylabel('I-129 Concentration (mol/L)',
                   fontsize=14,
                   fontweight='bold')

        plt.xlim(0., 5.e5)
        plt.ylim(1.e-22, 1.e-9)
        plt.grid(True)

        for icol in range(
                iplot * len(columns) / nplots,
                iplot * len(columns) / nplots + len(columns) / nplots):
            ifile = icol
            data = pft.Dataset(filenames[ifile], 1, columns[icol])
            string = name[icol]
            plt.semilogy(data.get_array('x'),
                         data.get_array('y'),
                         color=colors[icol],
                         linestyle=linestyles[icol],
                         label=string)
コード例 #4
0
files = pft.get_tec_filenames('calcite_tran_only', range(1, 6))
filenames = pft.get_full_paths(path, files)

f = plt.figure(figsize=(6, 6))
plt.subplot(1, 1, 1)
f.suptitle("1D Calcite", fontsize=16)
plt.xlabel('X [m]')
plt.ylabel('pH')

#plt.xlim(0.,1.)
plt.ylim(4.8, 8.2)
#plt.grid(True)

for ifile in range(len(filenames)):
    data = pft.Dataset(filenames[ifile], 1, 4)
    plt.plot(data.get_array('x'), data.get_array('y'), label=data.title)

#'best'         : 0, (only implemented for axis legends)
#'upper right'  : 1,
#'upper left'   : 2,
#'lower left'   : 3,
#'lower right'  : 4,
#'right'        : 5,
#'center left'  : 6,
#'center right' : 7,
#'lower center' : 8,
#'upper center' : 9,
#'center'       : 10,
plt.legend(loc=4, title='Time [y]')
# xx-small, x-small, small, medium, large, x-large, xx-large, 12, 14
コード例 #5
0
line_styles.append('-')
line_styles.append('-')
line_styles.append('--')

f = plt.figure(figsize=(6, 6))
plt.subplot(1, 1, 1)
f.suptitle("1D Variably Saturated Flow - Pulse", fontsize=16)
plt.xlabel('Saturation [-]')
plt.ylabel('Z [m]')

plt.xlim(0., 1.)
#plt.ylim(0.,1.)
#plt.grid(True)

for ifile in range(len(filenames)):
    data = pft.Dataset(filenames[ifile], 5, 3)
    plt.plot(data.get_array('x'),data.get_array('y'),label=data.title, \
             ls=line_styles[ifile])

#'best'         : 0, (only implemented for axis legends)
#'upper right'  : 1,
#'upper left'   : 2,
#'lower left'   : 3,
#'lower right'  : 4,
#'right'        : 5,
#'center left'  : 6,
#'center right' : 7,
#'lower center' : 8,
#'upper center' : 9,
#'center'       : 10,
plt.legend(loc=1, title='Time [y]')
コード例 #6
0
f = plt.figure(figsize=(6, 6))
plt.subplot(1, 1, 1)
f.suptitle("1D Calcite at 25 Years (with Flow)", fontsize=16)
plt.xlabel('X [m]')
plt.ylabel('Concentration [M]')

#plt.xlim(0.,1.)
#plt.ylim(0.,1.)
#plt.grid(True)
plt.yscale('log')

for ifile in range(len(filenames)):
    columns = [7, 8, 9]
    for icol in range(len(columns)):
        data = pft.Dataset(filenames[ifile], 1, columns[icol])
        plt.plot(data.get_array('x'),
                 data.get_array('y'),
                 label=data.get_name('yname'))

#'best'         : 0, (only implemented for axis legends)
#'upper right'  : 1,
#'upper left'   : 2,
#'lower left'   : 3,
#'lower right'  : 4,
#'right'        : 5,
#'center left'  : 6,
#'center right' : 7,
#'lower center' : 8,
#'upper center' : 9,
#'center'       : 10,
コード例 #7
0
files = []
files.append('vsat_flow_pulse_2layer-obs-0.tec')
filenames = pft.get_full_paths(path, files)

f = plt.figure(figsize=(6, 6))
plt.subplot(1, 1, 1)
f.suptitle("1D Variably Saturated Flow - Pulse, 2 Layer, Observation",
           fontsize=14)
plt.xlabel('Time [y]')
plt.ylabel('Saturation [-]')

#plt.xlim(0.,1.)
#plt.ylim(0.,1.)
#plt.grid(True)

data = pft.Dataset(filenames[0], 1, 3)
plt.plot(data.get_array('x'), data.get_array('y'), label='(0.5 0.5 5.0)')

#'best'         : 0, (only implemented for axis legends)
#'upper right'  : 1,
#'upper left'   : 2,
#'lower left'   : 3,
#'lower right'  : 4,
#'right'        : 5,
#'center left'  : 6,
#'center right' : 7,
#'lower center' : 8,
#'upper center' : 9,
#'center'       : 10,
plt.legend(loc=1, title='Location')
# xx-small, x-small, small, medium, large, x-large, xx-large, 12, 14
コード例 #8
0
path = [
]  ## /home/tsom/Documents/DA_Michael/da_hydrogeophysics/da_hydrogeophysics2d/data/true
path.append(os.path.realpath('./shell/int0'))
files = os.listdir(''.join(path))
filenames0 = pft.get_full_paths(path, files)

f = plt.figure(figsize=(6, 6))
f.suptitle("Integral flux", fontsize=16)

ax = plt.subplot(2, 1, 1)
plt.xlabel('Time [d]')
plt.ylabel('mass_flux Tracer [mol/d]')
plt.title('Prior')

for ifile in range(len(filenames0)):
    data = pft.Dataset(filenames0[ifile], 1, 7)
    plt.plot(data.get_array('x'), data.get_array('y'), label=ifile)

plt.text(0.2,
         0.1,
         '32 realizations',
         horizontalalignment='center',
         verticalalignment='center',
         transform=ax.transAxes)
ax.axes.get_xaxis().set_visible(False)

ax = plt.subplot(2, 1, 2)
plt.xlabel('Time [d]')
plt.ylabel('mass_flux Tracer [mol/d]')
plt.title('Posterior')
コード例 #9
0
path = []
path.append('.')

name = 'hot_steam_injection'

files = pft.get_tec_filenames(name, range(5))
filenames = pft.get_full_paths(path, files)

f = plt.figure(figsize=(20, 20))
plt.subplot(3, 1, 1)
f.suptitle(name, fontsize=16)
plt.xlabel('Distance')
plt.ylabel('Gas Saturation')

for ifile in range(len(filenames)):
    data = pft.Dataset(filenames[ifile], 1, 7)
    plt.plot(data.get_array('x'), data.get_array('y'), label=data.title)

plt.legend(loc=1, title='Time [y]')

plt.subplot(3, 1, 2)

f.suptitle(name, fontsize=16)
plt.xlabel('Distance')
plt.ylabel('Temperature (C)')

for ifile in range(len(filenames)):
    data = pft.Dataset(filenames[ifile], 1, 14)
    plt.plot(data.get_array('x'), data.get_array('y'),
             label=data.title)  #-data2.get_array('y'),label=data.title)
コード例 #10
0
filenames = pft.get_full_paths(path, files)

f = plt.figure(figsize=(10, 6))
f.suptitle("Copper Leaching", fontsize=14)
ax = f.gca(projection='3d')

ax.set_xlabel('X [m]')
ax.set_ylabel('Y [m]')
ax.set_zlabel('Volume Fraction')

#plt.xlim(0.,1.)
#plt.ylim(0.,1.2)
#plt.grid(True)

#data = pft.Dataset(filenames[0],6,0)
data = pft.Dataset(filenames[0], 'Jurbanite VF', 0)
X, Y = np.meshgrid(data.get_array('x'), data.get_array('y'))
Z = data.get_array('z')

nx = len(data.get_array('X'))
ny = len(data.get_array('Y'))
ZZ = np.zeros((nx, ny), '=f8')
for j in range(ny):
    for i in range(nx):
        ZZ[i][j] = Z[i + j * nx]

#surf = ax.plot_surface(X,Y,ZZ,rstride=1,cstride=1,cmap=cm.jet)
surf = ax.plot_surface(X,
                       Y,
                       ZZ,
                       rstride=1,
コード例 #11
0
files.append('regional_doublet-obs-1.tec')
filenames = pft.get_full_paths(path, files)

f = plt.figure(figsize=(8, 6))
plt.subplot(1, 1, 1)
f.suptitle("Regional Doublet on 8 Cores, Center Obs. Point", fontsize=14)
plt.xlabel('Time [y]')
plt.ylabel('Concentration [M]')

#plt.xlim(0.,1.)
plt.ylim(0., 1.3)
#plt.grid(True)

icols = [4, 11]
for i in range(len(icols)):
    data = pft.Dataset(filenames[0], 1, icols[i])
    plt.plot(data.get_array('x'),
             data.get_array('y'),
             label=data.get_name('yname'))

#'best'         : 0, (only implemented for axis legends)
#'upper right'  : 1,
#'upper left'   : 2,
#'lower left'   : 3,
#'lower right'  : 4,
#'right'        : 5,
#'center left'  : 6,
#'center right' : 7,
#'lower center' : 8,
#'upper center' : 9,
#'center'       : 10,
コード例 #12
0
f = plt.figure(figsize=(10, 6))
f.suptitle("Copper Leaching", fontsize=14)
ax = f.gca(projection='3d')

ax.set_title('Jurbanite')
ax.set_xlabel('X [m]')
ax.set_ylabel('Y [m]')
ax.set_zlabel('Volume Fraction')

#plt.xlim(0.,1.)
#plt.ylim(0.,1.2)
#plt.grid(True)

#data = pft.Dataset(filenames[0],6,0)
data = pft.Dataset(filenames[0], 'Jurbanite VF [m^3 mnrl/m^3 bulk]', 0)
X, Y = np.meshgrid(data.get_array('x'), data.get_array('y'))
Z = data.get_array('z')

nx = len(data.get_array('X'))
ny = len(data.get_array('Y'))
ZZ = np.zeros((nx, ny), '=f8')
for j in range(ny):
    for i in range(nx):
        ZZ[i][j] = Z[i + j * nx]

#surf = ax.plot_surface(X,Y,ZZ,rstride=1,cstride=1,cmap=cm.jet)
surf = ax.plot_surface(X,
                       Y,
                       ZZ,
                       rstride=1,
コード例 #13
0
import pflotran as pft

filename = 'CLM-CN-obs-0.tec'

f = plt.figure(figsize=(14, 10))
f.suptitle("CLM-CN", fontsize=16)
plt.subplot(2, 2, 1)
plt.xlabel('Time [y]')
plt.ylabel('Concentration [mol/m^3]')

#plt.xlim(0.,1.)
#plt.ylim(4.8,8.2)
#plt.yscale('log')
#plt.grid(True)

data = pft.Dataset(filename, 1, 4)

# 12 g C / 1 g N
CN_ratio_12 = 12. / 12. / (1. / 14.)
# 10 g C / 1 g N
CN_ratio_10 = 10. / 12. / (1. / 14.)

# if is a dummy array
new_array = pft.Dataset(filename, 1, 2).get_array('y')

arrayN = pft.Dataset(filename, 1, 3).get_array('y')
arrayC = pft.Dataset(filename, 1, 4).get_array('y')
arraySOM1 = pft.Dataset(filename, 1, 5).get_array('y')
arraySOM2 = pft.Dataset(filename, 1, 6).get_array('y')
arraySOM3 = pft.Dataset(filename, 1, 7).get_array('y')
arraySOM4 = pft.Dataset(filename, 1, 8).get_array('y')
コード例 #14
0
plt.ylabel('Concentration [M]')

plt.xlim(0.,10.)
#plt.ylim(4.8,8.2)
#plt.yscale('log')
#plt.grid(True)

icol = []
icol.append(3)
icol.append(4)
icol.append(6)
icol.append(7)
icol.append(9)

for i in range(len(icol)):
  data = pft.Dataset(filename,1,icol[i])
  plt.plot(data.get_array('x'),data.get_array('y'),label=data.get_name('yname'))

#'best'         : 0, (only implemented for axis legends)
#'upper right'  : 1,
#'upper left'   : 2,
#'lower left'   : 3,
#'lower right'  : 4,
#'right'        : 5,
#'center left'  : 6,
#'center right' : 7,
#'lower center' : 8,
#'upper center' : 9,
#'center'       : 10,
plt.legend(loc=1,title='Time [y]')
# xx-small, x-small, small, medium, large, x-large, xx-large, 12, 14