Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Ting Sun sunt05

🏠
Working from home
View GitHub Profile
@sunt05
sunt05 / plot-SUEWS-stab.py
Last active Aug 10, 2019
Plot stability correction functions used in SUEWS 2019a
View plot-SUEWS-stab.py
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
View qgis3_standalone_osx.py
"""
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
@sunt05
sunt05 / QuickStart-Docker-mingw-python3-macOS.md
Created Oct 3, 2018
Quickstart for Windows-targeted development on macOS with `mingw`+`python3`
View QuickStart-Docker-mingw-python3-macOS.md

Quickstart for Windows-targeted development on macOS with mingw+python3

1. install Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2. install Virtual Box (free):

brew cask install virtualbox
@sunt05
sunt05 / example_explicit.f95
Last active Aug 10, 2017
SUEWS interface improvement
View example_explicit.f95
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
@sunt05
sunt05 / gist:1cdc72c2bfe2cabdd33e1528eb82dc1d
Created Jul 30, 2017 — forked from agathe/gist:2956101
VBA Excel - Convert each sheet to CSV - For MAC
View gist:1cdc72c2bfe2cabdd33e1528eb82dc1d
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
You can’t perform that action at this time.