Ejemplo n.º 1
0
def cellWidthVsLatLon():
    km = 1000.0

    params = ct.default_params

    print("****QU 120 background mesh and enhanced Atlantic (30km)****")
    params["mesh_type"] = "QU"
    params["dx_max_global"] = 120.0 * km
    params["region_box"] = ct.Atlantic
    params["restrict_box"] = ct.Atlantic_restrict
    params["plot_box"] = ct.Western_Atlantic
    params["dx_min_coastal"] = 30.0 * km
    params["trans_width"] = 5000.0 * km
    params["trans_start"] = 500.0 * km

    cell_width, lon, lat = ct.coastal_refined_mesh(params)

    print("****Northeast refinement (10km)***")
    params["region_box"] = ct.Delaware_Bay
    params["plot_box"] = ct.Western_Atlantic
    params["dx_min_coastal"] = 10.0 * km
    params["trans_width"] = 600.0 * km
    params["trans_start"] = 400.0 * km

    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    return cell_width / 1000, lon, lat
Ejemplo n.º 2
0
def cellWidthVsLatLon():
    km = 1000.0

    params = ct.default_params

    params["mesh_type"] = "QU"
    params["dx_max_global"] = 300.0 * km
    ct.Delaware_Region["include"][0] = np.array([-77, -69.8, 37.25, 40.25])
    params["region_box"] = ct.Delaware_Region
    params["plot_box"] = ct.Western_Atlantic
    params["dx_min_coastal"] = 20.0 * km
    params["trans_width"] = 600.0 * km
    params["trans_start"] = 100.0 * km

    cell_width, lon, lat = ct.coastal_refined_mesh(params)

    ct.Delaware_Bay["include"][0] = np.array(
        [-75.61903, -74.7, 38.5, 40.312747])
    params["region_box"] = ct.Delaware_Bay
    params["plot_box"] = ct.Delaware
    params["restrict_box"] = ct.Delaware_restrict
    params["dx_min_coastal"] = 3.0 * km
    params["trans_width"] = 100.0 * km
    params["trans_start"] = 17.0 * km

    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    return cell_width / 1000, lon, lat
Ejemplo n.º 3
0
def cellWidthVsLatLon():
    km = 1000.0

    params = ct.default_params

    params["mesh_type"] = "QU"
    params["dx_max_global"] = 120.0 * km
    params["region_box"] = ct.Delaware_Bay
    params["plot_box"] = ct.Western_Atlantic
    params["dx_min_coastal"] = 10.0 * km
    params["trans_width"] = 600.0 * km
    params["trans_start"] = 400.0 * km

    cell_width, lon, lat = ct.coastal_refined_mesh(params)

    params["region_box"] = ct.Delaware_Region
    params["plot_box"] = ct.Delaware
    params["dx_min_coastal"] = 5.0 * km
    params["trans_width"] = 175.0 * km
    params["trans_start"] = 75.0 * km

    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    params["region_box"] = ct.Delaware_Bay
    params["plot_box"] = ct.Delaware
    params["restrict_box"] = ct.Delaware_restrict
    params["dx_min_coastal"] = 1.0 * km
    params["trans_width"] = 100.0 * km
    params["trans_start"] = 17.0 * km

    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    return cell_width / 1000, lon, lat
Ejemplo n.º 4
0
def cellWidthVsLatLon():
    km = 1000.0

    params = ct.default_params

    print("****QU 60 background mesh and enhanced Atlantic (30km)****")
    params["mesh_type"] = "QU"
    params["dx_max_global"] = 60.0 * km
    params["region_box"] = ct.Atlantic
    params["restrict_box"] = ct.Atlantic_restrict
    params["plot_box"] = ct.Western_Atlantic
    params["dx_min_coastal"] = 15.0 * km
    params["trans_width"] = 5000.0 * km
    params["trans_start"] = 500.0 * km

    cell_width, lon, lat = ct.coastal_refined_mesh(params)

    print("****Northeast refinement (5km)***")
    params["region_box"] = ct.Delaware_Bay
    params["plot_box"] = ct.Western_Atlantic
    params["dx_min_coastal"] = 5.0 * km
    params["trans_width"] = 600.0 * km
    params["trans_start"] = 400.0 * km

    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("****Delaware regional refinement (2.5km)****")
    params["region_box"] = ct.Delaware_Region
    params["plot_box"] = ct.Delaware
    params["dx_min_coastal"] = 2.5 * km
    params["trans_width"] = 175.0 * km
    params["trans_start"] = 75.0 * km

    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("****Delaware Bay high-resolution (1km)****")
    params["region_box"] = ct.Delaware_Bay
    params["plot_box"] = ct.Delaware
    params["restrict_box"] = ct.Delaware_restrict
    params["dx_min_coastal"] = 1.0 * km
    params["trans_width"] = 100.0 * km
    params["trans_start"] = 17.0 * km

    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    return cell_width / 1000, lon, lat
Ejemplo n.º 5
0
def cellWidthVsLatLon():
    km = 1000.0

    params = ct.default_params

    print("****QU120 background mesh and 10km refinement from NC to NH****")
    params["mesh_type"] = "QU"
    params["dx_max_global"] = 120.0 * km
    params["region_box"] = ct.Delaware_Bay
    params["plot_box"] = ct.Western_Atlantic
    params["dx_min_coastal"] = 10.0 * km
    params["trans_width"] = 600.0 * km
    params["trans_start"] = 400.0 * km

    cell_width, lon, lat = ct.coastal_refined_mesh(params)

    print("****5km refinement along coast from VA to NY****")
    params["region_box"] = ct.Delaware_Region
    params["plot_box"] = ct.Delaware
    params["dx_min_coastal"] = 5.0 * km
    params["trans_width"] = 175.0 * km
    params["trans_start"] = 75.0 * km

    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("****2km refinement inside Delaware Bay****")
    params["region_box"] = ct.Delaware_Bay
    params["plot_box"] = ct.Delaware
    params["restrict_box"] = ct.Delaware_restrict
    params["dx_min_coastal"] = 2.0 * km
    params["trans_width"] = 100.0 * km
    params["trans_start"] = 17.0 * km

    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    return cell_width / 1000, lon, lat
Ejemplo n.º 6
0
def cellWidthVsLatLon():
    km = 1000.0

    params = ct.default_params

    SFtoLA = {
        "include": [np.array([-124.0, -117.5, 34.2, 38.0])],  # SF to LA
        "exclude": [np.array([-122.1, -120.8, 37.7, 39.2])]
    }  # SF Bay Delta

    WestCoast = np.array([-136.0, -102.0, 22.0, 51])

    print("****QU120 background mesh and 300m refinement from SF to LA****")
    params["mesh_type"] = "QU"
    params["dx_max_global"] = 120.0 * km
    params["region_box"] = SFtoLA
    params["plot_box"] = WestCoast
    params["dx_min_coastal"] = 3.0 * km
    params["trans_width"] = 100.0 * km
    params["trans_start"] = 30.0 * km

    cell_width, lon, lat = ct.coastal_refined_mesh(params)

    return cell_width / 1000, lon, lat
Ejemplo n.º 7
0
def cellWidthVsLatLon():

    km = 1000.0

    params = ct.default_params
    params["dx_min_coastal"] = 8.0*km
    params["trans_width"] = 600.0*km
    params["trans_start"] = 400.0*km
    params["mesh_type"] = "EC"

    #params["plot_box"] = np.array([-80,-30,30,90])
    params["plot_box"] = ct.Entire_Globe
    params["plot_option"] = False

    print("***Gulf Coast***")
    params["region_box"] = ct.US_Gulf_Coast
    params["restrict_box"] = ct.Gulf_restrict
    cell_width, lon, lat = ct.coastal_refined_mesh(params)

    print("***East Coast***")
    params["region_box"] = ct.US_East_Coast
    params["restrict_box"] = ct.East_Coast_restrict
    cell_width,lon,lat = ct.coastal_refined_mesh(params,cell_width,lon,lat)

    print("***Caribbean***")
    params["region_box"] = ct.Caribbean
    params["restrict_box"] = ct.Caribbean_restrict
    params["trans_width"] = 400.0*km
    params["trans_start"] = 300.0*km
    params["n_longest"] = 50
    cell_width,lon,lat = ct.coastal_refined_mesh(params,cell_width,lon,lat)

    print("***West Coast***")
    params["region_box"] = ct.US_West_Coast
    params["restrict_box"] = ct.Empty
    params["trans_width"] = 600.0*km
    params["trans_start"] = 400.0*km
    params["n_longest"] = 10
    cell_width,lon,lat = ct.coastal_refined_mesh(params,cell_width,lon,lat)

    print("***Alaska***")
    params["region_box"] = ct.Alaska
    cell_width,lon,lat = ct.coastal_refined_mesh(params,cell_width,lon,lat)

    print("***Aleutian Islands (West)***")
    params["region_box"] = ct.Aleutian_Islands_W
    params["n_longest"] = 100
    params["trans_start"] = 200.0*km
    cell_width,lon,lat = ct.coastal_refined_mesh(params,cell_width,lon,lat)

    print("****Aleutian Islands (East)***")
    params["region_box"] = ct.Aleutian_Islands_E
    cell_width,lon,lat = ct.coastal_refined_mesh(params,cell_width,lon,lat)

    print("***Bering Sea (East)****")
    params["region_box"] = ct.Bering_Sea_E
    params["trans_start"] = 400.0*km
    params["trans_width"] = 600.0*km
    params["n_longest"] = 10
    cell_width,lon,lat = ct.coastal_refined_mesh(params,cell_width,lon,lat)

    print("***Bering Sea (West)***")
    params["region_box"] = ct.Bering_Sea_W
    params["restrict_box"] = ct.Bering_Sea_restrict
    params["trans_start"] = 450.0*km
    params["trans_width"] = 600.0*km
    params["n_longest"] = 10
    cell_width,lon,lat = ct.coastal_refined_mesh(params,cell_width,lon,lat)

    print("***Hawaii***")
    params["region_box"] = ct.Hawaii
    params["restrict_box"] = ct.Empty
    params["trans_start"] = 100*km
    params["trans_width"] = 200*km
    cell_width,lon,lat = ct.coastal_refined_mesh(params,cell_width,lon,lat)

    print("***Newfoundland***")
    Newfoundland = {"include":[np.array([-65.0,-50.0,44.0,60.0]),
                               np.array([-65.5,-64.5,61.0,62.0])],
                    "exclude":[]}
    params["region_box"] = Newfoundland
    params["restrict_box"] = ct.Empty
    params["trans_width"] = 600.0*km
    params["trans_start"] = 400.0*km
    cell_width,lon,lat = ct.coastal_refined_mesh(params,cell_width,lon,lat)

    print("***Greenland***")
    params["region_box"] = ct.Greenland
    params["restrict_box"] = ct.Empty
    params["trans_width"] = 600.0*km
    params["trans_start"] = 275.0*km
    cell_width, lon, lat = ct.coastal_refined_mesh(params,cell_width,lon,lat)

    print("***Labrador Sea***")
    params["region_box"] = ct.Empty
    params["restrict_box"] = ct.Empty
    params["point_list"] = [np.array([-50.0,55.0])]
    params["trans_width"] = 600.0*km
    params["trans_start"] = 400.0*km
    cell_width, lon, lat = ct.coastal_refined_mesh(params,cell_width,lon,lat)

    print("***Central America (West Coast)***")
    Central_America = {"include":[np.array([[-110.26,20.69],
                                            [-87.84, 8.94 ],
                                            [-84.55, 12.03],
                                            [-104.26,23.11]]),
                                  np.array([[-88.02, 10.47],
                                            [-81.53, 6.14],
                                            [-81.45, 8.07],
                                            [-84.80, 11.51]]),
                                  np.array([[-81.92, 7.76],
                                            [-76.84, 4.51],
                                            [-77.41, 8.22],
                                            [-79.23, 9.28]])],
                       "exclude":[]}
    params["region_box"] = Central_America
    params["restrict_box"] = ct.Empty
    params["point_list"] = None
    params["trans_width"] = 600.0*km
    params["trans_start"] = 400.0*km
    cell_width, lon, lat = ct.coastal_refined_mesh(params,cell_width,lon,lat)

    return cell_width / km, lon, lat
Ejemplo n.º 8
0
def cellWidthVsLatLon():

    km = 1000.0

    params = ct.default_params

    # Use 1.0 degree for fast scoping, and 0.1 for the final creation:
    params["ddeg"] = 0.2
    #params["ddeg"] = 1.0
    #params["ddeg"] = 0.5

    params["dx_min_coastal"] = 12.0 * km
    params["trans_start"] = 400.0 * km
    params["trans_width"] = 600.0 * km
    params["n_longest"] = 20
    params["mesh_type"] = "EC"

    params["plot_box"] = ct.Entire_Globe
    params["plot_option"] = False

    print("***Gulf Coast***")
    params["region_box"] = ct.US_Gulf_Coast
    params["restrict_box"] = ct.Gulf_restrict
    params["trans_start"] = 400.0 * km
    params["trans_width"] = 600.0 * km
    cell_width, lon, lat = ct.coastal_refined_mesh(params)

    print("***East Coast***")
    params["region_box"] = ct.US_East_Coast
    params["restrict_box"] = ct.East_Coast_restrict
    params["trans_start"] = 400.0 * km
    params["trans_width"] = 600.0 * km
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***Gulf Stream extension***")
    params["restrict_box"] = ct.Empty
    params["trans_width"] = 600.0 * km
    params["region_box"] = {
        "include": [np.array([-78, -70, 40, 42])],
        "exclude": []
    }
    params["trans_start"] = 700.0 * km
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)
    params["region_box"] = {
        "include": [np.array([-74, -50, 42, 55])],
        "exclude": []
    }
    params["trans_start"] = 1100.0 * km
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***Gulf Coast spot***")
    params["restrict_box"] = ct.Empty
    params["trans_width"] = 100.0 * km
    params["region_box"] = {
        "include": [np.array([-98, -94, 28, 30])],
        "exclude": []
    }
    params["trans_start"] = 400.0 * km
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***Greenland***")
    params["region_box"] = ct.Greenland
    params["restrict_box"] = ct.Empty
    params["trans_width"] = 600.0 * km
    params["trans_start"] = 275.0 * km
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***Greenland-Iceland smooth kink***")
    params["region_box"] = {
        "include": [np.array([-45, -40, 59, 62])],
        "exclude": []
    }
    params["trans_start"] = 700.0 * km
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***Hudson Bay***")
    params["region_box"] = {
        "include": [np.array([-100, -70, 50, 65])],
        "exclude": []
    }
    params["restrict_box"] = {
        "include": [np.array([-100, -70, 50, 65])],
        "exclude": []
    }
    params["trans_start"] = 600.0 * km
    params["trans_width"] = 100.0 * km
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***Northern Canada***")
    params["region_box"] = {
        "include": [np.array([-168, -59, 67, 85])],
        "exclude": []
    }
    params["restrict_box"] = ct.Empty
    params["trans_start"] = 275.0 * km
    params["trans_width"] = 600.0 * km
    params["n_longest"] = 20
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***Alaska***")
    params["region_box"] = ct.Alaska
    params["trans_start"] = 400.0 * km
    params["trans_width"] = 600.0 * km
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***Crook at Alaska/Canada***")
    params["region_box"] = {
        "include": [np.array([-144, -127, 68.5, 71])],
        "exclude": []
    }
    params["restrict_box"] = ct.Empty
    params["trans_start"] = 550.0 * km
    params["trans_width"] = 600.0 * km
    params["n_longest"] = 20
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***Caribbean***")
    params["region_box"] = ct.Caribbean
    params["restrict_box"] = ct.Caribbean_restrict
    params["trans_width"] = 400.0 * km
    params["trans_start"] = 300.0 * km
    params["n_longest"] = 50
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***West Coast***")
    params["region_box"] = ct.US_West_Coast
    params["restrict_box"] = ct.Empty
    params["trans_width"] = 600.0 * km
    params["trans_start"] = 400.0 * km
    params["n_longest"] = 10
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***Aleutian Islands (West)***")
    params["region_box"] = ct.Aleutian_Islands_W
    params["n_longest"] = 100
    params["trans_start"] = 200.0 * km
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("****Aleutian Islands (East)***")
    params["region_box"] = ct.Aleutian_Islands_E
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***Bering Sea (East)****")
    params["region_box"] = ct.Bering_Sea_E
    params["trans_start"] = 400.0 * km
    params["trans_width"] = 600.0 * km
    params["n_longest"] = 10
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***Bering Sea (West)***")
    params["region_box"] = ct.Bering_Sea_W
    params["restrict_box"] = ct.Bering_Sea_restrict
    params["trans_start"] = 450.0 * km
    params["trans_width"] = 600.0 * km
    params["n_longest"] = 10
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***Newfoundland***")
    Newfoundland = {
        "include": [
            np.array([-65.0, -50.0, 44.0, 60.0]),
            np.array([-65.5, -64.5, 61.0, 62.0])
        ],
        "exclude": []
    }
    params["region_box"] = Newfoundland
    params["restrict_box"] = ct.Empty
    params["trans_width"] = 600.0 * km
    params["trans_start"] = 400.0 * km
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***Labrador Sea***")
    params["region_box"] = ct.Empty
    params["restrict_box"] = ct.Empty
    params["point_list"] = [np.array([-50.0, 55.0])]
    params["trans_width"] = 600.0 * km
    params["trans_start"] = 400.0 * km
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    print("***Central America (West Coast)***")
    Central_America = {
        "include": [
            np.array([[-110.26, 20.69], [-87.84, 8.94], [-84.55, 12.03],
                      [-104.26, 23.11]]),
            np.array([[-88.02, 10.47], [-81.53, 6.14], [-81.45, 8.07],
                      [-84.80, 11.51]]),
            np.array([[-81.92, 7.76], [-76.84, 4.51], [-77.41, 8.22],
                      [-79.23, 9.28]])
        ],
        "exclude": []
    }
    params["region_box"] = Central_America
    params["restrict_box"] = ct.Empty
    params["point_list"] = None
    params["trans_width"] = 600.0 * km
    params["trans_start"] = 400.0 * km
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    # coast of Maine
    params["dx_min_coastal"] = 6.0 * km
    params["trans_start"] = 500.0 * km
    params["trans_width"] = 300.0 * km
    params["n_longest"] = 20
    params["region_box"] = {
        "include": [np.array([-70, -68, 43, 45])],
        "exclude": []
    }
    params["restrict_box"] = {
        "include": [],
        "exclude": [np.array([-73, -60, 46, 50])]
    }
    params["point_list"] = [[-68.8, 43.8]]
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    # coast of Maine
    params["dx_min_coastal"] = 2.0 * km
    params["trans_start"] = 150.0 * km
    params["trans_width"] = 300.0 * km
    params["n_longest"] = 20
    params["region_box"] = {
        "include": [np.array([-70, -68, 43, 45])],
        "exclude": []
    }
    params["restrict_box"] = {
        "include": [],
        "exclude": [np.array([-73, -50, 46, 50])]
    }
    params["point_list"] = [[-68.8, 43.8]]
    cell_width, lon, lat = ct.coastal_refined_mesh(params, cell_width, lon,
                                                   lat)

    return cell_width / km, lon, lat