Commit abab75d7 authored by alain's avatar alain 🐙
Browse files

update settings

parent 50f00521
......@@ -3,9 +3,7 @@ import wise from "./sources/wise"
const colors = [
"#54c627",
"#54c627",
"#e12023",
"#e12023"
]
export const initialLayers = ["gamma", "poi"]
......@@ -20,37 +18,34 @@ export const dataGroups = [
label: "gamma radiation",
type: "StationLayer",
sources: [ gammasense ],
tooltip: "...",
tooltip: "<p>Gamma radiation (γ radiation) is an invisible electromagnetic radiation with higher energy than ultraviolet light and x-ray.</p><p>The energy of gamma rays is so large that when they pass through a material, chemical bonds can break and electrons can be detached from atoms (ionisation). This can be both useful and dangerous.</p>",
more: "https://gammasense.org/about/",
units: [
{
id: "cpm",
label: " CPM",
range: [0, 500],
scale: "log",
range: [1, 10000],
ticks: [1, 10, 100, 1000, 10000],
legend: {
0: { label: "Good", color: colors[0] },
100: { label: "Bad", color: colors[1] },
500: { label: "Very bad", color: colors[2] },
1: { label: "Good", color: colors[0] },
10: { label: "Good", color: colors[0] },
//100: { label: "Bad", color: colors[1] },
10000: { label: "Very bad", color: colors[1] },
}
},
{
id: "µSv",
label: " µSv/h",
conversion: function(d){ return d * 0.9 },
range: [0, 250],
legend: {
0: { label: "Good", color: colors[0] },
50: { label: "Bad", color: colors[1] },
250: { label: "Very bad", color: colors[2] },
}
}
],
unit: " CPM",
range: [0, 500],
legend: {
0: { label: "Good", color: colors[0] },
100: { label: "Bad", color: colors[1] },
500: { label: "Very bad", color: colors[2] },
}
// {
// id: "µSv",
// label: " µSv/h",
// conversion: function(d){ return d * 0.9 },
// range: [0, 250],
// legend: {
// 0: { label: "Good", color: colors[0] },
// 50: { label: "Bad", color: colors[1] },
// 250: { label: "Very bad", color: colors[2] },
// }
// }
]
},
"poi": {
......@@ -58,9 +53,9 @@ export const dataGroups = [
label: "poi's",
type: "IconLayer",
sources: [ wise ],
tooltip: "",
tooltip: "<p>Nuclear power stations, Nuclear research facilities and Uranium mines. Data from Wise, see the <a href='https://www.wiseinternational.org/map' target='_blank' rel='noopener noreferrer'>Nuclear World Map</a></p>",
iconKeys: ["type", "status"],
iconAtlas: 'images/gammasense-icons.png',
iconAtlas: '/images/gammasense-icons.png',
iconMapping: {
"Uranium mine - Operational": { x: 0, y: 0, width: 56, height: 90, anchorY: 90, mask: false },
"Nuclear research facility - Operational": { x: 56, y: 0, width: 56, height: 90, anchorY: 90, mask: false },
......
......@@ -27,10 +27,10 @@ export const mapControlSettings = {
}
export const mapItemSettings = {
sizeMin: 24,
sizeMax: 2048,
elevationMaxMin: 240,
elevationMaxMax: 20480,
sizeMin: 25,
sizeMax: 1250,
elevationMaxMin: 250,
elevationMaxMax: 12500,
}
export const lightSettings = {
......
import { roundBy } from "../../data-on-a-map-app/src/util/math"
import { addMissingHours } from "../../data-on-a-map-app/src/util/data"
......@@ -22,25 +23,36 @@ export default {
const data = all.map(sensor => {
let sensorData = latest.find(o => o.id === sensor.id)
const returnSensorData = {
const sensorDataReturn = {
id: sensor.id,
name: sensor.id,
source: "gammasense",
coordinates: sensor.coordinates,
coordinates: sensor.coordinates.reverse(),
mean: null
}
if(sensorData) {
returnSensorData.mean = sensorData.cpm_mean
const dataAge = (new Date() - new Date(sensorData.timestamp))
//console.log(sensor.id, sensorData.timestamp, `${roundBy(dataAge / 1000 / 60 / 60, 2)} uur`)
// 3 hours
if(dataAge < 10800000) {
sensorDataReturn.mean = sensorData.cpm_mean
} else {
sensorDataReturn.name = sensorDataReturn.name + " (geen recente data)"
}
} else {
offlineSensors.push(sensor.id)
returnSensorData.name = returnSensorData.name + " (offline)"
sensorDataReturn.name = sensorDataReturn.name + " (offline)"
}
return returnSensorData
return sensorDataReturn
})
latest.forEach(sensor => {
const dataAge = (new Date() - new Date(sensor.timestamp))
//console.log(sensor.id, dataAge, `${roundBy(dataAge / 1000 / 60 / 60, 2)} uur`)
if(!all.find(o => o.id === sensor.id)) {
unregisteredSensors.push(sensor.id)
}
......
data-on-a-map-app @ 6828d011
Subproject commit 627b2212ebd798b179397097370b20714d0b3458
Subproject commit 6828d0118a11d1fd085074aa3cb20d2cdba88874
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment