def run_script(args): matplotlib.interactive(False) """if args.transparent == 'False' or args.transparent == 'No': transparent = False else: transparent = True""" args.ntraces = 300 args.pad = 150 args.reflectivity_method = zoeppritz args.title = "Channel - angle gather (AVA)" args.theta = (0, 50, 0.5) args.wavelet = ricker args.wiggle_skips = 10 args.aspect_ratio = 1 args.thickness = 50 args.margin = 1 args.slice = "angle" transparent = False # This is a hack to conserve colors l1 = (150, 110, 110) l2 = (110, 150, 110) l3 = (110, 110, 150) layers = [l1, l2] colourmap = {rgb(150, 110, 110): args.Rock0, rgb(110, 150, 110): args.Rock1} if not isinstance(args.Rock2, str): colourmap[rgb(110, 110, 150)] = args.Rock2 layers.append(l3) # Get the physical model (an array of rocks) model = mb.channel(pad=args.pad, thickness=args.thickness, traces=args.ntraces, layers=layers) return modelr_plot(model, colourmap, args)
def run_script(args): matplotlib.interactive(False) left = (args.left[0], args.left[1]) right = (args.right[0], args.right[1]) l1 = (150, 110, 110) l2 = (110, 150, 110) l3 = (110, 110, 150) layers = [l1, l2] # This is a hack to conserve colors colourmap = { rgb(l1[0], l1[1], l1[2]): args.Rock0, rgb(l2[0], l2[1], l2[2]): args.Rock1 } if not isinstance(args.Rock2, str): colourmap[rgb(l3[0], l3[1], l3[2])] = args.Rock2 layers.append(l3) model = mb.body(traces=args.ntraces, pad=args.pad, margin=args.margin, left=left, right=right, layers=layers) return modelr_plot(model, colourmap, args)
def run_script(args): matplotlib.interactive(False) left = (args.left[0], args.left[1]) right = (args.right[0], args.right[1]) l1 = (150,110,110) l2 = (110,150,110) l3 = (110,110,150) layers= [l1,l2] # This is a hack to conserve colors colourmap = { rgb(l1[0],l1[1],l1[2]): args.Rock0, rgb(l2[0],l2[1],l2[2]): args.Rock1 } if not isinstance(args.Rock2, str): colourmap[rgb( l3[0],l3[1],l3[2])] = args.Rock2 layers.append( l3 ) model = mb.body( traces = args.ntraces, pad = args.pad, margin=args.margin, left = left, right = right, layers = layers ) return modelr_plot(model, colourmap, args)
def run_script(args): from modelr.constants import dt, duration matplotlib.interactive(False) args.ntraces = 300 args.pad = 150 args.reflectivity_method = zoeppritz args.title = 'Wedge Model - RGB Blended Cross Section' #args.colourmap = 'Greys' #might need to overwrite this (it may not be used) args.wavelet = ricker args.wiggle_skips = 10 args.aspect_ratio = 1 args.margin=1 args.left = (0,0) args.right = (0,50) args.slice='spatial' args.trace = 0 left = (args.left[0], args.left[1]) right = (args.right[0], args.right[1]) l1 = (150,110,110) l2 = (110,150,110) l3 = (110,110,150) layers= [l1,l2] # This is a hack to conserve colors colourmap = { rgb(l1[0],l1[1],l1[2]): args.Rock0, rgb(l2[0],l2[1],l2[2]): args.Rock1 } if not isinstance(args.Rock2, str): colourmap[rgb( l3[0],l3[1],l3[2])] = args.Rock2 layers.append( l3 ) model = mb.body( traces = args.ntraces, pad = args.pad, margin=args.margin, left = left, right = right, layers = layers ) return modelr_plot( model, colourmap, args )
def run_script(args): from modelr.constants import dt, duration matplotlib.interactive(False) args.ntraces = 300 args.pad = 150 args.reflectivity_method = zoeppritz args.title = 'Wedge Model - RGB Blended Cross Section' #args.colourmap = 'Greys' #might need to overwrite this (it may not be used) args.wavelet = ricker args.wiggle_skips = 10 args.aspect_ratio = 1 args.margin = 1 args.left = (0, 0) args.right = (0, 50) args.slice = 'spatial' args.trace = 0 left = (args.left[0], args.left[1]) right = (args.right[0], args.right[1]) l1 = (150, 110, 110) l2 = (110, 150, 110) l3 = (110, 110, 150) layers = [l1, l2] # This is a hack to conserve colors colourmap = { rgb(l1[0], l1[1], l1[2]): args.Rock0, rgb(l2[0], l2[1], l2[2]): args.Rock1 } if not isinstance(args.Rock2, str): colourmap[rgb(l3[0], l3[1], l3[2])] = args.Rock2 layers.append(l3) model = mb.body(traces=args.ntraces, pad=args.pad, margin=args.margin, left=left, right=right, layers=layers) return modelr_plot(model, colourmap, args)
def run_script(args): matplotlib.interactive(False) """if args.transparent == 'False' or args.transparent == 'No': transparent = False else: transparent = True""" args.ntraces = 300 args.pad = 150 args.reflectivity_method = zoeppritz args.title = 'Wedge model - wavelet cross section' args.wavelet = ricker args.wiggle_skips = 10 args.aspect_ratio = 1 args.left = (0,0) args.right = (0,50) args.margin=1 args.slice='frequency' args.f = (8,256,1) transparent = False # This is a hack to conserve colors l1 = (150,110,110) l2 = (110,150,110) l3 = (110,110,150) layers= [l1,l2] colourmap = { rgb(150,110,110): args.Rock0, rgb(110,150,110): args.Rock1 } if not isinstance(args.Rock2, str): colourmap[rgb( 110,110,150)] = args.Rock2 layers.append( l3 ) # Get the physical model (an array of rocks) model = mb.body( traces = args.ntraces, pad = args.pad, margin=args.margin, left = args.left, right = args.right, layers = layers ) return modelr_plot( model, colourmap, args )
def run_script(args): matplotlib.interactive(False) """if args.transparent == 'False' or args.transparent == 'No': transparent = False else: transparent = True""" args.ntraces = 300 args.pad = 150 args.reflectivity_method = zoeppritz args.title = 'Wedge - AVA gather' args.theta = (0.0, 50, .5) args.wavelet = ricker args.wiggle_skips = 10 args.aspect_ratio = 1 args.left = (0, 0) args.right = (0, 50) args.margin = 1 args.slice = 'angle' # This is a hack to conserve colors l1 = (150, 110, 110) l2 = (110, 150, 110) l3 = (110, 110, 150) layers = [l1, l2] colourmap = { rgb(150, 110, 110): args.Rock0, rgb(110, 150, 110): args.Rock1 } if not isinstance(args.Rock2, str): colourmap[rgb(110, 110, 150)] = args.Rock2 layers.append(l3) # Get the physical model (an array of rocks) model = mb.body(traces=args.ntraces, pad=args.pad, margin=args.margin, left=args.left, right=args.right, layers=layers) return modelr_plot(model, colourmap, args)
def run_script(args): matplotlib.interactive(False) args.reflectivity_method = zoeppritz args.title = 'Forward model - spatial cross section' args.wavelet = ricker args.margin=1 args.slice='spatial' args.trace = 0 model = urllib2.urlopen(args.model["image"]).read() model = Image.open(StringIO(model)).convert("RGB") model = np.asarray(model) # decimate the first dimension of the model (into sample rate: dt [ms]) ds = float(args.twt_range[1] - args.twt_range[0]) / float(model.shape[0]) x = (np.arange(0, model.shape[0]) * ds) + args.twt_range[0] f = interp1d(x, model.astype("float"), axis=0, kind="nearest") xnew = np.arange(args.twt_range[0],args.twt_range[1], dt * 1000.0) xnew = xnew[np.where(xnew < np.amax(x))] model_new = f(xnew) mapping = args.model["mapping"] for colour in mapping: rock = rock_properties_type(mapping[colour]["property"]) mapping[colour] = rock args.ntraces = model_new.shape[1] return modelr_plot(model_new, mapping, args)
def run_script(args): matplotlib.interactive(False) Rprop0 = args.Rock0 Rprop1 = args.Rock1 Rprop2 = args.Rock2 Rprop3 = args.Rock3 colourmap = {} if isinstance(Rprop0, str): Rprop0 = None else: colourmap[rgb(255,255,255)] = Rprop0 if isinstance(Rprop1, str): Rprop1 = None else: colourmap[rgb( 255,0,0 )] = Rprop1 if isinstance(Rprop2, str): Rprop2 = None else: colourmap[rgb( 0,0,255 )] = Rprop2 if isinstance(Rprop3, str): Rprop3 = None else: colourmap[3] = Rprop3 if not isinstance(args.rocks, int): colours = 0 else: colours = args.rocks colours = ((255,255,255),(255,0,0), (0,0,255) ) model = mb.web2array(args.url, colours = colours ) return modelr_plot( model, colourmap, args )
def run_script(args): matplotlib.interactive(False) """if args.transparent == 'False' or args.transparent == 'No': transparent = False else: transparent = True""" args.ntraces = 300 args.pad = 150 args.reflectivity_method = zoeppritz args.title = 'Channel Model - Wavelet Cross Section' args.wavelet = ricker args.wiggle_skips = 10 args.aspect_ratio = 1 args.thickness = 50 args.margin = 1 args.f = (8, 256, 1) args.slice = 'frequency' transparent = False # This is a hack to conserve colors l1 = (150, 110, 110) l2 = (110, 150, 110) l3 = (110, 110, 150) layers = [l1, l2] colourmap = { rgb(150, 110, 110): args.Rock0, rgb(110, 150, 110): args.Rock1 } if not isinstance(args.Rock2, str): colourmap[rgb(110, 110, 150)] = args.Rock2 layers.append(l3) # Get the physical model (an array of rocks) model = mb.channel(pad=args.pad, thickness=args.thickness, traces=args.ntraces, layers=layers) return modelr_plot(model, colourmap, args)
def run_script(args): matplotlib.interactive(False) Rprop0 = args.Rock0 Rprop1 = args.Rock1 Rprop2 = args.Rock2 Rprop3 = args.Rock3 colourmap = {} if isinstance(Rprop0, str): Rprop0 = None else: colourmap[rgb(255, 255, 255)] = Rprop0 if isinstance(Rprop1, str): Rprop1 = None else: colourmap[rgb(255, 0, 0)] = Rprop1 if isinstance(Rprop2, str): Rprop2 = None else: colourmap[rgb(0, 0, 255)] = Rprop2 if isinstance(Rprop3, str): Rprop3 = None else: colourmap[3] = Rprop3 if not isinstance(args.rocks, int): colours = 0 else: colours = args.rocks colours = ((255, 255, 255), (255, 0, 0), (0, 0, 255)) model = mb.web2array(args.url, colours=colours) return modelr_plot(model, colourmap, args)
def run_script(args): matplotlib.interactive(False) args.reflectivity_method = zoeppritz args.title = 'Forward model - spatial cross section' args.wavelet = ricker args.margin = 1 args.slice = 'spatial' args.trace = 0 model = urllib2.urlopen(args.model["image"]).read() model = Image.open(StringIO(model)).convert("RGB") model = np.asarray(model) # decimate the first dimension of the model (into sample rate: dt [ms]) ds = float(args.twt_range[1] - args.twt_range[0]) / float(model.shape[0]) x = (np.arange(0, model.shape[0]) * ds) + args.twt_range[0] f = interp1d(x, model.astype("float"), axis=0, kind="nearest") xnew = np.arange(args.twt_range[0], args.twt_range[1], dt * 1000.0) xnew = xnew[np.where(xnew < np.amax(x))] model_new = f(xnew) mapping_in = args.model["mapping"] mapping = {} for cmap in mapping_in: rock = Rock.from_json(cmap["rock"]) mapping[cmap["colour"]] = rock args.ntraces = model_new.shape[1] return modelr_plot(model_new, mapping, args)