Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. import pandas as pd
  2. import numpy as np
  3. # working for SUEWS v2019a: supy_driver >= 2019a2
  4. from supy_driver import atmmoiststab_module as atm
  5.  
  6. # create z/L range
  7. ser_zl = pd.Series(np.arange(-5, 2, .2))
  8.  
  9. # base DataFrame with z/L and scheme columns
  10. df_zl_psi = pd.DataFrame({i: ser_zl
  11. for i in [0, 2, 3, 4]}).rename({
  12. 0: '$z/L$'
  13. }, axis=1).set_index(r'$z/L$')
  14. # momentum
  15. df_zl_psi_mom = df_zl_psi.apply(lambda x: x.apply(lambda zl: atm.stab_psi_mom(
  16. x.name, zl, zl)))
  17. # heat and vapour
  18. df_zl_psi_heat = df_zl_psi.apply(lambda x: x.apply(
  19. lambda zl: atm.stab_psi_heat(x.name, zl, zl)))
  20.  
  21. # plot Psi_m
  22. ax = df_zl_psi_mom.plot(logy=False)
  23. _ = ax.set_ylabel(r'$\Psi_m$')
  24.  
  25. # plot Psi_h
  26. ax = df_zl_psi_heat.plot(logy=False)
  27. _ = ax.set_ylabel(r'$\Psi_h$')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement