This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# batch convert pdf to tiff files | |
# takes one argument, resolution in dpi | |
# use: pdf2tiff.sh 150 | |
# will convert all pdfs in the current | |
# directory to tiff files at 150dpi | |
files=`ls *.pdf` | |
for i in $files;do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# MODIS Batch Download Tool Command Line (MBDTcl) | |
# | |
# Bash script to download all modis hdf files for a particular year | |
# to the current directory. | |
# | |
# Beware this script will only download level 5 products | |
# if other products are selected the script will fail. | |
# | |
# Coded by Koen Hufkens at Boston University 2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# convert wingscape PlantCam files | |
# and moves the files into the desired file structure | |
# for easy processing with the PhenoCam GUI or toolkit | |
# | |
# NOTE: requires a running version of linux/Mac or cygwin | |
# with exif installed. | |
# | |
# USE: plant2phenocam.sh MYSITE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Bash script to download all NCDC weather records for | |
# a list of stations (Station number (AWS/WMO/DATSAV3 number)) | |
# (it's easy to adjust the script to take any selection | |
# of years, just replace the ncftpls query for the years | |
# with a years file of your own liking or a range in the | |
# for loop e.g. years 2001 - 2010 = {2001..2010..1} ) | |
# | |
# raw data is downloaded, extracted from gz files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# swath to grid conversion for | |
# MOD04 reflectance data | |
# | |
# get the reprojection information | |
gdal_translate -of VRT HDF4_EOS:EOS_SWATH:"$1":mod04:Mean_Reflectance_Land land.vrt | |
gdal_translate -of VRT HDF4_EOS:EOS_SWATH:"$1":mod04:Mean_Reflectance_Ocean ocean.vrt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# calculate adjusted phenology dates | |
# for greenness onset and maximum | |
extract_MODIS_phenology_layer <- function(value="increase",tiles_file="mytiles.txt"){ | |
# load required libraries | |
require(raster) | |
require(MODIS) # to import the SDS layers | |
# list all hdf files, and extract unique years |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-------- arctic map | |
library(sp) | |
library(maps) | |
library(rgeos) | |
# function to slice and dice a map and convert it to an sp() object | |
maps2sp = function(xlim, ylim, l.out = 100, clip = TRUE) { | |
stopifnot(require(maps)) | |
m = map(xlim = xlim, ylim = ylim, plot = FALSE, fill = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(raster) | |
library(maps) | |
library(maptools) | |
library(sf) | |
library(scales) | |
# set coordinate systems | |
robinson = CRS(" +proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs") | |
latlon = CRS("+init=epsg:4326") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' @param species: genus species or genus | |
#' @param quiet: TRUE / FALSE provides verbose output | |
#' @keywords Tropicos, species distribution | |
#' @examples | |
#' | |
#' # with defaults, outputting a data frame with species distribution | |
#' # for Clematis | |
#' df <- tropicos.species.distribution() | |
#' # returns NA if no data are present | |
#' [requires the rvest package for post-processing] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// years to process (from start year t0 to end year t1) | |
var t0 = "2001"; | |
var t1 = "2014"; | |
var LC = ee.ImageCollection('MCD12Q1') | |
.select('Land_Cover_Type_1') | |
.filterDate(t0.concat("-01-01"),t1.concat("-12-31")) | |
.median(); | |
// Create a geometry representing an export region. |
OlderNewer