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

Commit

Permalink
Merge pull request #75 from Fonger/fix/site-effect
Browse files Browse the repository at this point in the history
fix: eew intensity site effect
  • Loading branch information
whes1015 authored May 9, 2024
2 parents d112f60 + 009c666 commit 28a43b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
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

0 comments on commit 28a43b1

Please sign in to comment.