Platform
Resources
Pricing
Sign in
Get started
JAXA Earth API
"JAXA Earth API for JavaScript" examples on the Observable by the JAXA Earth Observation Research Center
Workspace
Fork
Public
Anomaly
By
JAXA Earth API
Edited
Feb 10
Fork of
El Nino / La Nina Observation
Insert cell
Insert cell
//Load the API module
je
=
require
(
"https://data.earth.jaxa.jp/api/javascript/v1.2.3/jaxa.earth.umd.js"
)
;
Insert cell
Insert cell
Insert cell
//Date for observation
//The newest data will be get.
date
=
new
Date
(
)
;
//Specified date
// date = new Date(Date.UTC(2023,3-1,1)); //year, month-1 ,day
Insert cell
//Bounding box of the area for observation
bbox
=
{
const
lng
=
140
;
const
lat
=
35
;
const
dl
=
20
;
return
[
lng
-
dl
,
lat
-
dl
,
lng
+
dl
,
lat
+
dl
]
;
//west, south, east, north
}
Insert cell
width
=
300
;
Insert cell
height
=
300
;
Insert cell
Insert cell
Insert cell
image1
=
await
je
.
getImage
(
{
collection
:
"https://s3.ap-northeast-1.wasabisys.com/je-pds2/cog/v1/JAXA.G-Portal_GCOM-W.AMSR2_standard.L3-SST.nighttime.v4_global_daily/collection.json"
,
band
:
"SST"
,
bbox
,
date
,
width
,
height
,
colorMap
:
{
min
:
10
,
max
:
35
,
colors
:
"jet"
,
}
,
}
)
;
Insert cell
image1
.
getFormattedDate
(
)
;
Insert cell
image1
.
getCanvas
(
)
;
Insert cell
image1
.
getLegend
(
300
,
20
,
10
)
;
//width, height, text size
Insert cell
//Mean 平均値
je
.
data
.
globalStat
(
image1
.
getData
(
)
)
.
mean
Insert cell
Insert cell
Insert cell
image2
=
await
je
.
getImage
(
{
collection
:
"https://s3.ap-northeast-1.wasabisys.com/je-pds2/cog/v1/JMA_COBE-SST-interpolation_SST.v2_global_daily-normal/collection.json"
,
band
:
"SST"
,
bbox
,
date
:
image1
.
getDate
(
)
,
width
,
height
,
colorMap
:
{
min
:
10
,
max
:
35
,
colors
:
"jet"
,
}
,
}
)
;
Insert cell
image2
.
getFormattedDate
(
)
;
Insert cell
image2
.
getCanvas
(
)
;
Insert cell
image2
.
getLegend
(
300
,
20
,
10
)
;
Insert cell
//Mean 平均値
je
.
data
.
globalStat
(
image2
.
getData
(
)
)
.
mean
Insert cell
Insert cell
Insert cell
image3
=
new
je
.
CompositeImage
(
{
//Input images to composite
images
:
[
image1
,
image2
]
,
//All pixels will be calculated by the operation function
operation
:
(
value_of_image1
,
value_of_image2
)
=>
value_of_image1
-
value_of_image2
,
colorMap
:
{
min
:
-
6
,
max
:
6
,
colors
:
"jet"
,
}
,
//Unit of the calculated value
unit
:
"degC"
,
}
)
;
Insert cell
image3
.
getCanvas
(
)
Insert cell
image3
.
getLegend
(
300
,
20
,
10
)
;
Insert cell
//Mean 平均値
je
.
data
.
globalStat
(
image3
.
getData
(
)
)
.
mean
Insert cell
Insert cell
Insert cell
plotData
=
{
//Float32Array
const
validData
=
image3
.
getData
(
)
.
data
.
filter
(
e
=>
!
isNaN
(
e
)
)
;
const
plotData
=
[
]
;
for
(
let
i
=
0
;
i
<
validData
.
length
;
i
++
)
{
plotData
.
push
(
{
"SST"
:
validData
[
i
]
}
)
;
}
return
plotData
;
}
Insert cell
Plot
.
plot
(
{
x
:
{
grid
:
true
,
}
,
y
:
{
grid
:
true
}
,
color
:
{
legend
:
true
}
,
grid
:
true
,
marks
:
[
Plot
.
rectY
(
plotData
,
Plot
.
binX
(
{
y
:
"count"
}
,
{
x
:
"SST"
}
)
)
,
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.
Try it for free
Learn more
Compare fork
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
je
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
date
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
bbox
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
width
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
height
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
image1
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
image2
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
image3
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
plotData
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML