if len(_arg) == 3: _input_flag = sys.argv[1].strip('-') elif len(_arg) == 2: _input_flag = sys.argv[1].strip('-') else: raise ValueError('No arguments supplied.') # parameter choices for scaling If = 10 / day_in_yr # intermittency factor for year-scaling # if running the computation if _input_flag == 'compute': _mdl = pyDeltaRCM.DeltaModel( out_dir=_dir, seed=10151919, # JOSS, A1Z26 encoded save_eta_grids=True, save_dt=sec_in_day) for i in range(4000): _mdl.update() # finalize _mdl.finalize() # if running the plotting elif _input_flag == 'plot': # set up attributes needed for plotting H_SL, h, n = 0, 4, 0.3 # sea level, basin depth, surf relief blues = matplotlib.cm.get_cmap('Blues_r', 64)
import numpy as np import pyDeltaRCM # filter out the warning raised about no netcdf being found warnings.filterwarnings("ignore", category=UserWarning) n = 10 cm = matplotlib.cm.get_cmap('tab10') # init delta model with pyDeltaRCM.shared_tools._docs_temp_directory() as output_dir: delta = pyDeltaRCM.DeltaModel( out_dir=output_dir) delta_later = pyDeltaRCM.DeltaModel( out_dir=output_dir, resume_checkpoint='../../_resources/checkpoint') _shp = delta_later.eta.shape # manually call only the necessary paths delta.init_water_iteration() delta.run_water_iteration() delta_later.init_water_iteration() delta_later.run_water_iteration()
import matplotlib.pyplot as plt import pyDeltaRCM with pyDeltaRCM.shared_tools._docs_temp_directory() as output_dir: delta = pyDeltaRCM.DeltaModel(out_dir=output_dir) delta.show_attribute('cell_type', grid=False) delta.show_attribute('cell_type', grid=False) delta.show_ind([3378, 9145, 11568, 514, 13558]) delta.show_ind((42, 94), 'bs') delta.show_ind([(41, 8), (42, 10)], 'g^') plt.show()