Update src/seismic_hazard_forecasting.py
This commit is contained in:
		@@ -241,6 +241,9 @@ verbose: {verbose}")
 | 
				
			|||||||
        grid_y_max = int(ceil(y_max / grid_dim) * grid_dim)
 | 
					        grid_y_max = int(ceil(y_max / grid_dim) * grid_dim)
 | 
				
			||||||
        grid_y_min = int(floor(y_min / grid_dim) * grid_dim)
 | 
					        grid_y_min = int(floor(y_min / grid_dim) * grid_dim)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        grid_lat_max, grid_lon_max = utm.to_latlon(grid_x_max, grid_y_max, utm_zone_number, utm_zone_letter)
 | 
				
			||||||
 | 
					        grid_lat_min, grid_lon_min = utm.to_latlon(grid_x_min, grid_y_min, utm_zone_number, utm_zone_letter)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # rectangular grid
 | 
					        # rectangular grid
 | 
				
			||||||
        nx = int((grid_x_max - grid_x_min) / grid_dim) + 1
 | 
					        nx = int((grid_x_max - grid_x_min) / grid_dim) + 1
 | 
				
			||||||
        ny = int((grid_y_max - grid_y_min) / grid_dim) + 1
 | 
					        ny = int((grid_y_max - grid_y_min) / grid_dim) + 1
 | 
				
			||||||
@@ -503,7 +506,7 @@ verbose: {verbose}")
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            # Embed geographic bounding box into the SVG
 | 
					            # Embed geographic bounding box into the SVG
 | 
				
			||||||
            map_bounds = dict(zip(("south", "west", "north", "east"),
 | 
					            map_bounds = dict(zip(("south", "west", "north", "east"),
 | 
				
			||||||
                            map(float, (lat.min(), lon.min(), lat.max(), lon.max()))))
 | 
					                            map(float, (grid_lat_min, grid_lon_min, grid_lat_max, grid_lon_max))))
 | 
				
			||||||
            tree = ET.parse(overlay_filename)
 | 
					            tree = ET.parse(overlay_filename)
 | 
				
			||||||
            tree.getroot().set("data-map-bounds", json.dumps(map_bounds))
 | 
					            tree.getroot().set("data-map-bounds", json.dumps(map_bounds))
 | 
				
			||||||
            tree.write(overlay_filename, encoding="utf-8", xml_declaration=True)
 | 
					            tree.write(overlay_filename, encoding="utf-8", xml_declaration=True)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user