Skip to content

Instantly share code, notes, and snippets.

Avatar

vfive fivejjs

  • Data scientist and engineer
  • Sydney Australia
View GitHub Profile
View gist:08b6299be5dd2c6f428b68f0e4d6bc96

Let's say you have a Pull Request from myBranch to master with 3 commits, and you want them to appear as a single commit in master.

If you're merging on the command line, this is trivial:

git checkout master
git merge --squash myBranch
git commit
@fivejjs
fivejjs / odc-dscache-csv-odd-tiles-to-geojson.py
Created Apr 13, 2021
Find the odd tiles from the odc dscache csv.
View odc-dscache-csv-odd-tiles-to-geojson.py
from collections import defaultdict
import pandas as pd
df_new = pd.read_csv('s2_l2a_all.csv') # add absolut path of csv
xy_t = defaultdict(list)
for row in df_2019.itertuples():
xy_t[(row.X, row.Y)].append(row.T)
@fivejjs
fivejjs / odc-dscache-tile-to-geojson.py
Last active Apr 13, 2021
use odc tools to check the tile in geojson format
View odc-dscache-tile-to-geojson.py
# generate the tile geojson
from odc.dscache.tools.tiling import GRIDS
import json
# check the keys with: GRIDS.keys()
africa10 = GRIDS['africa_10']
gb = africa10.tile_geobox((246, 50))
View dummy-indexing.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fivejjs
fivejjs / crop_mask_feature_layer.py
Created Feb 15, 2021 — forked from cbur24/crop_mask_feature_layer.py
Feature layer function for production run of eastern crop-mask
View crop_mask_feature_layer.py
def gm_mads_two_seasons(ds1, ds2):
"""
Feature layer function for production run of
eastern crop-mask
"""
def fun(ds, era):
#normalise SR and edev bands
for band in ds.data_vars:
if band not in ['sdev', 'bcdev']:
ds[band] = ds[band] / 10000
@fivejjs
fivejjs / librosa_parallel.py
Created Dec 12, 2019 — forked from tracek/librosa_parallel.py
Running librosa parallel for loops with multiprocessing and joblib
View librosa_parallel.py
# The script illustartes stunning difference on my machine with processing of signal with multiprocessing and joblib.
# The slowness of multiprocessing is likely caused by oversubscription
import time
import numpy as np
import librosa
from joblib import Parallel, delayed
from functools import partial
from multiprocessing import Pool
View 1.html.md

傅立叶变换的物理意义

原创 2016-04-08 yangboy2

昨天我们分享了一篇《FFT结果的物理意义》一文,有些网友表示看不大明白,为此我们整理重发一篇去年分享过的《傅里叶变换的物理意义》一文,以便大家更好的理解。

1. 先看下面的两幅动画,增加对傅立叶变换的印象

View 1.html.md

傅立叶变换的物理意义

原创 2016-04-08 yangboy2

昨天我们分享了一篇《FFT结果的物理意义》一文,有些网友表示看不大明白,为此我们整理重发一篇去年分享过的《傅里叶变换的物理意义》一文,以便大家更好的理解。

1. 先看下面的两幅动画,增加对傅立叶变换的印象

View docker-cheat-sheat.md

Build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes

View keybase.md

Keybase proof

I hereby claim:

  • I am fivejjs on github.
  • I am jinjunsun (https://keybase.io/jinjunsun) on keybase.
  • I have a public key ASBIkHDrGNWV9gLbFeUfFBGomvnPI2ivtyEgj_TmeW50Tgo

To claim this, I am signing this object: