zoukankan      html  css  js  c++  java
  • delft3d 流场

    import okean
    import eofs
    from eofs.standard import Eof
    import pandas as pd
    import numpy as np
    import glob
    import datetime
    from matplotlib import pyplot as plt
    import copy
    import re
    import time
    from pylab import *
    import matplotlib.dates as mdate
    import matplotlib.patches as patches
    import matplotlib.ticker as ticker
    import copy
    import geopandas as gpd
    from pykrige.ok import OrdinaryKriging
    from pykrige.kriging_tools import write_asc_grid
    import pykrige.kriging_tools as kt
    from matplotlib.colors import LinearSegmentedColormap
    from matplotlib.patches import Path, PathPatch
    from shapely.geometry import LineString
    from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
    from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
    import netCDF4
    import netcdftime
    from pyd3d.output1 import processNetCDF
    import xarray as xr
    import netCDF4
    import netcdftime
    from netcdftime import utime
    import os,sys
    import okean.calc as calc
    from plotting import plot_settings as ps
    from plotting import angles
    from processing_2d import vector_sum
    import ipywidgets as widgets
    from glob import glob

    tick2_spacing = 0.1
    tick3_spacing = 0.1

    xs = xr.open_dataset(r'F:model rim-a_jan-feb_1.nc')


    fg = gpd.read_file(r'.xinqiao_outline.shp')
    fg1 = fg.to_crs(crs = 'EPSG:4326')






    u_arr1 = xs.U1.values[1205][0]
    u_arr = xs.U1.values[1210][0]
    v_arr1 =xs.V1.values[1205][0]
    v_arr =xs.V1.values[1210][0]

    x = xs.XCOR.values
    y = xs.YCOR.values


    fig = plt.figure(figsize=(16,8))
    plt.rcParams['font.sans-serif'] = 'Times New Roman'
    plt.rcParams['font.size'] = 15
    subplots_adjust(left=0.1,bottom=0.15,top=0.95,right=0.95,hspace=0.15,wspace=0.15)


    lat_formatter = LatitudeFormatter()
    lon_formatter = LongitudeFormatter()

    ax = fig.add_subplot(121)
    fg1.geometry.plot(facecolor='white',edgecolor='black',alpha=0.5,ax =ax)
    ax.quiver(x,y,u_arr,v_arr,scale = 40)


    ax.set_ylim(31.49,31.705)
    ax.set_xlim(121.274,121.605)

    ax.yaxis.set_major_locator(ticker.MultipleLocator(tick2_spacing))
    ax.xaxis.set_major_locator(ticker.MultipleLocator(tick3_spacing))

    ax.yaxis.set_major_formatter(lat_formatter)
    ax.xaxis.set_major_formatter(lon_formatter)

    ax.tick_params(labelsize=15,axis='y',rotation=90)
    ax.tick_params(labelsize=15,axis='x',rotation=0)

    ax1 = fig.add_subplot(122)

    ax1.quiver(x,y,u_arr1,v_arr1,scale = 40)
    fg1.geometry.plot(facecolor='white',edgecolor='black',alpha=0.5,ax =ax1)

    ax1.set_ylim(31.49,31.705)
    ax1.set_xlim(121.274,121.605)

    ax1.yaxis.set_major_locator(ticker.MultipleLocator(tick2_spacing))
    ax1.xaxis.set_major_locator(ticker.MultipleLocator(tick3_spacing))

    ax1.yaxis.set_major_formatter(lat_formatter)
    ax1.xaxis.set_major_formatter(lon_formatter)

    ax1.tick_params(labelsize=15,axis='y',rotation=90)
    ax1.tick_params(labelsize=15,axis='x',rotation=0)

    plt.savefig(r'./ku_xiaochao.svg',dpi = 200)
    plt.show()
























  • 相关阅读:
    springboot 获取enviroment.Properties的几种方式
    Spring Boot加载配置文件的完整步骤
    SpringBoot测试Controller层
    SpringBoot集成测试
    PowerMockito模拟private static final类变量
    玩转Spring JUnit+mockito+powermock单元测试
    Junit测试Controller(MockMVC使用),传输@RequestBody数据解决办法
    spring boot 使用@ConfigurationProperties加载配置文件到类中
    Rsync命令参数详解
    Linux PS 命令详解
  • 原文地址:https://www.cnblogs.com/chenyun-delft3d/p/14735312.html
Copyright © 2011-2022 走看看