def forward(): ''' Run forward Badlands models. ''' xml_filename = os.path.join( DIR, '..', '..', 'inputs', SCENARIO, 'input_forward_{}_prerift.xml'.format(SCENARIO), ) model = badlandsModel() model.load_xml(xml_filename) model.run_to_time(RIFT_TIME * -1.e6) xml_filename = os.path.join( DIR, '..', '..', 'inputs', SCENARIO, 'input_forward_{}_postrift.xml'.format(SCENARIO), ) model = badlandsModel() model.load_xml(xml_filename) model.run_to_time(END_TIME * -1.e6)
def get_synthetic_initopo(self): model = badlandsModel() # Load the XmL input file model.load_xml(str(self.run_nb_str), self.xmlinput, muted=True) #Update the initial topography #Use the coordinates from the original dem file xi=int(np.shape(model.recGrid.rectX)[0]/model.recGrid.nx) yi=int(np.shape(model.recGrid.rectY)[0]/model.recGrid.ny) #And put the demfile on a grid we can manipulate easily elev=np.reshape(model.recGrid.rectZ,(xi,yi)) return elev
def backward(): ''' Run backward Badlands model. ''' xml_filename = os.path.join( DIR, '..', '..', 'inputs', SCENARIO, 'input_back_{}.xml'.format(SCENARIO), ) model = badlandsModel() model.load_xml(xml_filename) model.run_to_time(END_TIME * -1.e6)
from scipy.spatial import cKDTree from scipy.ndimage import gaussian_filter from scripts import badInput as tools import matplotlib import matplotlib.pyplot as plt from matplotlib import cm import warnings warnings.filterwarnings("ignore", category=RuntimeWarning) from badlands.model import Model as badlandsModel # initialise model model = badlandsModel() # Define the XmL input file model.load_xml('input_paleo2-depo-isoFlex.xml') keepgoing = True changeTe_t = np.arange(0, 70 + 1, 1) * -1000000 flex = [] while (keepgoing): next_time = model.tNow + model.input.tDisplay if next_time > model.input.tEnd: model.run_to_time(model.input.tEnd)