Esempio n. 1
0
nt = inputs.read_int('number_of_craters_per_loop')
loops = inputs.read_int('number_of_loops')

mg = RasterModelGrid(nrows, ncols, dx)
mg.set_looped_boundaries(True, True)

#create the fields in the grid
mg.create_node_array_zeros('topographic__elevation')
mg['node'][ 'topographic__elevation'] = np.load('init_topo.npy')

# Display a message
print( 'Running ...' )
start_time = time.time()

#instantiate the component:
craters_component = impactor(mg, input_file)

#perform the loops:
x = np.empty(nt)
y = np.empty(nt)
r = np.empty(nt)
slope = np.empty(nt)
angle = np.empty(nt)
az = np.empty(nt)
mass_balance = np.empty(nt)
for i in xrange(loops):
    for j in xrange(nt):
        if j == 1:
            craters_component._ycoord = 0.45*mg.get_grid_xdimension()
            craters_component._radius /= 10.
        mg = craters_component.excavate_a_crater_furbish(mg)
Esempio n. 2
0
mg = RasterModelGrid(nrows, ncols, dx)
mg.set_looped_boundaries(True, True)

#create the fields in the grid
mg.create_node_array_zeros('topographic_elevation')
z = mg.create_node_array_zeros() + leftmost_elev
z += initial_slope*np.amax(mg.node_y) - initial_slope*mg.node_y
mg['node'][ 'topographic_elevation'] = z #+ np.random.rand(len(z))/10000.

# Display a message
print( 'Running ...' )
start_time = time.time()

#instantiate the component:
craters_component = impactor(mg, input_file)

offset=0

#perform the loops:
x = np.empty(nt)
y = np.empty(nt)
r = np.empty(nt)
slope = np.empty(nt)
angle = np.empty(nt)
az = np.empty(nt)
mass_balance = np.empty(nt)
for i in xrange(loops):
    for j in xrange(nt):
        mg = craters_component.excavate_a_crater_furbish(mg)
        x[j] = craters_component.impact_xy_location[0]
leftmost_elev = inputs.read_float('leftmost_elevation')
initial_slope = inputs.read_float('initial_slope')
nt = inputs.read_int('number_of_craters_per_loop')
loops = inputs.read_int('number_of_loops')

mg = RasterModelGrid(nrows, ncols, dx)
mg.set_looped_boundaries(True, True)
mg.create_node_array_zeros('planet_surface__elevation')


def fitFunc(t, a, b, c, d, e, f, g):
    return a * t**6. + b * t**5. + c * t**4. + d * t**3. + e * t**2. + f * t + g


#instantiate the component:
craters_component = impactor(mg, input_file)

params_from_first_try = np.array([
    -2.10972667e+02, 3.23669793e+02, -2.01070114e+02, 7.40429578e+01,
    -1.77124298e+01, 2.03540786e-01, -1.01168519e-01
])
list_of_mass_bals = []
param_collection = np.empty_like(params_from_first_try)

slope_values = np.arange(0., 51.) / 100.
beta = []

print 'Beginning loop...'

repeats = 1
work_with = slope_values
Esempio n. 4
0
mg = RasterModelGrid(nrows, ncols, dx)
mg.set_looped_boundaries(True, True)

#create the fields in the grid
mg.create_node_array_zeros('planet_surface__elevation')
z = mg.create_node_array_zeros() + leftmost_elev
z += initial_slope * np.amax(mg.node_y) - initial_slope * mg.node_y
mg['node']['planet_surface__elevation'] = z  #+ np.random.rand(len(z))/10000.

# Display a message
print('Running ...')
start_time = time.time()

#instantiate the component:
craters_component = impactor(mg, input_file)

offset = 0

#perform the loops:
x = np.empty(nt)
y = np.empty(nt)
r = np.empty(nt)
slope = np.empty(nt)
angle = np.empty(nt)
az = np.empty(nt)
mass_balance = np.empty(nt)
for i in xrange(loops):
    for j in xrange(nt):
        mg = craters_component.excavate_a_crater_furbish(mg)
        x[j] = craters_component.impact_xy_location[0]