Skip to content

Instantly share code, notes, and snippets.

View e5k's full-sized avatar

Sébastien Biass e5k

View GitHub Profile
# %%
import GEE as gee
from GEElt.collections import MODISVImerge, reduceAnomaly, getTime, sequentialMap
from GEElt.ts import ts_extract
from GEElt.resources import *
from GEElt.colorbrewer import *
from geetools import bitreader
import numpy as np
@e5k
e5k / ERA5.md
Last active January 19, 2022 20:25
ERA5_download.py
#!/usr/bin/env python
import cdsapi
import calendar
import os


# Time of dataset
year_start  = 2015
year_end    = 2020
@e5k
e5k / vscode.md
Last active May 24, 2021 02:40
VScode shortcuts
Command Shortcut
Python: Go to Next Cell Ctrl+Alt+]
Python: Go to Previous Cell Ctrl+Alt+[
Python: Change Cell to Code Ctrl+; C
Python: Change Cell to Markdown Ctrl+; M
@e5k
e5k / zshrc.md
Last active June 1, 2021 07:41
.zshrc

Default .zshrc file on EOS MBP

Don't forget to source ~/.zshrc

# Commands
alias ll='ls -lrtah'

# SSH
@e5k
e5k / CommonUnixCmd.md
Last active October 26, 2021 08:14
Gekko / Unix

Files and folder management

Size of a folder

du -sh folder
@e5k
e5k / bashrc
Created May 13, 2021 06:55
Useful commands in bashrc
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -iv'
alias mkdir='mkdir -p'
alias ps='ps auxf'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
@e5k
e5k / contour_raster_rasterio.py
Last active February 15, 2021 02:34
contour_raster_rasterio
# From https://stackoverflow.com/questions/41487642/how-to-export-contours-created-in-scikit-image-find-contours-to-shapefile-or-geo
import rasterio as rio
flpth = '/Users/seb/Documents/Codes/VolcGIS/volcanoes/Agung/_hazard/Tephra/Agung_VEI3_P5.tif'
schema = {"geometry": "Polygon", "properties": {"value": "int"}}
maskVal = 1000
with rio.open(flpth) as src: