-
Command line tool installation (for PC)
-
Make sure you have a valid VPN
-
Conda install
Follow this page.
Maybe add other channels, e.g.,
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
Change conda to default channel:conda config --remove-key channels
Set environment variables following this page. -
Install the Google Cloud CLI
Follow this page. -
Authentication Earth Engine
First set environment variables as
name: http_proxy
value: socks5://server:port (e.g., socks5://127.0.0.1:7890)
name: https_proxy
value: socks5://server:port (e.g., socks5://127.0.0.1:7890)
and then authenticate Earth Engineset http_proxy=socks5://127.0.0.1:7890 set https_proxy=socks5://127.0.0.1:7890 earthengine authenticate set http_proxy= set https_proxy=
-
Make python3 available
Follow this page. -
Install geeup
First re-open Terminal, and enter the ee environment you just created byconda activate ee
. Install geeup by the commandpip install geeup
. After installation, test it bygeeup -h
. -
Disable python aliases (optional)
Follow this page. -
Set up geeup (cookies)
Follow this page. -
Examples
- help
geeup -h
- get metadata
geeup getmeta --input "C:/Users/zhao_/Nutstore/1/Nutstore/wc_10m_prec" --metadata "C:/Users/zhao_/Nutstore/1/Nutstore/wc_10m_prec/metadata.csv"
- image batch upload
geeup upload --source "C:/Users/jzhao/Downloads/tif" --dest "projects/ee-jzhao-external-dataset/assets/raster/urban-climate-in-europe/paris" -m "C:/Users/jzhao/Downloads/tif/metadata.csv" -u "[email protected]"
- delete image/image collection
geeup delete --id projects/ee-jzhao-crop-response-to-o3/assets/viirs-sr-red-500-filling
- upgrade geeup
pip install --upgrade geeup
-
-
Command line tool installation (for Mac)
- Use /bin/sh
Open Terminal on Mac thencommand + ,
to Preferences. Change Default login shell to /bin/sh.
- Conda install
Follow this page. - Install the Google Cloud CLI
Follow this page. - Install pip on Mac
Follow this page. You may need to install the command line developer tools. - Set up environmental variables
- Create a profile file if you don't have one by opening Terminal and issuing the command
touch .profile
, then close Terminal. - Add the two lines below to the profile file either manually (the file should be hidden in /Users/<your username>/.profile) or by
vim ~/.profile
.
export PATH=/Users/<your username>/miniconda3/bin:$PATH export PATH=/Users/<your username>/google-cloud-sdk/bin:$PATH
- Create a profile file if you don't have one by opening Terminal and issuing the command
- Install geeup
First re-open Terminal, and enter the ee environment you just created bysource $HOME/miniconda3/bin/activate
and thenconda activate ee
. Install geeup by the commandpip install geeup
. After installation, test it bygeeup -h
. - Set up geeup (cookies)
Follow this page.
geeup getmeta --input "C:/Users/jzhao/Downloads/nc" --metadata "C:/Users/jzhao/Downloads/nc/metadata.csv"
- Use /bin/sh
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings https://stackoverflow.com/questions/65348890/python-was-not-found-run-without-arguments-to-install-from-the-microsoft-store
- Image batch upload
geeup upload --source "D:/Data/MSWX/Monthly/Processed" --dest "projects/ee-jzhao-external-dataset/assets/raster/mswx/past/monthly" -m "D:/Data/MSWX/Monthly/Processed/metadata.csv" -u "[email protected]"
- Reproject image1 to image2
image1.resample('bilinear').reproject({
crs: image2.projection().crs(),
scale: image2.projection().nominalScale()
});
- Import Windows fonts to R
install.packages('remotes')
remotes::install_version('Rttf2pt1', version = '1.3.8')
install.packages('extrafont')
extrafont::font_import()
extrafont::loadfonts(device = 'win')
- Rstudio header
snippet header
## ----------------------------------
# Title:
# Objective:
# Created by: Jiacheng Zhao
# Created on: `r Sys.Date()`
# Copyright (c) Jiacheng Zhao, `r format(Sys.Date(), "%Y")`
# Nanjing University of Information Science & Technology (NUIST)
# Email: [email protected]
## ----------------------------------
snippet par
# cex --------------------------------
cex.axis = 1.1
cex.point = 1.7
cex.legend = 1
cex.label = 0.7
cex.axis.label = 0.8
cex.title = 1.5
# font -------------------------------
font = 'Calibri'
# lwd --------------------------------
lwd = 0.5
medlwd = 1.3
boxwex = 0.18
lwd.axis = 0.5
# axis -------------------------------
x.axis.line = 2.2; y.axis.line = 1.8
mgp1 = c(3, 0.1, 0)
mgp2 = c(3, 0.2, 0)
mgp3 = c(3, 0.1, 0)
mgp4 = c(3, 0.2, 0)
tck = 0.03
# legend -----------------------------
inset = c(0, 2)
x.intersp = 0.9; y.intersp = x.intersp
# color ------------------------------
col = 'red'
cols = c('seagreen', 'gold')
# par --------------------------------
par(
cex.axis = cex.axis,
family = font,
las = 1,
lwd = lwd,
mai = c(0, 0.5, 0, 0.2),
mfrow = c(6, 1),
oma = c(6.5, 1.5, 2, 1),
tck = tck
)
- Create an r package
require(devtools)
setwd('C:/Users/jzhao/Documents/Nutstore/Projects')
create('smot')
- Pattern matching and replacement
DT[grep('(?=.*A)(?!.*W)', group, perl = T)]
- Requests of ERA5-Land hourly data
era5cli hourly --land --variables 2m_temperature --startyear 1950 --endyear 1950 --splitmonths True
- Batch unzip
"C:\Program Files\7-zip\7z.exe" e *.zip