コード例 #1
0
ファイル: gen_mesh.py プロジェクト: JacobDowns/VarGlaS
import sys
import os
src_directory = '../../../'
sys.path.append(src_directory)

from src.utilities     import DataInput, MeshGenerator
from data.data_factory import DataFactory

# create meshgrid for contour :
vara = DataFactory.get_bamber()
H = vara['H']['map_data']
S = vara['h']['map_data']
B = vara['b']['map_data']
H[S<=0] = 0.0
vara['H']['map_data'] = H

# process the data :
dd = DataInput(None, vara, flip=False, gen_space=False)
#dd.set_data_max('mask', 2, 0)

m = MeshGenerator(dd, 'mesh', './')

# 20 works well for the last arg. below
m.create_contour('H', 200.0,3)
m.plot_contour()

m.eliminate_intersections()
m.plot_contour()

# 10000 works well on the following line
m.write_gmsh_contour(1000)
コード例 #2
0
import sys
import os
src_directory = '../../../'
sys.path.append(src_directory)

from src.utilities import DataInput, MeshGenerator
from data.data_factory import DataFactory

# create meshgrid for contour :
vara = DataFactory.get_bamber()
H = vara['H']['map_data']
S = vara['h']['map_data']
B = vara['b']['map_data']
H[S <= 0] = 0.0
vara['H']['map_data'] = H

# process the data :
dd = DataInput(None, vara, flip=False, gen_space=False)
#dd.set_data_max('mask', 2, 0)

m = MeshGenerator(dd, 'mesh', './')

# 20 works well for the last arg. below
m.create_contour('H', 200.0, 3)
m.plot_contour()

m.eliminate_intersections()
m.plot_contour()

# 10000 works well on the following line
m.write_gmsh_contour(1000)
コード例 #3
0
from src.utilities     import DataInput,DataOutput
from data.data_factory import DataFactory
from src.physics       import VelocityBalance_2
from numpy             import sqrt
from pylab             import *
from dolfin            import *
from scipy.optimize    import fmin_l_bfgs_b
import os

set_log_active(True)

# collect the raw data :
searise = DataFactory.get_searise()
measure = DataFactory.get_gre_measures()
bamber  = DataFactory.get_bamber()

direc = os.path.dirname(os.path.realpath(__file__))

# load a mesh :
mesh    = Mesh("./mesh_5km.xml")

# create data objects to use with varglas :
dsr     = DataInput(None, searise, mesh=mesh)
dbam    = DataInput(None, bamber, mesh=mesh)
dms     = DataInput(None, measure, mesh=mesh, flip=True)
dms.change_projection(dsr)

# Bound data to managable values
MAX_V_ERR = 500
NO_DATA = -99
コード例 #4
0
from pylab                import sqrt, copy
from time                 import time

# make the directory if needed :
out_dir   = './results/'

set_log_active(True)
#set_log_level(PROGRESS)

thklim = 10.0

# collect the raw data :
searise  = DataFactory.get_searise(thklim = thklim)
measure  = DataFactory.get_gre_measures()
#meas_shf = DataFactory.get_shift_gre_measures()
bamber   = DataFactory.get_bamber(thklim = thklim)
fm_qgeo  = DataFactory.get_gre_qgeo_fox_maule()
#sec_qgeo = DataFactory.get_gre_qgeo_secret()
merged   = DataFactory.get_gre_merged()

# define the meshes :
mesh      = Mesh('../../../meshes/greenland/greenland_coarse_mesh.xml')
flat_mesh = Mesh('../../../meshes/greenland/greenland_coarse_mesh.xml')
mesh.coordinates()[:,2]      /= 1000.0
flat_mesh.coordinates()[:,2] /= 1000.0


# create data objects to use with varglas :
dsr     = DataInput(None, searise,  mesh=mesh)
dbm     = DataInput(None, bamber,   mesh=mesh)
#dms     = DataInput(None, measure,  mesh=mesh)
コード例 #5
0
ファイル: test.py プロジェクト: whigg/VarGlaS
from pylab import sqrt, copy
from time import time

# make the directory if needed :
out_dir = './test_results/'

set_log_active(True)
#set_log_level(PROGRESS)

thklim = 200.0

# collect the raw data :
searise = DataFactory.get_searise(thklim=thklim)
measure = DataFactory.get_gre_measures()
meas_shf = DataFactory.get_shift_gre_measures()
bamber = DataFactory.get_bamber(thklim=thklim)
fm_qgeo = DataFactory.get_gre_qgeo_fox_maule()
sec_qgeo = DataFactory.get_gre_qgeo_secret()

# define the meshes :
mesh = Mesh('meshes/mesh_high_new.xml')
flat_mesh = Mesh('meshes/mesh_high_new.xml')
#mesh      = Mesh('meshes/mesh_low.xml')
#flat_mesh = Mesh('meshes/mesh_low.xml')
mesh.coordinates()[:, 2] /= 100000.0
flat_mesh.coordinates()[:, 2] /= 100000.0

# create data objects to use with varglas :
dsr = DataInput(None, searise, mesh=mesh)
dbm = DataInput(None, bamber, mesh=mesh)
#dms     = DataInput(None, measure,  mesh=mesh)