Skip to content

Instantly share code, notes, and snippets.

View giswqs's full-sized avatar

Qiusheng Wu giswqs

View GitHub Profile
@jdbcode
jdbcode / ee_image_chips.ipynb
Last active March 23, 2023 17:59
Create image chips that have consistent dimensions despite varying aspect ratios of input image region using Earth Engine and PIL
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@darrenwiens
darrenwiens / STAC Leafmap time series
Last active January 29, 2023 11:17
Make a Leafmap time series animation from STAC query results
import ipyleaflet
import json
import leafmap
import requests
stac_api = "https://earth-search.aws.element84.com/v0"
search_endpoint = f"{stac_api}/search"
collection = "sentinel-s2-l2a-cogs"
payload = {
@jdbcode
jdbcode / geemap_timestamp_gif.ipynb
Last active February 20, 2021 11:05
geemap_timestamp_gif.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdbcode
jdbcode / ee_filmstrip_gif.ipynb
Last active October 3, 2022 17:54
ee_filmstrip_gif.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
import pandas as pd
def sklearn_tree_to_ee_string(estimator, feature_names):
# extract out the information need to build the tree string
n_nodes = estimator.tree_.node_count
children_left = estimator.tree_.children_left
children_right = estimator.tree_.children_right
feature_idx = estimator.tree_.feature
@KMarkert
KMarkert / smap_l2_9km_gridding.ipynb
Last active June 22, 2020 18:45
smap_l2_9km_gridding.ipynb
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
@jdbcode
jdbcode / q_350771_68792.ipynb
Created February 18, 2020 20:52
q_350771_68792.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 / 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',