Public
Edited
Feb 3
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
je = require("https://data.earth.jaxa.jp/api/javascript/v1.2.3/jaxa.earth.umd.js");
Insert cell
Insert cell
//Central part of honshu, Japan 日本の中部地方
center = ({lat: 35.71, lng: 138.19})

//Hokkaido, Japan 日本の北海道
//center = ({lat: 43.50, lng: 143.00})

//Rocky Mountains, USA アメリカのロッキー山脈
//center = ({lat: 44.3, lng: -110.0})

//The Alps, Europe ヨーロッパのアルプス山脈
//center = ({lat: 47.0, lng: 8.0})

//Mt. Kilimanjaro, Africa アフリカのキリマンジャロ山
//center = ({lat: -3.0, lng: 37.35})
Insert cell
Insert cell
Insert cell
Insert cell
elevationImage = await je.getImage({
collection: "https://s3.ap-northeast-1.wasabisys.com/je-pds/cog/v1/JAXA.EORC_ALOS.PRISM_AW3D30.v3.2_global/collection.json",
band: "DSM",
width: size, //pixels
height: size, //pixels
bbox: [center.lng - margin,center.lat - margin,center.lng + margin,center.lat + margin], //[west, south, east, north]
});
Insert cell
elevationData = elevationImage.getData();
Insert cell
elevationColorMap = new je.image.ColorMap(elevationData.min, elevationData.max, "jet");
Insert cell
je.image.createImage(elevationData, elevationColorMap).getCanvas();
Insert cell
Insert cell
lstImage = await je.getImage({
collection: "https://s3.ap-northeast-1.wasabisys.com/je-pds/cog/v1/JAXA.G-Portal_GCOM-C.SGLI_standard.L3-LST.daytime.v3_global_monthly/collection.json",
date: new Date(Date.UTC(2021, 12-1)),
band: "LST",
width: size, //pixels
height: size, //pixels
bbox: [center.lng - margin,center.lat - margin,center.lng + margin,center.lat + margin], //[west, south, east, north]
});
Insert cell
lstData = lstImage.getData();
Insert cell
lstColorMap = new je.image.ColorMap(lstData.min, lstData.max, "jet");
Insert cell
je.image.createImage(lstData, lstColorMap).getCanvas();
Insert cell
Insert cell
array = {
const array = [];
for(let k=0;k<size * size;k++){
//ignore NaN (such as sea, no data) and elevation 0[m] (sea)
//NaN(非数値。外洋やデータが観測されていない部分など)や標高0m(海など)を無視
if(isNaN(elevationData.data[k])) continue;
if(elevationData.data[k] < 1) continue;
if(isNaN(lstData.data[k])) continue;
array.push({
elevation: elevationData.data[k],
lst: lstData.data[k] - 273.15 //change unit from [K] to [deg C] 単位を[ケルビン]から[℃]に変換
});
}
return array;
}
Insert cell
Insert cell
Plot.plot({
x: {
grid: true,
domain: [0, elevationData.max],
},
y: {
grid: true,
},
marks: [
Plot.dot(array, {x: "elevation", y: "lst", strokeOpacity: 0.1, r: 2}),
Plot.linearRegressionY(array, {x: "elevation", y: "lst", stroke: "red", strokeWidth: 5})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more