Exemplo n.º 1
0
    global myid
    start = '20170825000000'
    end = '20170826000000'
    interval = '2M'  #forcing interval
    yieldstep = pd.Timedelta(interval).total_seconds()
    # params= params[0]
    topo_file = '/hydros/ZhiLi/demHouston033s_NAm83.tif'
    # topo_file='/hydros/ZhiLi/DEM_08076700.tif'
    # study_area= gpd.read_file('/home/ZhiLi/CRESTHH/Examples/excessive_rain/68500_sub/68500_basin.shp')
    # interior_area= gpd.read_file('/home/ZhiLi/CRESTHH/Examples/excessive_rain/68500_sub/68500_river_buffer_cliped.shp')
    # base_resolution = 1000000 #1km
    # interior_resolution= 1000 #10 m2
    if myid == 0:
        # shp= gpd.read_file('/home/ZhiLi/CRESTHH/data/Example-cali/watershed_shp/watershed.shp')

        DOMAIN = anuga.create_domain_from_file('mesh.msh')
        # DOMAIN= anuga.create_domain_from_file('/home/ZhiLi/CRESTHH/Examples/Sensitivity/original_08076700.msh')
        # if os.path.exists('1km.msh'):
        #     DOMAIN= anuga.create_domain_from_file('1km.msh')
        # else:
        #     DOMAIN= anuga.create_domain_from_regions(
        #         utm_coords,
        #         boundary_tags={'bottom': [0]},
        #         maximum_triangle_area=1000000,
        #         interior_regions=[[utm_coords_int, interior_resolution]],
        #         mesh_filename='1km_082500.msh')
        DOMAIN.set_proj(
            "+proj=utm +zone=15, +north +ellps=WGS84 +datum=WGS84 +units=m +no_defs"
        )
        DOMAIN.set_quantity('elevation',
                            filename=topo_file,
Exemplo n.º 2
0
    end=  '20170826000000'
    interval= '2M'
    yieldstep= pd.Timedelta(interval).total_seconds()    
    # params= params[0]
    # print params
    
    topo_file='/hydros/ZhiLi/DEM_10m_filled.tif'
    # study_area= gpd.read_file('/home/ZhiLi/CRESTHH/Examples/excessive_rain/68500_sub/68500_basin.shp')
    # interior_area= gpd.read_file('/home/ZhiLi/CRESTHH/Examples/excessive_rain/68500_sub/68500_river_buffer_cliped.shp')
    # base_resolution = 1000000 #1km
    # interior_resolution= 1000 #10 m2    
    if myid==0:
        # shp= gpd.read_file('/home/ZhiLi/CRESTHH/data/Example-cali/watershed_shp/watershed.shp')


        DOMAIN= anuga.create_domain_from_file('/home/ZhiLi/mesher/examples/08076700_new/stream_dem/DEM_10m.mesh')
        # if os.path.exists('1km.msh'):
        #     DOMAIN= anuga.create_domain_from_file('1km.msh')
        # else:
        #     DOMAIN= anuga.create_domain_from_regions(
        #         utm_coords,
        #         boundary_tags={'bottom': [0]},
        #         maximum_triangle_area=1000000,
        #         interior_regions=[[utm_coords_int, interior_resolution]],
        #         mesh_filename='1km_082500.msh')
        DOMAIN.set_proj("+proj=utm +zone=15, +north +ellps=WGS84 +datum=WGS84 +units=m +no_defs")
        DOMAIN.set_quantity('elevation', filename=topo_file, location='centroids') # Use function for elevation
        DOMAIN.set_quantity('friction',  filename='/home/ZhiLi/CRESTHH/data/Texas_friction/manningn.tif', location='centroids')
                                # Constant friction 
        DOMAIN.set_quantity('stage', expression='elevation', location='centroids')  
        
Exemplo n.º 3
0
    # myProj = Proj("+proj=utm +zone=15, +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs")

    # lons= np.array(study_area.exterior[0].coords)[:,0]; lats=np.array(study_area.exterior[0].coords)[:,1]
    # utm_coords_ext= [myProj(lon,lat) for (lon, lat) in zip(lons, lats)]
    # lons= np.array(interior_area.exterior[0].coords)[:,0]; lats=np.array(interior_area.exterior[0].coords)[:,1]
    # utm_coords_int= [myProj(lon,lat) for (lon, lat) in zip(lons, lats)]
    # if os.path.exists('1km_082500.msh'):
    #     DOMAIN= anuga.create_domain_from_file('1km_082500.msh')
    # else:
    #     DOMAIN= anuga.create_domain_from_regions(
    #         utm_coords_ext,
    #         boundary_tags={'bottom': [0]},
    #         maximum_triangle_area=1000000,
    #         interior_regions=[[utm_coords_int, interior_resolution]],
    #         mesh_filename='1km_082500.msh')
    DOMAIN = anuga.create_domain_from_file(
        '/home/ZhiLi/mesher/examples/Houston/stream_dem/DEM_10m.mesh')
    # domain= anuga.create_domain_from_regions(bounding_polygon, boundary_tags={'bottom':[0],}, maximum_triangle_area=0.001,verbose=True)
    DOMAIN.set_name('Harvey_coupled_refined_mesh')
    DOMAIN.set_proj(
        "+proj=utm +zone=15, +north +ellps=WGS84 +datum=WGS84 +units=m +no_defs"
    )
    DOMAIN.set_quantity('elevation', filename=topo_file,
                        location='centroids')  # Use function for elevation
    DOMAIN.set_quantity(
        'friction',
        filename='/home/ZhiLi/CRESTHH/data/Texas_friction/manningn.tif',
        location='centroids')  # Constant friction
    DOMAIN.set_quantity('stage', expression='elevation', location='centroids')
    DOMAIN.set_quantity('SM', 0.012, location='centroids')
    DOMAIN.set_quantity(
        'Ksat',
Exemplo n.º 4
0
 
 yieldstep= pd.Timedelta(interval).total_seconds()    
 topo_file= '/home/ZhiLi/CRESTHH/data/dem/DEM_sub.tif'
 study_area= gpd.read_file('/home/ZhiLi/CRESTHH/Examples/excessive_rain/68500_sub/68500_basin.shp')
 interior_area= gpd.read_file('/home/ZhiLi/CRESTHH/data/buffered_mainstream_new/mainstream_buffer.shp')
 base_resolution = 1000000 #1km
 interior_resolution= 1000 #10 m2    
 
 myProj = Proj("+proj=utm +zone=15, +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs")
 
 lons= np.array(study_area.exterior[0].coords)[:,0]; lats=np.array(study_area.exterior[0].coords)[:,1]
 utm_coords_ext= [myProj(lon,lat) for (lon, lat) in zip(lons, lats)]
 lons= np.array(interior_area.exterior[0].coords)[:,0]; lats=np.array(interior_area.exterior[0].coords)[:,1]
 utm_coords_int= [myProj(lon,lat) for (lon, lat) in zip(lons, lats)]    
 if os.path.exists('1km_082500.msh'):
     DOMAIN= anuga.create_domain_from_file('1km_082500.msh')
 else:
     DOMAIN= anuga.create_domain_from_regions(
         utm_coords_ext,
         boundary_tags={'bottom': [0]},
         maximum_triangle_area=1000000,
         interior_regions=[[utm_coords_int, interior_resolution]],
         mesh_filename='1km_082500.msh')    
 # domain= anuga.create_domain_from_regions(bounding_polygon, boundary_tags={'bottom':[0],}, maximum_triangle_area=0.001,verbose=True)
 DOMAIN.set_name('Aug_Sep_coupled_refined_channel')
 DOMAIN.set_proj("+proj=utm +zone=15, +north +ellps=WGS84 +datum=WGS84 +units=m +no_defs")
 DOMAIN.set_quantity('elevation', filename=topo_file, location='centroids') # Use function for elevation
 DOMAIN.set_quantity('friction',  filename='/home/ZhiLi/CRESTHH/data/Texas_friction/manningn.tif', location='centroids')                        # Constant friction 
 DOMAIN.set_quantity('stage', expression='elevation', location='centroids')  
 DOMAIN.set_quantity('SM', 0.012, location='centroids')
 DOMAIN.set_quantity('Ksat', filename='/hydros/MengyuChen/ef5_param/crest_params/ksat_usa.tif', location='centroids')
Exemplo n.º 5
0
import time

start_time= time.time()
myProj= Proj("+proj=utm +zone=15, +north +ellps=WGS84 +datum=WGS84 +units=m +no_defs")
start='20170825120000'
end=  '20170831000000'
interval= '2M'
if myid==0:

    
    yieldstep= pd.Timedelta(interval).total_seconds()    
    topo_file= '/hydros/ZhiLi/demHouston033s_NAm83fel.tif'
    # topo_file='/hydros/ZhiLi/DEM_10m_filled.tif'
    # topo_file= '/home/ZhiLi/mesher/examples/flow_accumulation/flow_accumulation/DEM_10m/DEM_10m_projected.tif'
    # DOMAIN= anuga.create_domain_from_file('/home/ZhiLi/mesher/examples/08076700_new/stream_dem/DEM_10m.mesh')
    DOMAIN= anuga.create_domain_from_file('/home/ZhiLi/CRESTHH/Examples/Sensitivity/original_08076700.msh')
    DOMAIN.set_name('coupled_orig_mesh')
    DOMAIN.set_proj("+proj=utm +zone=15, +north +ellps=WGS84 +datum=WGS84 +units=m +no_defs")
    DOMAIN.set_quantity('elevation', filename=topo_file, location='centroids') # Use function for elevation
    DOMAIN.set_quantity('friction',  filename='/home/ZhiLi/CRESTHH/data/Texas_friction/manningn.tif', location='centroids')                        # Constant friction 
    DOMAIN.set_quantity('stage', expression='elevation', location='centroids')  
    # DOMAIN.set_quantity('SM', 0.039, location='centroids')
    DOMAIN.set_quantity('Ksat', filename='/hydros/MengyuChen/Summer/New/CREST_parameters/crest_param/ksat.tif', location='centroids')
    # DOMAIN.quantities['Ksat'].centroid_values[:]*= 289.0
    DOMAIN.set_quantity('WM', filename='/hydros/MengyuChen/Summer/New/CREST_parameters/crest_param/wm_10m.tif', location='centroids')
    # DOMAIN.quantities['WM'].centroid_values[:]*= 871.0
    DOMAIN.set_quantity('B', filename='/hydros/MengyuChen/Summer/New/CREST_parameters/crest_param/b_10m.tif', location='centroids')
    # DOMAIN.quantities['B'].centroid_values[:]*= 5e-10
    DOMAIN.set_quantity('IM', filename='/hydros/MengyuChen/Summer/New/CREST_parameters/crest_param/im.tif', location='centroids')
    # DOMAIN.quantities['IM'].centroid_values[:]*= 0.06
    DOMAIN.set_quantity('KE', 1, location='centroids')