if cvm_selected < 0 or cvm_selected > counter: print "Error: the number you selected must be between 1 and %d" % counter cvm_selected = corresponding_cvm[cvm_selected] meta['cvm'] = cvm_selected # We will offer three color options. Discretized, smooth or bi-color. But, we'll only offer red-blue for now. gate = 2.5 color = "" while color != "s" and color != "d": print "" color = raw_input( "Finally, would you like a descritized or smooth color scale\n(enter 'd' for discrete, 's' for smooth): " ) color = color.strip() if color != "s" and color != "d" and color != "b": print "Please enter 'd' (without quotation marks) for a discrete color bar and 's' (without quotation" print "marks) for a smooth color scale and 'b' (without quotation marks) for bi-color scale." meta['gate'] = gate meta['color'] = color # Now we have all the information so we can actually plot the data. print "" print "Retrieving data. Please wait..." ################################################################################### # Generate the horizontal slice. h = HorizontalSlice(Point(lon1, lat2, depth), Point(lon2, lat1, depth), meta) h.plot()
print "Error: grid spacing must be a positive number." print "" # Ask which CVMs to use. print "From which CVM would you like this data to come:" counter = 1 corresponding_cvm = [] for cvm in u.models: cvmtoprint = cvm if cvm in UCVM_CVMS: cvmtoprint = UCVM_CVMS[cvm] corresponding_cvm.append(cvm) print "\t%d) %s" % (counter, cvmtoprint) counter += 1 cvm_selected = -1 while cvm_selected < 0 or cvm_selected > counter: cvm_selected = int(ask_number("\nSelect the CVM: ")) - 1 if cvm_selected < 0 or cvm_selected > counter: print "Error: the number you selected must be between 1 and %d" % counter cvm_selected = corresponding_cvm[cvm_selected] # Generate the horizontal slice. b = Z25Slice(Point(lon1, lat2, 0), Point(lon2, lat1, 0), spacing, cvm_selected) b.plot()
while cvm_selected < 0 or cvm_selected > counter: cvm_selected = int(ask_number("\nSelect the CVM: ")) - 1 if cvm_selected < 0 or cvm_selected > counter: print "Error: the number you selected must be between 1 and %d" % counter cvm_selected = corresponding_cvm[cvm_selected] meta['cvm'] = cvm color = "" while color != "s" and color != "d": print "" color = raw_input( "Finally, would you like a descritized or smooth color scale\n(enter 'd' for discrete, 's' for smooth): " ) color = color.strip() if color != "s" and color != "d": print "Please enter 'd' (without quotation marks) for a discrete color bar and 's' (without quotation" print "marks) for a smooth color scale." meta['color'] = color # Now we have all the information so we can actually plot the data. print "" print "Retrieving data. Please wait..." ################################################################################### # Generate the horizontal slice. v = ElevationSlice(Point(lon1, lat2, 0), Point(lon2, lat1, 0), meta) v.plot()
cvm_selected = corresponding_cvm[cvm_selected] meta['cvm'] = cvm_selected # We will offer two color options. Discretized or smooth. But, we'll only offer red-blue for now. gate = 2.5 color = "" while color != "s" and color != "d" and color != "b": print "" color = raw_input( "Finally, would you like a descritized or smooth color scale\n(enter 'd' for discrete, 's' for smooth, 'b' for bi-color): " ) color = color.strip() if color != "s" and color != "d" and color != "b": print "Please enter 'd' (without quotation marks) for a discrete color bar and 's' (without quotation" print "marks) for a smooth color scale and 'b' (without quotation marks) for bi-color scale." meta['gate'] = gate meta['color'] = color # Now we have all the information so we can actually plot the data. print "" print "Retrieving data. Please wait..." ################################################################################### # Generate the horizontal slice. d = ElevationCrossSection(Point(lon1, lat1, elevation=starting_elevation), Point(lon2, lat2, elevation=starting_elevation), meta) d.plot()
while cvm_selected < 0 or cvm_selected > counter: cvm_selected = int(ask_number("\nSelect the CVM: ")) - 1 if cvm_selected < 0 or cvm_selected > counter: print "Error: the number you selected must be between 1 and %d" % counter cvm_selected = corresponding_cvm[cvm_selected] meta['cvm'] = cvm_selected color = "" while color != "s" and color != "d": print "" color = raw_input("Finally, would you like a descritized or smooth color scale\n(enter 'd' for discrete, 's' for smooth): ") color = color.strip() if color != "s" and color != "d": print "Please enter 'd' (without quotation marks) for a discrete color bar and 's' (without quotation" print "marks) for a smooth color scale." meta['color']=color # Now we have all the information so we can actually plot the data. print "" print "Retrieving data. Please wait..." ################################################################################### # Generate the horizontal slice. v = Vs30EtreeSlice(Point(lon1, lat2, 0), Point(lon2, lat1, 0),meta) v.plot()
print "From which CVM would you like this data to come:" # Create a new UCVM object. u = UCVM(install_dir=installdir, config_file=configfile) for cvm in u.models: cvmtoprint = cvm if cvm in UCVM_CVMS: cvmtoprint = UCVM_CVMS[cvm] corresponding_cvm.append(cvm) print "\t%d) %s" % (counter, cvmtoprint) counter += 1 cvm_selected = -1 while cvm_selected < 0 or cvm_selected > counter: cvm_selected = int(ask_number("\nSelect the CVM: ")) - 1 if cvm_selected < 0 or cvm_selected > counter: print "Error: the number you selected must be between 1 and %d" % counter cvm_selected = corresponding_cvm[cvm_selected] meta['cvm'] = cvm_selected # Now we have all the information so we can actually plot the data. print "" print "Retrieving data. Please wait..." ################################################################################### # Generate the depth profile d = DepthProfile(Point(lon1, lat1, starting_depth), meta) d.plot()
print "From which CVM would you like this data to come:" counter = 1 corresponding_cvm = [] for cvm in u.models: cvmtoprint = cvm if cvm in UCVM_CVMS: cvmtoprint = UCVM_CVMS[cvm] corresponding_cvm.append(cvm) print "\t%d) %s" % (counter, cvmtoprint) counter += 1 cvm_selected = -1 while cvm_selected < 0 or cvm_selected > counter: cvm_selected = int(ask_number("\nSelect the CVM: ")) - 1 if cvm_selected < 0 or cvm_selected > counter: print "Error: the number you selected must be between 1 and %d" % counter cvm_selected = corresponding_cvm[cvm_selected] # Now that we have all the requisite data, we can actually make the plot now. print "" print "Retrieving data. Please wait..." # Generate the horizontal slice. v = Vs30Slice(Point(lon1, lat2, 0), Point(lon2, lat1, 0), spacing, cvm_selected) v.plot(color_scale="s")
# Create a new UCVM object. u = UCVM(install_dir=installdir, config_file=configfile) for cvm in u.models: cvmtoprint = cvm if cvm in UCVM_CVMS: cvmtoprint = UCVM_CVMS[cvm] corresponding_cvm.append(cvm) print "\t%d) %s" % (counter, cvmtoprint) counter += 1 cvm_selected = -1 while cvm_selected < 0 or cvm_selected > counter: cvm_selected = int(ask_number("\nSelect the CVM: ")) - 1 if cvm_selected < 0 or cvm_selected > counter: print "Error: the number you selected must be between 1 and %d" % counter cvm_selected = corresponding_cvm[cvm_selected] meta['cvm'] = cvm_selected # Now that we have all the requisite data, we can actually make the plot now. print "Retrieving data. Please wait..." # Generate the horizontal slice. h = MapGridHorizontalSlice(Point(lon1, lat2, depth), Point(lon2, lat1, depth), meta) h.plot()
while cvm_selected < 0 or cvm_selected > counter: cvm_selected = int(ask_number("\nSelect the CVM: ")) - 1 if cvm_selected < 0 or cvm_selected > counter: print "Error: the number you selected must be between 1 and %d" % counter cvm_selected = corresponding_cvm[cvm_selected] meta['cvm'] = cvm_selected color = "" while color != "s" and color != "d": print "" color = raw_input( "Finally, would you like a descritized or smooth color scale\n(enter 'd' for discrete, 's' for smooth): " ) color = color.strip() if color != "s" and color != "d": print "Please enter 'd' (without quotation marks) for a discrete color bar and 's' (without quotation" print "marks) for a smooth color scale." meta['color'] = color # Now we have all the information so we can actually plot the data. print "" print "Retrieving data. Please wait..." ################################################################################### # Generate the Z10 horizontal slice. b = Z10Slice(Point(lon1, lat2, 0), Point(lon2, lat1, 0), meta) b.plot()
# Create a new UCVM object. u = UCVM(install_dir=installdir, config_file=configfile) for cvm in u.models: cvmtoprint = cvm if cvm in UCVM_CVMS: cvmtoprint = UCVM_CVMS[cvm] corresponding_cvm.append(cvm) print "\t%d) %s" % (counter, cvmtoprint) counter += 1 cvm_selected = -1 while cvm_selected < 0 or cvm_selected > counter: cvm_selected = int(ask_number("\nSelect the CVM: ")) - 1 if cvm_selected < 0 or cvm_selected > counter: print "Error: the number you selected must be between 1 and %d" % counter cvm_selected = corresponding_cvm[cvm_selected] meta['cvm'] = cvm_selected # Now we have all the information so we can actually plot the data. print "" print "Retrieving data. Please wait..." ################################################################################### # Generate the elevation profile d = ElevationProfile(Point(lon1, lat1, elevation=starting_elevation), meta) d.plot()
cvm_selected = corresponding_cvm[cvm_selected] meta['cvm'] = cvm_selected # We will offer two color options. Discretized or smooth. But, we'll only offer red-blue for now. gate = 2.5 color = "" while color != "s" and color != "d" and color != "b": print "" color = raw_input( "Finally, would you like a descritized or smooth color scale\n(enter 'd' for discrete, 's' for smooth, 'b' for bi-color): " ) color = color.strip() if color != "s" and color != "d" and color != "b": print "Please enter 'd' (without quotation marks) for a discrete color bar and 's' (without quotation" print "marks) for a smooth color scale and 'b' (without quotation marks) for bi-color scale." meta['scale_gate'] = gate meta['color_scale'] = color # Now we have all the information so we can actually plot the data. print "" print "Retrieving data. Please wait..." ################################################################################### # Generate the horizontal slice. d = CrossSection(Point(lon1, lat1, starting_depth), Point(lon2, lat2, starting_depth), meta) d.plot()