Public
Edited
Oct 4, 2023
Importers
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
pgdVersion = ({
MelgarEtAl2015_3D: { A: -4.434, B: 1.047, C: -0.138 },
MelgarEtAl2015_2D: { A: -4.639, B: 1.063, C: -0.137 }
})
Insert cell
Insert cell
/**
Returns hypocentral radius of "detectability" for a given emprirical scaling
relationship model given magnitude and peak ground displacement threshold (meters).
Default 0.01 meters (1 cm).

displacement is in METERS

returned distance is in METERS
*/
function cutoffDistance({ magnitude, displacement = 0.01 }) {
let dict = {};
const pgdCm = displacement * 100;
for (const r in pgdVersion) {
const coeff = pgdVersion[r];
let log10_R =
(Math.log10(pgdCm) - coeff["A"] - coeff["B"] * magnitude) /
(coeff["C"] * magnitude);
const radiusKm = Math.pow(10, log10_R);
dict[r] = radiusKm * 1000; // meters
}
return dict;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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