Public
Edited
Feb 10
2 forks
Insert cell
Insert cell
//APIモジュールを読み込み
je = require("https://data.earth.jaxa.jp/api/javascript/v1.2.3/jaxa.earth.umd.js");
Insert cell
Insert cell
Insert cell
//時期
date = new Date(Date.UTC(2023,3-1,1)); //y, m-1 ,d
Insert cell
//緯度経度範囲
bbox = {
//関東中部地方
const lng = 138;
const lat = 36;
const dl = 3.5;

//九州地方
// const lng = 130;
// const lat = 32;
// const dl = 2.2;
return [lng - dl,lat - dl,lng + dl,lat + dl]; //[west, south, east, north]
}
Insert cell
Insert cell
Insert cell
image1 = await je.getImage({
//MODISの地表面温度のデータ
//https://data.earth.jaxa.jp/ja/datasets/#/id/NASA.EOSDIS_Terra.MODIS_MOD11C1-LST.daytime.v061_global_half-monthly
collection: "https://s3.ap-northeast-1.wasabisys.com/je-pds/cog/v1/NASA.EOSDIS_Terra.MODIS_MOD11C1-LST.daytime.v061_global_half-monthly/collection.json",
band: "LST",
width: 300,
height: 300,
bbox,
date,
colorMap: {
min: 273.15 - 5,
max: 273.15 + 35,
colors: "jet",
},
});
Insert cell
image1.getFormattedDate();
Insert cell
image1.getCanvas();
Insert cell
image1.getLegend(300,20,10);
Insert cell
Insert cell
je.data.globalStat(image1.getData()).mean - 273.15
Insert cell
Insert cell
Insert cell
image2 = await je.getImage({
//平年値
//https://data.earth.jaxa.jp/ja/datasets/#/id/NASA.EOSDIS_Terra.MODIS_MOD11C1-LST.daytime.v061_global_half-monthly-normal
collection: "https://s3.ap-northeast-1.wasabisys.com/je-pds/cog/v1/NASA.EOSDIS_Terra.MODIS_MOD11C1-LST.daytime.v061_global_half-monthly-normal/collection.json",
band: "LST_2012_2021",
width: 300,
height: 300,
bbox,
date: image1.getDate(),
colorMap: {
min: 273.15 - 5,
max: 273.15 + 35,
colors: "jet",
},
});
Insert cell
image2.getFormattedDate();
Insert cell
image2.getCanvas();
Insert cell
image2.getLegend(300,20,10);
Insert cell
Insert cell
je.data.globalStat(image2.getData()).mean - 273.15
Insert cell
Insert cell
Insert cell
image3 = new je.CompositeImage({
images: [image1, image2],
operation: (value_of_image1, value_of_image2) => value_of_image1 - value_of_image2,

//-16~16℃を青~白~赤に塗るカラーバーを設定
colorMap: {
min: -16,
max: 16,
colors: ["#0000ff","#ffffff","#ff0000"],
},
unit: "degC",
});
Insert cell
image3.getCanvas()
Insert cell
image3.getLegend(300,20,10);
Insert cell
Insert cell
je.data.globalStat(image3.getData()).mean
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more