Scripts for converting LANDSAT GeoTIFF tiles into NetCDF, serving them via a local THREDDS Data Server, and extracting site-level multi-band time series through OPeNDAP subsetting.
Note: This README was reconstructed by reading the source code; the original repo had no description. Please verify the inferred purpose and usage details against your own intent before relying on it.
The workflow assembles three stages:
- Raster -> NetCDF conversion (
LANDSAT/rastertonc.py,LANDSAT/TileMaker.R) — convert a directory of LANDSAT.tiftiles into.ncfiles (via ArcPyRasterToNetCDF_mdin Python, orraster::writeRasterin R). - Tile catalog (
LANDSAT/Tile_extents.csv, built withLANDSAT/TileMaker.R) — record each tile's filename, date, and spatial extent so a downstream client can pick which tiles cover a given site. - OPeNDAP site extraction (
LANDSAT/Opendap.R,LANDSAT/Site_LANDSAT_reader.R) — given a list of site coordinates, look up which tiles intersect each site, subset only the needed lat/lon window over OPeNDAP from a local THREDDS server (started via theunidata/thredds-dockerimage if not already running), and save per-site multi-band reflectance time series as.RDSfiles.LANDSAT/formatter.Rthen restacks the extracted pixels into per-dateRasterStacks for plotting (e.g. RGB composites).
- R —
tidyverse,raster,ncdf4,tidync,furrr,callr,lubridate,gdalUtils,rgdal,RCurl - Python —
arcpy(requires an ArcGIS install with the Spatial Analyst extension); standard librarymultiprocessing,os - External — Docker (for
unidata/thredds-docker), a local THREDDS Data Server on port 80 / 8080
R packages:
install.packages(c(
"tidyverse", "raster", "ncdf4", "tidync", "furrr",
"callr", "lubridate", "RCurl"
))
# gdalUtils and rgdal are retired on CRAN; install from archive or use alternativesPython (ArcPy ships with ArcGIS Pro / ArcMap; it is not pip-installable):
# Use the Python interpreter bundled with your ArcGIS install
"C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe" LANDSAT/rastertonc.pyStart a THREDDS server (used by the R extraction scripts):
docker run --rm --name tds -d -p 80:8080 \
-v /path/to/content:/usr/local/tomcat/content \
unidata/thredds-dockerSubset a single NetCDF from a running THREDDS server over OPeNDAP:
source("LANDSAT/Opendap.R")
url <- "http://localhost:8080/thredds/dodsC/testAll/2013-05-131-0000009472-0000009472.nc"
xmin <- -93; xmax <- -92.75
ymin <- 38.75; ymax <- 39
pixels <- OpenDap_LANDSAT(url, ymax, ymin, xmin, xmax)
head(pixels) # value, lon, lat, bandA minimal end-to-end example is in examples/extract_site.R.
LANDSAT/rastertonc.py— ArcPy script: parallel conversion of.tifrasters to NetCDF.LANDSAT/TileMaker.R— Builds a date/extent catalog of tiles and writes per-tile NetCDF.LANDSAT/Tile_extents.csv— Catalog of tile filenames, dates, and bounding boxes.LANDSAT/Opendap.R—OpenDap_LANDSAT()helper: subsets a NetCDF over OPeNDAP by lat/lon bounds.LANDSAT/Site_LANDSAT_reader.R— Iterates a site list, finds covering tiles, runs each subset in an isolatedcallrR session, saves.RDS.LANDSAT/formatter.R— Reshapes extracted pixels back into per-dateRasterStacks and renders RGB plots.examples/extract_site.R— Minimal runnable example of the OPeNDAP subset call.
No CITATION.cff or paper reference was found in the source.
No LICENSE file is present — contact the authors before reuse.