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
Insert cell
Insert cell
img = await je.getImage({
collection,
date: new Date(Date.UTC(2022,7-1)), //yyyy,m-1
bbox: [-180,-90,180,90],
width: 1000,
height: 500,
colorMap: {
min: 0,
max: 30,
colors: "smc",
},
});
Insert cell
Insert cell
img.getCanvas();
Insert cell
img.getLegend(300,20,10);
Insert cell
img.getDate();
Insert cell
img.getFormattedDate();
Insert cell
Insert cell
Insert cell
data = img.getData();
Insert cell
//ignore NaN (no data area such as sea) and store to array named "plotData" as an object
//NaN(非数値。海などでデータが無い部分など)を無視し、プロット用のオブジェクト配列としてplotDataに格納
plotData = {
//Float32Array
const validData = data.data.filter(e => !isNaN(e));
const plotData = [];
for(let i=0;i<validData.length;i++){
plotData.push({"smc": validData[i]});
}
return plotData;
}
Insert cell
Insert cell
Plot.plot({
x: {
grid: true
},
y: {
grid: true
},
color: {
legend: true
},
grid: true,
marks: [
Plot.rectY(plotData, Plot.binX({y: "count"}, {x: "smc"})),
Plot.ruleY([0])
]
})
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