Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

fix: eew intensity site effect #75

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ import PostalCode from "./assets/json/code.json";
import {
calculateEpicenterDistance,
calculateExpectedIntensity,
calculateIntensity,
calculateLocalExpectedWaveTime,
calculateWaveRadius,
roundIntensity,
} from "./scripts/helper/utils";
import { getAudio } from "./scripts/helper/audio";
import JSZip from "jszip";
Expand Down Expand Up @@ -253,16 +251,10 @@ api.on(WebSocketEvent.Eew, (e) => {
lat: e.eq.lat,
lng: e.eq.lon,
})({ lng: area.lng, lat: area.lat })(e.eq.depth);
const localExpectedIntensity = calculateIntensity(
surfaceDistance,
distance,
e.eq.mag,
e.eq.depth
);

data.surface = surfaceDistance;
data.distance = distance;
data.i = roundIntensity(localExpectedIntensity);
data.i = intensity[config.cache.location.area];

let { p, s } = calculateLocalExpectedWaveTime(
data.distance,
Expand Down
3 changes: 2 additions & 1 deletion src/scripts/helper/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ export const calculateExpectedIntensity = (
surfaceDistance,
distance,
magnitude,
depth
depth,
town.site
);

if (int > maxIntensity) {
Expand Down
Loading