Skip to content

Instantly share code, notes, and snippets.

@csaybar
Last active October 30, 2021 15:34
Show Gist options
  • Save csaybar/59d666d7b971ba010a7116fb129b4f26 to your computer and use it in GitHub Desktop.
Save csaybar/59d666d7b971ba010a7116fb129b4f26 to your computer and use it in GitHub Desktop.
julia and ee_extra
using Plots, Colors, FileIO, ImageIO
using PyCall
using EarthEngine
Initialize()
ee_extra = pyimport("ee_extra")
landsat_module = "users/sofiaermida/landsat_smw_lst:modules/Landsat_LST.js"
ee_extra.install(landsat_module)
lsmodule = ee_extra.require(landsat_module)
geom = Rectangle(-8.91, 40.0, -8.3, 40.4)
LST = lsmodule.collection("L8", "2018-05-15", "2018-05-31", geom, true)
color_map = ["blue", "cyan", "green", "yellow", "red"]
thumburl = getThumbUrl(
LST.first().select("LST"),
Dict(
"min" => 290,
"max" => 320,
"dimensions" => 1024,
"palette" => color_map,
"format" => "png",
)
)
localpath = download(thumburl)
png = FileIO.load(localpath);
plot(png, ticks = nothing, border = :none)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment