/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew cask install virtualbox
#!/usr/bin/env zsh | |
# This script fixes the environment.yml file for a conda environment. | |
# Dr Ting Sun (ting.sun@ucl.ac.uk) + GitHub Copilot | |
# 09 Nov 2023: Initial version | |
# 11 Feb 2024: | |
# - Better handling of the pip section | |
# - Add "-f" flag to force overwrite the original env.yml file | |
import supy as sp | |
import pandas as pd | |
# using a short period of forcing for example | |
df_forcing_test = df_forcing.loc["2021-7-1"] | |
# create an empty list to store dataframes | |
list_res = [] | |
for grid in df_state_init.index: | |
df_out, df_state_fina = sp.run_supy(df_forcing_test, df_state_init.loc[[grid]]) |
generate metric wedge plot; inspired by https://www.nature.com/articles/s41597-021-01079-3/figures/3 |
name: qgis_env | |
channels: | |
- conda-forge | |
- defaults | |
dependencies: | |
- python=3.8 | |
- pandas | |
- xarray | |
- geopandas | |
- georasters |
import pandas as pd | |
import numpy as np | |
# working for SUEWS v2019a: supy_driver >= 2019a2 | |
from supy_driver import atmmoiststab_module as atm | |
# create z/L range | |
ser_zl = pd.Series(np.arange(-5, 2, .2)) | |
# base DataFrame with z/L and scheme columns | |
df_zl_psi = pd.DataFrame({i: ser_zl |
""" | |
Standalone python script for QGIS3 on OSX. | |
""" | |
import os | |
import sys | |
# Define plugin locations from QGIS3 | |
sys.path.append('/Applications/QGIS3.app/Contents/Resources/python/') | |
sys.path.append('/Applications/QGIS3.app/Contents/Resources/python/plugins') | |
# Define Qt5 plugin path since Qt5 can't find it |
calPotEvap(& ! compared with the above subroutine, you may find we put all input and output variables explicitly here | |
TSurf, Qair, SoilMoist, Res, PET) | |
! below are pseudo-code and comments: | |
implict none | |
real, intent(in):: TSurf, Qair, SoilMoist, Res | |
real, intent(out):: PET | |
real:: Rho,Lv ! these are constant values: Rho (air density), Lv (latent heat of vaporization) | |
PET= soilMoist*Rho*Lv/Res*(qsat(Tsurf)-Qair) ! this is the final result we want |
Function SaveAllSheetsAsCSV(outputPath As String) | |
On Error GoTo Heaven | |
' each sheet reference | |
Dim Sheet As Worksheet | |
' path to output to | |
'Dim outputPath As String | |
' name of each csv | |
Dim OutputFile As String |