Open davidwang001 opened 11 years ago
That sounds like a good idea, but I don't know how you can generalize the function plot_quakes by using bbox(quakes), because bbox(quakes) would have to return something different for different areas/countries/states, but only takes in one parameter. It might just be easier to add parameters for the bounding box in plot_quakes:
plot_quakes(quakes, centerlat, centerlon, dimensionsOfBoundingBox)
Keep in mind that bounding box for basemap is determined by 2 corner points, which are determined by 4 parameters - so you need to initialize:
llcrnrlon - lower left hand corner longitude degree llcrnrlat - lower left hand corner latitude degree urcrnrlon - upper right hand corner longitude urcrnrlat - upper right hand corner latitude
From the looks of you bbox code, it might be easier to do something lke this:
#calculate quake bounding box from centerlat,centerlon for a region of dimensions a x a you want to plot around point (centerlon, centerlat)
Max_lat=centerlat+a
Min_lat=centerlat-a
Max_long=centerlon+a
Min_long=centerlon-a
I wanted to share my ideas about visualization and hopefully get some help on debugging them since our group's data isn't ready yet.
def state_data(state, data): sdata=data[state in data.location] return sdata[0:10]
quakes = state_data("California",data)
from mpl_toolkits.basemap import Basemap
def bbox(quakes):
create a variable called x to create margins
Am I missing anything up to this point? Does any of it not make sense? Also, how do I synch a python compiler to my sublime text 2? Thank you guys!