Public
Edited
Nov 22, 2022
Importers
1 star
Insert cell
Insert cell
typhoons
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
viewof storm = Inputs.range([0, typhoons.length-1], {label: "Storm", step: 1,value:1094})
Insert cell
viewof table = Inputs.table(typhoons[storm].stormData)
Insert cell
table
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
typhoons = {
let e = []
let i = -1 // typhoon index
let date,dt
function parseDate (dateSlice){
console.log(dateSlice);
if(parseInt(dateSlice)>22){
console.log(1900+parseInt(dateSlice));
return dateSlice
}else{
console.log(2000+parseInt(dateSlice));
return 2000+parseInt(dateSlice)
}
}
entries.map(data => {
if (data.slice(0,5) =='66666') { // new typhoon entry Indicator
date = data.slice(64,64+8) // Date of the latest revision (year month day)
dt = Date.UTC(date.slice(0,4),date.slice(4,6),date.slice(6,8))
e.push({
IntID:data.slice(6,6+4), // <International number ID>
datapoints:+data.slice(12,12+3), // <Number of data lines>
cycloneNumber:data.slice(17,17+4), // <Tropical cyclone number ID>
IntID2:data.slice(21,21+4), // <International number ID>
LDL:data.slice(26,26+1), // Flag of the last data line 0:Dissipation 1:Going out of the responsible area of RSMC Tokyo-Typhoon Center
name:data.slice(30,30+20), // Name of the storm
lastRevision: new Date(dt), // Date of the latest revision (year month day) (not of typhoon)
stormData:[]
})
i++
} else
{ // typhoon data

date = data.slice(0,8)
dt = Date.UTC(parseDate(date.slice(0,2)) ,date.slice(2,4),date.slice(4,6),date.slice(6,8))
e[i].stormData.push({
time: new Date(dt), // <Time of analysis> yymmddhh (UTC)
indicator: data.slice(9,9+3), // <Indicator> '002'
grade: data.slice(13,13+1), // <Grade>
lat: data.slice(15,15+3), // <Latitude of the center> Unit : 0.1 degree 235 = 23.5
long: data.slice(19,19+4), // <Longitude of the center> Unit : 0.1 degree 1330 = 133.0
hPa: data.slice(24,24+4), // <Central pressure> Unit : hPa
windSpeed: data.slice(33,33+3), // <Maximum sustained wind speed> Unit : knot (kt)
dlr50: data.slice(41,41+1), // <Direction of the longest radius of 50kt winds or greater>
lr50: data.slice(42,42+4), // <The longest radius of 50kt winds or greater> Unit : nautical mile (nm)
sr50: data.slice(47,47+4), // <The shortest radius of 50kt winds or greater> Unit : nautical mile (nm)
dlr30: data.slice(52,52+1), // <Direction of the longest radius of 30kt winds or greater>
lr30: data.slice(53,53+4), // <The longest radius of 30kt winds or greater> Unit : nautical mile (nm)
sr30: data.slice(58,58+4), // <The shortest radius of 30kt winds or greater> Unit : nautical mile (nm)
landfall: data.slice(71,71+1) // <Indicator of landfall or passage>
})
}
})
return e
}
Insert cell
// Zip file from https://www.jma.go.jp/jma/jma-eng/jma-center/rsmc-hp-pub-eg/besttrack.html
bst_all = FileAttachment("bst_all.zip").zip()
Insert cell
// the text file with all the data
ds = bst_all.file('bst_all.txt').text()
Insert cell
// Split into lines and remove last entery as it's blank.
entries = ds.split('\r\n').slice(0,-1)

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