Skip to content

Instantly share code, notes, and snippets.

View giswqs's full-sized avatar

Qiusheng Wu giswqs

View GitHub Profile
@fabricebrito
fabricebrito / sentinel1.md
Last active September 24, 2020 06:17
Download ESA Sentinel-1 data from Sentinel-1 Scientific Data Hub (https://scihub.esa.int/dhus/)

Download ESA Sentinel-1 data from Sentinel-1 Scientific Data Hub (https://scihub.esa.int/dhus/)

Create a Sentinel-1 Scientific Data Hub account

Go here: https://scihub.esa.int/dhus/ and look for a "Register" link. Follow the registration steps.

Get aria2

aria2 is a lightweight multi-protocol & multi-source command-line download utility. It supports HTTP/HTTPS, FTP, BitTorrent and Metalink.

@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active November 11, 2024 21:28
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@nishadhka
nishadhka / rastermerege-rasterio,py
Created July 30, 2017 12:05
Raster merge using rasterio
import rasterio.merge
bounds=None
res=None
nodata=None
precision=7
def merge(input1,bounds, res, nodata, precision):
import warnings
warnings.warn("Deprecated; Use rasterio.merge instead", DeprecationWarning)
@kemingy
kemingy / auto_deploy_blog.md
Created August 6, 2018 11:41
Auto deploy blog generated by jekyll with jekyll-archives

Auto-Deploying Blogs to GitHub Pages with Travis CI

GitHub Pages doesn't support jekyll-archives now PR. We can use Travis CI to build it and push to gh-pages branch.

There is already some gists talks about this topic using bash. However, Travis now support deploy in .travis.yml , which is super easy to set up. (Deploying to GitHub Pages is experimental now [2018.07.25])

Create .travis.yml File

Here is an example.

# This script relies on the magick library, see this vignette for more information:
# https://cran.r-project.org/web/packages/magick/vignettes/intro.html
#
# If you have Windows or Mac OS, I believe ImageMagick STL is integrated with the CRAN distribution
# of the R magick library. If on Linux, see the "Build from source" section of the above URL
#
# This script will add year annotations from GIF animations generated and downloaded from the
# LT-GEE Time Series Animator open access Earth Engine App:
# https://emaprlab.users.earthengine.app/view/lt-gee-time-series-animator
#
@jdbcode
jdbcode / EE Annual NDVI Animation.R
Last active October 9, 2020 17:47
R script to add date annotations to a time series GIF created in Earth Engine.
# R script to add date annotations to a time series GIF created in Earth Engine.
library(magick)
gif = "C:/Users/braatenj/Downloads/africa.gif"
dates = c(
'Jan-08',
'Jan-24',
'Feb-09',
'Feb-25',
@Mlawrence95
Mlawrence95 / confusion_matrix.py
Last active March 26, 2024 10:25
Python: create a confusion matrix across two columns in a Pandas dataframe having only categorical data
import pandas as pd
def confusion_matrix(df: pd.DataFrame, col1: str, col2: str):
"""
Given a dataframe with at least
two categorical columns, create a
confusion matrix of the count of the columns
cross-counts
use like:
@jdbcode
jdbcode / q_350771_68792.ipynb
Created February 18, 2020 20:52
q_350771_68792.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdbcode
jdbcode / ee_landtrendr_fitted_rgb_thumbnails.py
Last active February 24, 2023 13:52
Earth Engine LandTrendr fitted RGB thumbnail time series
"""
Copyright 2020 Justin Braaten
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@KMarkert
KMarkert / smap_l2_9km_gridding.ipynb
Last active June 22, 2020 18:45
smap_l2_9km_gridding.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.