@aguacerowx/javascript-sdk 0.0.28 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AguaceroCore.js +794 -207
- package/dist/default-colormaps.js +556 -437
- package/dist/dictionaries.js +2069 -2411
- package/dist/events.js +2 -2
- package/dist/getBundleId.js +9 -20
- package/dist/getBundleId.native.js +18 -0
- package/dist/gridDecodePipeline.js +37 -0
- package/dist/gridDecodeWorker.js +31 -0
- package/dist/index.js +172 -1
- package/dist/nexradTiltCoalesce.js +95 -0
- package/dist/nexradTilts.js +129 -0
- package/dist/nexrad_level3_catalog.js +56 -0
- package/dist/nexrad_support.js +269 -0
- package/dist/satellite_support.js +395 -0
- package/dist/unitConversions.js +10 -10
- package/package.json +99 -99
- package/src/coordinate_configs.js +374 -374
- package/src/default-colormaps.js +3369 -3369
- package/src/dictionaries.js +3857 -3857
- package/src/events.js +31 -31
- package/src/fill-layer-worker.js +26 -26
- package/src/getBundleId.js +8 -8
- package/src/getBundleId.native.js +14 -14
- package/src/gridDecodePipeline.js +32 -32
- package/src/gridDecodeWorker.js +24 -24
- package/src/index.js +48 -48
- package/src/map-styles.js +101 -101
- package/src/nexradTiltCoalesce.js +95 -95
- package/src/nexradTilts.js +138 -128
- package/src/nexrad_level3_catalog.js +26 -26
- package/src/nexrad_support.js +40 -6
- package/src/nws/nwsAlertsFetchSpec.js +93 -93
- package/src/nws/nwsEventColorsDefaults.js +133 -133
- package/src/nws/nwsSdkConstants.js +368 -368
- package/src/satellite_support.js +376 -376
- package/src/spawnGridDecodeWorker.js +5 -5
- package/src/unitConversions.js +102 -102
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NEXRAD_SWEEP_LAMBDA_URL = exports.NEXRAD_LEVEL3_BASE_URL = void 0;
|
|
7
|
+
exports.fetchLevel3ProductTimesForStation = fetchLevel3ProductTimesForStation;
|
|
8
|
+
exports.fetchNexradTimesListing = fetchNexradTimesListing;
|
|
9
|
+
exports.getAvailableNexradTilts = getAvailableNexradTilts;
|
|
10
|
+
exports.getRawNexradTiltsForCoalesce = getRawNexradTiltsForCoalesce;
|
|
11
|
+
exports.inferNexradDataSourceForProduct = inferNexradDataSourceForProduct;
|
|
12
|
+
exports.nexradBinGroupIdForKey = nexradBinGroupIdForKey;
|
|
13
|
+
exports.nexradColormapFldKey = nexradColormapFldKey;
|
|
14
|
+
exports.variableToNexradGroup = variableToNexradGroup;
|
|
15
|
+
var _nexradTilts = require("./nexradTilts.js");
|
|
16
|
+
var _nexradTiltCoalesce = require("./nexradTiltCoalesce.js");
|
|
17
|
+
var _nexrad_level3_catalog = require("./nexrad_level3_catalog.js");
|
|
18
|
+
/**
|
|
19
|
+
* NEXRAD Level-II / Level-III time listings (aligned with aguacero-frontend nexradTimes.ts).
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Whether listings and archive fetches for this product use Level-II sweep lambda vs Level-III S3 products.
|
|
24
|
+
* AguaceroCore derives this from the product key only (not user-configurable).
|
|
25
|
+
* @param {string} [nexradProduct] - Radar variable key (e.g. REF, KDP, VEL).
|
|
26
|
+
* @returns {'level2'|'level3'}
|
|
27
|
+
*/
|
|
28
|
+
function inferNexradDataSourceForProduct(nexradProduct) {
|
|
29
|
+
const p = (nexradProduct || 'REF').toUpperCase();
|
|
30
|
+
return (0, _nexrad_level3_catalog.getNexradLevel3EntryByRadarKey)(p) ? 'level3' : 'level2';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Colormap / DICTIONARIES.fld key for customColormaps (matches frontend userDefaultColormap). */
|
|
34
|
+
function nexradColormapFldKey(nexradDataSource, nexradProduct) {
|
|
35
|
+
const p = (nexradProduct || 'REF').toUpperCase();
|
|
36
|
+
if (nexradDataSource === 'level3') {
|
|
37
|
+
const entry = (0, _nexrad_level3_catalog.getNexradLevel3EntryByRadarKey)(p);
|
|
38
|
+
return (entry === null || entry === void 0 ? void 0 : entry.fldKey) ?? `nexrad_l3_${p.toLowerCase()}`;
|
|
39
|
+
}
|
|
40
|
+
const map = {
|
|
41
|
+
REF: 'nexrad_ref',
|
|
42
|
+
PHI: 'nexrad_phi',
|
|
43
|
+
ZDR: 'nexrad_zdr',
|
|
44
|
+
RHO: 'nexrad_rho',
|
|
45
|
+
KDP: 'nexrad_kdp',
|
|
46
|
+
VEL: 'nexrad_vel',
|
|
47
|
+
SW: 'nexrad_sw'
|
|
48
|
+
};
|
|
49
|
+
return map[p] ?? `nexrad_${p.toLowerCase()}`;
|
|
50
|
+
}
|
|
51
|
+
const NEXRAD_SWEEP_LAMBDA_URL = exports.NEXRAD_SWEEP_LAMBDA_URL = 'https://ddknicwcw2wyov7v5bzxmbqu440tzntf.lambda-url.us-east-2.on.aws/';
|
|
52
|
+
const NEXRAD_LEVEL3_BASE_URL = exports.NEXRAD_LEVEL3_BASE_URL = 'https://unidata-nexrad-level3.s3.amazonaws.com';
|
|
53
|
+
const NEXRAD_GROUP_G1 = ['REF', 'PHI', 'ZDR', 'RHO'];
|
|
54
|
+
const NEXRAD_GROUP_G2 = ['VEL', 'SW'];
|
|
55
|
+
function variableToNexradGroup(variable) {
|
|
56
|
+
const v = (variable || 'REF').toUpperCase();
|
|
57
|
+
if (NEXRAD_GROUP_G2.includes(v)) return 'g2';
|
|
58
|
+
return 'g1';
|
|
59
|
+
}
|
|
60
|
+
function nexradBinGroupIdForKey(cacheGroup) {
|
|
61
|
+
return cacheGroup === 'g1' ? 1 : 2;
|
|
62
|
+
}
|
|
63
|
+
function getLevel3StationPrefix(stationId) {
|
|
64
|
+
const upper = (stationId || '').toUpperCase();
|
|
65
|
+
if (upper.startsWith('K') && upper.length === 4) return upper.slice(1);
|
|
66
|
+
return upper.slice(-3);
|
|
67
|
+
}
|
|
68
|
+
function parseS3KeyTimeToUnix(key) {
|
|
69
|
+
const m = key.match(/_(\d{4})_(\d{2})_(\d{2})_(\d{2})_(\d{2})_(\d{2})$/);
|
|
70
|
+
if (!m) return null;
|
|
71
|
+
const [, y, mo, d, h, mi, s] = m;
|
|
72
|
+
const unix = Date.UTC(Number(y), Number(mo) - 1, Number(d), Number(h), Number(mi), Number(s)) / 1000;
|
|
73
|
+
return Number.isFinite(unix) ? unix : null;
|
|
74
|
+
}
|
|
75
|
+
async function fetchLevel3ProductTimesForStation(stationId, productCode, listWindowHours) {
|
|
76
|
+
const stationPrefix = getLevel3StationPrefix(stationId);
|
|
77
|
+
const nowMs = Date.now();
|
|
78
|
+
const nowSec = Math.floor(nowMs / 1000);
|
|
79
|
+
const hourSec = 3600;
|
|
80
|
+
const windowSec = Math.max(hourSec, Math.ceil(listWindowHours) * hourSec);
|
|
81
|
+
const dayPrefixForOffset = dayOff => {
|
|
82
|
+
const dt = new Date(nowMs - dayOff * 86400000);
|
|
83
|
+
const y = dt.getUTCFullYear();
|
|
84
|
+
const mo = String(dt.getUTCMonth() + 1).padStart(2, '0');
|
|
85
|
+
const day = String(dt.getUTCDate()).padStart(2, '0');
|
|
86
|
+
return `${stationPrefix}_${productCode}_${y}_${mo}_${day}_`;
|
|
87
|
+
};
|
|
88
|
+
const dayPrefixes = [dayPrefixForOffset(0), dayPrefixForOffset(1)];
|
|
89
|
+
const byUnix = new Map();
|
|
90
|
+
const listKeysForPrefix = async prefix => {
|
|
91
|
+
let continuationToken = null;
|
|
92
|
+
for (let page = 0; page < 8; page++) {
|
|
93
|
+
const params = new URLSearchParams({
|
|
94
|
+
'list-type': '2',
|
|
95
|
+
prefix,
|
|
96
|
+
'max-keys': '1000'
|
|
97
|
+
});
|
|
98
|
+
if (continuationToken) params.set('continuation-token', continuationToken);
|
|
99
|
+
const res = await fetch(`${NEXRAD_LEVEL3_BASE_URL}/?${params.toString()}`);
|
|
100
|
+
if (!res.ok) throw new Error(`Level3 list HTTP ${res.status}`);
|
|
101
|
+
const xml = await res.text();
|
|
102
|
+
const keyMatches = [...xml.matchAll(/<Key>([^<]+)<\/Key>/g)];
|
|
103
|
+
keyMatches.forEach(match => {
|
|
104
|
+
const objectKey = match[1];
|
|
105
|
+
const unix = parseS3KeyTimeToUnix(objectKey);
|
|
106
|
+
if (unix == null) return;
|
|
107
|
+
byUnix.set(unix, objectKey);
|
|
108
|
+
});
|
|
109
|
+
const tokenMatch = xml.match(/<NextContinuationToken>([^<]+)<\/NextContinuationToken>/);
|
|
110
|
+
continuationToken = (tokenMatch === null || tokenMatch === void 0 ? void 0 : tokenMatch[1]) || null;
|
|
111
|
+
if (!continuationToken) break;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
for (const prefix of dayPrefixes) {
|
|
115
|
+
await listKeysForPrefix(prefix);
|
|
116
|
+
}
|
|
117
|
+
const sorted = [...byUnix.keys()].sort((a, b) => a - b);
|
|
118
|
+
const windowStart = nowSec - windowSec;
|
|
119
|
+
let inWindow = sorted.filter(t => t >= windowStart);
|
|
120
|
+
if (inWindow.length === 0 && sorted.length > 0) {
|
|
121
|
+
inWindow = sorted.filter(t => t >= nowSec - Math.max(6 * hourSec, windowSec));
|
|
122
|
+
}
|
|
123
|
+
if (inWindow.length === 0 && sorted.length > 0) {
|
|
124
|
+
inWindow = sorted.slice(-48);
|
|
125
|
+
}
|
|
126
|
+
const timeToKeyMap = {};
|
|
127
|
+
inWindow.forEach(t => {
|
|
128
|
+
const k = byUnix.get(t);
|
|
129
|
+
if (k) timeToKeyMap[String(t)] = k;
|
|
130
|
+
});
|
|
131
|
+
return {
|
|
132
|
+
unixTimes: inWindow,
|
|
133
|
+
timeToKeyMap
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @param {object} opts
|
|
139
|
+
* @param {string} opts.stationId
|
|
140
|
+
* @param {string} [opts.variable]
|
|
141
|
+
* @param {string} [opts.elev]
|
|
142
|
+
* @param {'level2'|'level3'} [opts.source]
|
|
143
|
+
* @param {boolean} [opts.level3StormRelative]
|
|
144
|
+
* @param {number} opts.listingWindowHours
|
|
145
|
+
*/
|
|
146
|
+
async function fetchNexradTimesListing(opts) {
|
|
147
|
+
var _getNexradLevel3Entry;
|
|
148
|
+
const {
|
|
149
|
+
stationId,
|
|
150
|
+
variable = 'REF',
|
|
151
|
+
elev,
|
|
152
|
+
source = 'level2',
|
|
153
|
+
level3StormRelative,
|
|
154
|
+
listingWindowHours
|
|
155
|
+
} = opts;
|
|
156
|
+
if (!stationId) {
|
|
157
|
+
return {
|
|
158
|
+
unixTimes: [],
|
|
159
|
+
timeToKeyMap: {},
|
|
160
|
+
level3MotionUnixTimes: [],
|
|
161
|
+
level3MotionTimeToKeyMap: {}
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
const dataSource = source === 'level3' ? 'level3' : 'level2';
|
|
165
|
+
let tiltNum = Number(elev);
|
|
166
|
+
if (!Number.isFinite(tiltNum)) tiltNum = (0, _nexradTilts.getDefaultRadarTilt)(stationId);
|
|
167
|
+
const elevNormUse = dataSource === 'level3' ? _nexrad_level3_catalog.NEXRAD_LEVEL3_ELEV : (0, _nexradTilts.formatTiltForApi)((0, _nexradTilts.clampNexradTiltForVariable)(stationId, variable, tiltNum));
|
|
168
|
+
const group = dataSource === 'level3' ? 'l3' : variableToNexradGroup(variable);
|
|
169
|
+
const l3Product = dataSource === 'level3' ? opts.level3Product ?? ((_getNexradLevel3Entry = (0, _nexrad_level3_catalog.getNexradLevel3EntryByRadarKey)(variable)) === null || _getNexradLevel3Entry === void 0 ? void 0 : _getNexradLevel3Entry.product) ?? (variable === 'VEL' ? 'N0G' : variable) : '';
|
|
170
|
+
const fetchL3Motion = dataSource === 'level3' && l3Product === 'N0G' && variable === 'VEL' && level3StormRelative === true;
|
|
171
|
+
const fetchL2VelMotion = dataSource === 'level2' && variable === 'VEL' && level3StormRelative === true;
|
|
172
|
+
const key = dataSource === 'level3' ? `${stationId}_l3_${l3Product}_${elevNormUse}` : `${stationId}_${group}_${elevNormUse}`;
|
|
173
|
+
const level3MotionKey = dataSource === 'level3' && fetchL3Motion ? `${stationId}_l3_${_nexrad_level3_catalog.NEXRAD_LEVEL3_MOTION_PRODUCT}_${elevNormUse}` : '';
|
|
174
|
+
const l2StormMotionListKey = dataSource === 'level2' && fetchL2VelMotion ? `${stationId}_l3_${_nexrad_level3_catalog.NEXRAD_LEVEL3_MOTION_PRODUCT}_${_nexrad_level3_catalog.NEXRAD_LEVEL3_ELEV}` : '';
|
|
175
|
+
let times = [];
|
|
176
|
+
let timeToKeyMap = {};
|
|
177
|
+
let l3MotionUnixTimes = [];
|
|
178
|
+
let l3MotionTimeToKeyMap = {};
|
|
179
|
+
if (dataSource === 'level3') {
|
|
180
|
+
const l3Primary = await fetchLevel3ProductTimesForStation(stationId, l3Product, listingWindowHours);
|
|
181
|
+
times = l3Primary.unixTimes;
|
|
182
|
+
timeToKeyMap = l3Primary.timeToKeyMap;
|
|
183
|
+
if (fetchL3Motion) {
|
|
184
|
+
const l3Motion = await fetchLevel3ProductTimesForStation(stationId, _nexrad_level3_catalog.NEXRAD_LEVEL3_MOTION_PRODUCT, listingWindowHours);
|
|
185
|
+
l3MotionUnixTimes = l3Motion.unixTimes;
|
|
186
|
+
l3MotionTimeToKeyMap = l3Motion.timeToKeyMap;
|
|
187
|
+
}
|
|
188
|
+
} else {
|
|
189
|
+
const params = new URLSearchParams({
|
|
190
|
+
station: stationId,
|
|
191
|
+
field: group,
|
|
192
|
+
elev: elevNormUse,
|
|
193
|
+
hours: String(listingWindowHours)
|
|
194
|
+
});
|
|
195
|
+
const url = `${NEXRAD_SWEEP_LAMBDA_URL}?${params.toString()}`;
|
|
196
|
+
const res = await fetch(url);
|
|
197
|
+
if (!res.ok) throw new Error(`NEXRAD lambda HTTP ${res.status}`);
|
|
198
|
+
const data = await res.json();
|
|
199
|
+
if (Array.isArray(data === null || data === void 0 ? void 0 : data.times)) {
|
|
200
|
+
times = data.times;
|
|
201
|
+
} else if (data !== null && data !== void 0 && data.body) {
|
|
202
|
+
const body = typeof data.body === 'string' ? JSON.parse(data.body) : data.body;
|
|
203
|
+
times = Array.isArray(body === null || body === void 0 ? void 0 : body.times) ? body.times : [];
|
|
204
|
+
}
|
|
205
|
+
const groupId = nexradBinGroupIdForKey(group);
|
|
206
|
+
const elevNorm = elevNormUse;
|
|
207
|
+
times.forEach(t => {
|
|
208
|
+
timeToKeyMap[String(t)] = `${stationId}_${elevNorm}_${t}_g${groupId}.bin`;
|
|
209
|
+
});
|
|
210
|
+
if (fetchL2VelMotion) {
|
|
211
|
+
const l3Motion = await fetchLevel3ProductTimesForStation(stationId, _nexrad_level3_catalog.NEXRAD_LEVEL3_MOTION_PRODUCT, listingWindowHours);
|
|
212
|
+
l3MotionUnixTimes = l3Motion.unixTimes;
|
|
213
|
+
l3MotionTimeToKeyMap = l3Motion.timeToKeyMap;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const out = {
|
|
217
|
+
cacheKey: key,
|
|
218
|
+
unixTimes: times,
|
|
219
|
+
timeToKeyMap,
|
|
220
|
+
level3MotionKey: level3MotionKey || null,
|
|
221
|
+
level3MotionUnixTimes: l3MotionUnixTimes,
|
|
222
|
+
level3MotionTimeToKeyMap: l3MotionTimeToKeyMap,
|
|
223
|
+
l2StormMotionListKey: l2StormMotionListKey || null
|
|
224
|
+
};
|
|
225
|
+
return out;
|
|
226
|
+
}
|
|
227
|
+
const L3_TILT_INDEX_MANIFEST_SLOTS = 6;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Raw manifest tilt list before coalescing (same rules as aguacero-frontend `radarTiltOptionsRaw`).
|
|
231
|
+
* Use {@link coalesceNexradTiltOptionsForDisplay} or {@link getAvailableNexradTilts} for UI controls.
|
|
232
|
+
*
|
|
233
|
+
* @param {string} siteId
|
|
234
|
+
* @param {'level2'|'level3'} nexradDataSource
|
|
235
|
+
* @param {string} [nexradProduct]
|
|
236
|
+
* @returns {number[]}
|
|
237
|
+
*/
|
|
238
|
+
function getRawNexradTiltsForCoalesce(siteId, nexradDataSource, nexradProduct) {
|
|
239
|
+
if (!siteId) return [];
|
|
240
|
+
const v = (nexradProduct || 'REF').toUpperCase();
|
|
241
|
+
const ds = nexradDataSource === 'level3' ? 'level3' : 'level2';
|
|
242
|
+
const tilts = (0, _nexradTilts.getRadarTilts)(siteId, v);
|
|
243
|
+
/** L3 super-res VEL (N*G) uses the same first-N manifest slots as KDP/N0H — not the full L2 g2-only list. */
|
|
244
|
+
if (v === 'VEL') {
|
|
245
|
+
return tilts.slice(0, L3_TILT_INDEX_MANIFEST_SLOTS);
|
|
246
|
+
}
|
|
247
|
+
if (ds === 'level2') {
|
|
248
|
+
return [...tilts];
|
|
249
|
+
}
|
|
250
|
+
if (v === 'KDP' || v === 'N0H') {
|
|
251
|
+
return tilts.slice(0, L3_TILT_INDEX_MANIFEST_SLOTS);
|
|
252
|
+
}
|
|
253
|
+
return [];
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Tilt angles for the UI: manifest tilts with adjacent 0.1° steps merged like aguacero-frontend
|
|
258
|
+
* ({@link coalesceNexradTiltOptionsForDisplay}).
|
|
259
|
+
*
|
|
260
|
+
* @param {string} siteId
|
|
261
|
+
* @param {'level2'|'level3'} nexradDataSource
|
|
262
|
+
* @param {string} [nexradProduct]
|
|
263
|
+
* @returns {number[]}
|
|
264
|
+
*/
|
|
265
|
+
function getAvailableNexradTilts(siteId, nexradDataSource, nexradProduct) {
|
|
266
|
+
const raw = getRawNexradTiltsForCoalesce(siteId, nexradDataSource, nexradProduct);
|
|
267
|
+
if (!raw.length) return [];
|
|
268
|
+
return (0, _nexradTiltCoalesce.coalesceNexradTiltOptionsForDisplay)(raw);
|
|
269
|
+
}
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TIMELINE_DURATION_MAX_HOURS = exports.TIMELINE_DURATION_HOUR_VALUES = exports.SECTOR_CODE_MAP = exports.SATELLITE_FRAMES_URL = exports.SATELLITE_DURATION_CONFIG = exports.GOES_SATELLITE_CHANNEL_LABELS = exports.GOES_SATELLITE_CHANNELS = exports.GOES_EAST_SATELLITE_SECTORS = void 0;
|
|
7
|
+
exports.buildSatelliteTimelineForSelection = buildSatelliteTimelineForSelection;
|
|
8
|
+
exports.calculateUnixTimeFromSatelliteKey = calculateUnixTimeFromSatelliteKey;
|
|
9
|
+
exports.formatTimelineDurationValue = formatTimelineDurationValue;
|
|
10
|
+
exports.getAllGoesEastSatelliteSelections = getAllGoesEastSatelliteSelections;
|
|
11
|
+
exports.getDefaultSatelliteDurationOption = getDefaultSatelliteDurationOption;
|
|
12
|
+
exports.normalizeTimelineDurationValue = normalizeTimelineDurationValue;
|
|
13
|
+
exports.parseTimelineDurationHours = parseTimelineDurationHours;
|
|
14
|
+
exports.resolveSatelliteDurationOption = resolveSatelliteDurationOption;
|
|
15
|
+
exports.resolveSatelliteS3FileName = resolveSatelliteS3FileName;
|
|
16
|
+
exports.resolveSatelliteSectorLabel = resolveSatelliteSectorLabel;
|
|
17
|
+
/**
|
|
18
|
+
* Satellite listing / timeline helpers aligned with aguacero-frontend (ActiveTimeContext + satelliteAvailability).
|
|
19
|
+
* Used by AguaceroCore for GOES-East WebGL satellite mode.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const SATELLITE_FRAMES_URL = exports.SATELLITE_FRAMES_URL = 'https://rhnq3edhcry5n6nljn6my4o3h40zwxze.lambda-url.us-east-2.on.aws/';
|
|
23
|
+
|
|
24
|
+
/** Same sector labels as production bundle / ActiveTimeContext SECTOR_CODE_MAP (inverse). */
|
|
25
|
+
const GOES_EAST_SATELLITE_SECTORS = exports.GOES_EAST_SATELLITE_SECTORS = ['GOES-EAST CONUS', 'GOES-EAST FULL DISK', 'GOES-EAST MESOSCALE 1', 'GOES-EAST MESOSCALE 2'];
|
|
26
|
+
const SECTOR_SYNONYM_TO_LABEL = {
|
|
27
|
+
conus: 'GOES-EAST CONUS',
|
|
28
|
+
full_disk: 'GOES-EAST FULL DISK',
|
|
29
|
+
fulldisk: 'GOES-EAST FULL DISK',
|
|
30
|
+
mesoscale_1: 'GOES-EAST MESOSCALE 1',
|
|
31
|
+
mesoscale1: 'GOES-EAST MESOSCALE 1',
|
|
32
|
+
m1: 'GOES-EAST MESOSCALE 1',
|
|
33
|
+
mesoscale_2: 'GOES-EAST MESOSCALE 2',
|
|
34
|
+
mesoscale2: 'GOES-EAST MESOSCALE 2',
|
|
35
|
+
m2: 'GOES-EAST MESOSCALE 2'
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Normalizes a sector argument to the listing sector label (middle segment; must match archive paths).
|
|
40
|
+
* Accepts short tokens (<code>conus</code>, <code>full_disk</code>, …), synonyms (<code>m1</code>, <code>fulldisk</code>, …), or full labels (passthrough for West / custom feeds).
|
|
41
|
+
* @param {string} [sector]
|
|
42
|
+
* @returns {string}
|
|
43
|
+
*/
|
|
44
|
+
function resolveSatelliteSectorLabel(sector) {
|
|
45
|
+
if (sector == null || sector === '') return 'GOES-EAST CONUS';
|
|
46
|
+
const raw = String(sector).trim();
|
|
47
|
+
const norm = raw.toLowerCase().replace(/[\s-]+/g, '_');
|
|
48
|
+
if (SECTOR_SYNONYM_TO_LABEL[norm]) return SECTOR_SYNONYM_TO_LABEL[norm];
|
|
49
|
+
if (GOES_EAST_SATELLITE_SECTORS.includes(raw)) return raw;
|
|
50
|
+
return raw;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Flat channel ids matching CHANNEL_CATEGORIES in frontend dictionaries. */
|
|
54
|
+
const GOES_SATELLITE_CHANNELS = exports.GOES_SATELLITE_CHANNELS = [...['true_color', 'geocolor', 'ntmicro', 'day_cloud_phase', 'day_land_cloud_fire', 'air_mass', 'sandwich', 'simple_water_vapor', 'dust', 'fire_temperature'], 'C01', 'C02', 'C03', 'C04', 'C05', 'C06', 'C07', 'C08', 'C09', 'C10', 'C11', 'C12', 'C13', 'C14', 'C15', 'C16'];
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Human-readable labels for {@link GOES_SATELLITE_CHANNELS}, aligned with aguacero-frontend `CHANNEL_LABELS`.
|
|
58
|
+
*/
|
|
59
|
+
const GOES_SATELLITE_CHANNEL_LABELS = exports.GOES_SATELLITE_CHANNEL_LABELS = {
|
|
60
|
+
true_color: 'True Color',
|
|
61
|
+
ntmicro: 'Night Microphysics',
|
|
62
|
+
day_cloud_phase: 'Day Cloud Phase',
|
|
63
|
+
day_land_cloud_fire: 'Natural Color Fire',
|
|
64
|
+
air_mass: 'Air Mass',
|
|
65
|
+
sandwich: 'Sandwich',
|
|
66
|
+
simple_water_vapor: 'Simple Water Vapor',
|
|
67
|
+
dust: 'Dust',
|
|
68
|
+
geocolor: 'Geocolor',
|
|
69
|
+
fire_temperature: 'Fire Temperature',
|
|
70
|
+
C01: 'Blue - Visible',
|
|
71
|
+
C02: 'Red - Visible',
|
|
72
|
+
C03: 'Veggie - Near IR',
|
|
73
|
+
C04: 'Cirrus - Near IR',
|
|
74
|
+
C05: 'Snow/Ice - Near IR',
|
|
75
|
+
C06: 'Cloud Particle - Near IR',
|
|
76
|
+
C07: 'Shortwave Window - IR',
|
|
77
|
+
C08: 'Upper-Level Water Vapor - IR',
|
|
78
|
+
C09: 'Mid-Level Water Vapor - IR',
|
|
79
|
+
C10: 'Lower-Level Water Vapor - IR',
|
|
80
|
+
C11: 'Cloud Top - IR',
|
|
81
|
+
C12: 'Ozone - IR',
|
|
82
|
+
C13: 'Clean Longwave Window - IR',
|
|
83
|
+
C14: 'Longwave Window - IR',
|
|
84
|
+
C15: 'Dirty Longwave Window - IR',
|
|
85
|
+
C16: 'CO2 Longwave - IR'
|
|
86
|
+
};
|
|
87
|
+
const SECTOR_CODE_MAP = exports.SECTOR_CODE_MAP = {
|
|
88
|
+
'GOES-EAST CONUS': 'C',
|
|
89
|
+
'GOES-EAST FULL DISK': 'F',
|
|
90
|
+
'GOES-EAST MESOSCALE 1': 'M1',
|
|
91
|
+
'GOES-EAST MESOSCALE 2': 'M2'
|
|
92
|
+
};
|
|
93
|
+
const LUMPED_MULTIBAND_SATELLITE_SECTORS = new Set(['GOES-EAST CONUS', 'GOES-EAST FULL DISK']);
|
|
94
|
+
|
|
95
|
+
/** Uppercase RGB channel tokens as in production (CHANNEL_CATEGORIES.RGB). */
|
|
96
|
+
const SATELLITE_RGB_PRODUCT_UPPER = new Set(['TRUE_COLOR', 'GEOCOLOR', 'NTMICRO', 'DAY_CLOUD_PHASE', 'DAY_LAND_CLOUD_FIRE', 'AIR_MASS', 'SANDWICH', 'SIMPLE_WATER_VAPOR', 'DUST', 'FIRE_TEMPERATURE']);
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Maximum timeline window length in hours for satellite, MRMS, and NEXRAD. Values are clamped to (0, this].
|
|
100
|
+
*/
|
|
101
|
+
const TIMELINE_DURATION_MAX_HOURS = exports.TIMELINE_DURATION_MAX_HOURS = 12;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Preset hour buttons (UI). Any positive duration ≤ {@link TIMELINE_DURATION_MAX_HOURS} is valid via {@link formatTimelineDurationValue}.
|
|
105
|
+
*/
|
|
106
|
+
const TIMELINE_DURATION_HOUR_VALUES = exports.TIMELINE_DURATION_HOUR_VALUES = ['1', '4', '6', '12'];
|
|
107
|
+
const LEGACY_SATELLITE_DURATION_ALIASES = {
|
|
108
|
+
'0.5': '1'
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/** Tier keys used in SATELLITE_DURATION_CONFIG (frontend dictionaries). */
|
|
112
|
+
const SATELLITE_DURATION_CONFIG = exports.SATELLITE_DURATION_CONFIG = {
|
|
113
|
+
CONUS: {
|
|
114
|
+
basic: [{
|
|
115
|
+
label: '1 Hr',
|
|
116
|
+
value: '1',
|
|
117
|
+
interval: 300
|
|
118
|
+
}, {
|
|
119
|
+
label: '4 Hr',
|
|
120
|
+
value: '4',
|
|
121
|
+
interval: 300
|
|
122
|
+
}, {
|
|
123
|
+
label: '6 Hr',
|
|
124
|
+
value: '6',
|
|
125
|
+
interval: 300
|
|
126
|
+
}, {
|
|
127
|
+
label: '12 Hr',
|
|
128
|
+
value: '12',
|
|
129
|
+
interval: 300
|
|
130
|
+
}]
|
|
131
|
+
},
|
|
132
|
+
FULL_DISK: {
|
|
133
|
+
basic: [{
|
|
134
|
+
label: '1 Hr',
|
|
135
|
+
value: '1',
|
|
136
|
+
interval: 600
|
|
137
|
+
}, {
|
|
138
|
+
label: '4 Hr',
|
|
139
|
+
value: '4',
|
|
140
|
+
interval: 600
|
|
141
|
+
}, {
|
|
142
|
+
label: '6 Hr',
|
|
143
|
+
value: '6',
|
|
144
|
+
interval: 600
|
|
145
|
+
}, {
|
|
146
|
+
label: '12 Hr',
|
|
147
|
+
value: '12',
|
|
148
|
+
interval: 600
|
|
149
|
+
}]
|
|
150
|
+
},
|
|
151
|
+
MESOSCALE: {
|
|
152
|
+
basic: [{
|
|
153
|
+
label: '1 Hr',
|
|
154
|
+
value: '1',
|
|
155
|
+
interval: 120
|
|
156
|
+
}, {
|
|
157
|
+
label: '4 Hr',
|
|
158
|
+
value: '4',
|
|
159
|
+
interval: 120
|
|
160
|
+
}, {
|
|
161
|
+
label: '6 Hr',
|
|
162
|
+
value: '6',
|
|
163
|
+
interval: 120
|
|
164
|
+
}, {
|
|
165
|
+
label: '12 Hr',
|
|
166
|
+
value: '12',
|
|
167
|
+
interval: 120
|
|
168
|
+
}]
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Parses a user duration to hours, then clamps to a positive value not exceeding {@link TIMELINE_DURATION_MAX_HOURS}.
|
|
174
|
+
* @param {string|number} value
|
|
175
|
+
* @returns {number}
|
|
176
|
+
*/
|
|
177
|
+
function parseTimelineDurationHours(value) {
|
|
178
|
+
let s = value == null ? '1' : String(value).trim();
|
|
179
|
+
s = LEGACY_SATELLITE_DURATION_ALIASES[s] || s;
|
|
180
|
+
const n = Number(s);
|
|
181
|
+
if (!Number.isFinite(n) || n <= 0) return 1;
|
|
182
|
+
if (n > TIMELINE_DURATION_MAX_HOURS) return TIMELINE_DURATION_MAX_HOURS;
|
|
183
|
+
return n;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Canonical string for AguaceroCore state (stable for equality checks). Supports fractional hours (e.g. <code>'2.5'</code>).
|
|
188
|
+
* @param {string|number} value
|
|
189
|
+
* @returns {string}
|
|
190
|
+
*/
|
|
191
|
+
function formatTimelineDurationValue(value) {
|
|
192
|
+
const n = parseTimelineDurationHours(value);
|
|
193
|
+
if (Math.abs(n - Math.round(n)) < 1e-6) return String(Math.round(n));
|
|
194
|
+
return String(Math.round(n * 10000) / 10000);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** @returns {string} Same as {@link formatTimelineDurationValue} (backward-compatible name). */
|
|
198
|
+
function normalizeTimelineDurationValue(value) {
|
|
199
|
+
return formatTimelineDurationValue(value);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Picks a preset GOES duration option when one matches; otherwise builds a custom option using the same cadence as the 1 hr preset for that sector/tier.
|
|
204
|
+
* @param {string} sectorName - e.g. <code>GOES-EAST CONUS</code>
|
|
205
|
+
* @param {string} [tier='basic']
|
|
206
|
+
* @param {string|number} durationValue
|
|
207
|
+
* @returns {{ label: string, value: string, interval: number }}
|
|
208
|
+
*/
|
|
209
|
+
function resolveSatelliteDurationOption(sectorName, tier, durationValue) {
|
|
210
|
+
var _SATELLITE_DURATION_C, _tierConfig$find;
|
|
211
|
+
let sectorType = 'CONUS';
|
|
212
|
+
if (sectorName.includes('FULL DISK')) sectorType = 'FULL_DISK';else if (sectorName.includes('MESOSCALE')) sectorType = 'MESOSCALE';
|
|
213
|
+
const t = tier || 'basic';
|
|
214
|
+
const tierConfig = ((_SATELLITE_DURATION_C = SATELLITE_DURATION_CONFIG[sectorType]) === null || _SATELLITE_DURATION_C === void 0 ? void 0 : _SATELLITE_DURATION_C[t]) || SATELLITE_DURATION_CONFIG.CONUS.basic;
|
|
215
|
+
const key = formatTimelineDurationValue(durationValue);
|
|
216
|
+
const preset = tierConfig.find(o => String(o.value) === String(key));
|
|
217
|
+
if (preset) return preset;
|
|
218
|
+
const interval = ((_tierConfig$find = tierConfig.find(o => o.value === '1')) === null || _tierConfig$find === void 0 ? void 0 : _tierConfig$find.interval) || 300;
|
|
219
|
+
return {
|
|
220
|
+
label: `${key} Hr`,
|
|
221
|
+
value: key,
|
|
222
|
+
interval
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function getDefaultSatelliteDurationOption(sectorName, tier = 'basic') {
|
|
226
|
+
var _SATELLITE_DURATION_C2;
|
|
227
|
+
let sectorType = 'CONUS';
|
|
228
|
+
if (sectorName.includes('FULL DISK')) sectorType = 'FULL_DISK';else if (sectorName.includes('MESOSCALE')) sectorType = 'MESOSCALE';
|
|
229
|
+
const tierConfig = ((_SATELLITE_DURATION_C2 = SATELLITE_DURATION_CONFIG[sectorType]) === null || _SATELLITE_DURATION_C2 === void 0 ? void 0 : _SATELLITE_DURATION_C2[tier]) || SATELLITE_DURATION_CONFIG.CONUS.basic;
|
|
230
|
+
return tierConfig.find(o => o.value === '1') || tierConfig[0];
|
|
231
|
+
}
|
|
232
|
+
function calculateUnixTimeFromSatelliteKey(fileKey) {
|
|
233
|
+
try {
|
|
234
|
+
const match = fileKey.match(/_(\d{10})(?:\.ktx2)?$/);
|
|
235
|
+
if (match) return parseInt(match[1], 10);
|
|
236
|
+
const oldMatch = fileKey.match(/_s(\d{4})(\d{3})(\d{2})(\d{2})(\d{2})/);
|
|
237
|
+
if (oldMatch) {
|
|
238
|
+
const [, year, dayOfYear, hour, minute, second] = oldMatch.map(Number);
|
|
239
|
+
const date = new Date(Date.UTC(year, 0, 1));
|
|
240
|
+
date.setUTCDate(dayOfYear);
|
|
241
|
+
date.setUTCHours(hour, minute, second, 0);
|
|
242
|
+
return date.getTime() / 1000;
|
|
243
|
+
}
|
|
244
|
+
return 0;
|
|
245
|
+
} catch {
|
|
246
|
+
return 0;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* @param {{ satelliteInstrumentId: string, satelliteSectorLabel: string, satelliteChannel: string }} selection
|
|
252
|
+
* @param {string[]} allFiles S3 keys from satellite listing API
|
|
253
|
+
* @param {{ value: string, interval: number }} durationOption
|
|
254
|
+
*/
|
|
255
|
+
function buildSatelliteTimelineForSelection(selection, allFiles, durationOption) {
|
|
256
|
+
const satelliteName = selection === null || selection === void 0 ? void 0 : selection.satelliteInstrumentId;
|
|
257
|
+
const categoryName = selection === null || selection === void 0 ? void 0 : selection.satelliteSectorLabel;
|
|
258
|
+
const channelName = selection === null || selection === void 0 ? void 0 : selection.satelliteChannel;
|
|
259
|
+
if (!satelliteName || !categoryName || !channelName) {
|
|
260
|
+
return {
|
|
261
|
+
unixTimes: [],
|
|
262
|
+
fileList: [],
|
|
263
|
+
timeToFileMap: {}
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
const SECTOR_CODE_MAP_LOCAL = {
|
|
267
|
+
'GOES-EAST CONUS': 'C',
|
|
268
|
+
'GOES-EAST FULL DISK': 'F',
|
|
269
|
+
'GOES-EAST MESOSCALE 1': 'M1',
|
|
270
|
+
'GOES-EAST MESOSCALE 2': 'M2'
|
|
271
|
+
};
|
|
272
|
+
const satelliteNum = satelliteName.replace('GOES', '').replace('-EAST', '').replace('-WEST', '');
|
|
273
|
+
const satId = `G${satelliteNum}`;
|
|
274
|
+
const sectorCode = SECTOR_CODE_MAP_LOCAL[categoryName] || 'C';
|
|
275
|
+
let sectorType = 'CONUS';
|
|
276
|
+
if (categoryName.includes('FULL DISK')) sectorType = 'FULL_DISK';else if (categoryName.includes('MESOSCALE')) sectorType = 'MESOSCALE';
|
|
277
|
+
const intervalSeconds = (durationOption === null || durationOption === void 0 ? void 0 : durationOption.interval) || 300;
|
|
278
|
+
const durationHours = durationOption !== null && durationOption !== void 0 && durationOption.value ? parseFloat(durationOption.value) : 1;
|
|
279
|
+
const filePrefix = `${sectorCode}_${satId}_`;
|
|
280
|
+
let searchProduct = channelName.toUpperCase();
|
|
281
|
+
if (!/^C\d{2}$/.test(searchProduct)) {
|
|
282
|
+
if (SATELLITE_RGB_PRODUCT_UPPER.has(searchProduct)) {
|
|
283
|
+
searchProduct = LUMPED_MULTIBAND_SATELLITE_SECTORS.has(categoryName) ? 'MULTI' : searchProduct;
|
|
284
|
+
} else {
|
|
285
|
+
searchProduct = 'MULTI';
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
const matchString = `${filePrefix}${searchProduct}`;
|
|
289
|
+
let relevantFiles = allFiles.filter(file => file.startsWith(matchString));
|
|
290
|
+
if (relevantFiles.length === 0) {
|
|
291
|
+
return {
|
|
292
|
+
unixTimes: [],
|
|
293
|
+
fileList: [],
|
|
294
|
+
timeToFileMap: {}
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
relevantFiles.sort((a, b) => {
|
|
298
|
+
const timeA = calculateUnixTimeFromSatelliteKey(a);
|
|
299
|
+
const timeB = calculateUnixTimeFromSatelliteKey(b);
|
|
300
|
+
return timeA - timeB;
|
|
301
|
+
});
|
|
302
|
+
let cutoffTime = 0;
|
|
303
|
+
if (durationHours > 0) {
|
|
304
|
+
const latestTime = calculateUnixTimeFromSatelliteKey(relevantFiles[relevantFiles.length - 1]);
|
|
305
|
+
cutoffTime = latestTime - durationHours * 3600;
|
|
306
|
+
}
|
|
307
|
+
let processedFiles = relevantFiles.filter(f => calculateUnixTimeFromSatelliteKey(f) >= cutoffTime);
|
|
308
|
+
if (intervalSeconds > 0 && processedFiles.length > 0) {
|
|
309
|
+
const intervalMinutes = intervalSeconds / 60;
|
|
310
|
+
if (sectorType === 'MESOSCALE') {
|
|
311
|
+
processedFiles = processedFiles.filter(file => {
|
|
312
|
+
if (intervalMinutes <= 1.1) return true;
|
|
313
|
+
const t = calculateUnixTimeFromSatelliteKey(file);
|
|
314
|
+
const date = new Date(t * 1000);
|
|
315
|
+
const minutes = date.getUTCMinutes();
|
|
316
|
+
return minutes % intervalMinutes === 0;
|
|
317
|
+
});
|
|
318
|
+
} else {
|
|
319
|
+
if (intervalSeconds >= 300) {
|
|
320
|
+
processedFiles = processedFiles.filter(file => {
|
|
321
|
+
if (Math.abs(intervalMinutes - 5) < 0.1) return true;
|
|
322
|
+
const t = calculateUnixTimeFromSatelliteKey(file);
|
|
323
|
+
const minutes = new Date(t * 1000).getUTCMinutes();
|
|
324
|
+
const remainder = minutes % intervalMinutes;
|
|
325
|
+
const distToInterval = Math.min(remainder, intervalMinutes - remainder);
|
|
326
|
+
return distToInterval < 2.5;
|
|
327
|
+
});
|
|
328
|
+
} else {
|
|
329
|
+
processedFiles = processedFiles.filter(file => {
|
|
330
|
+
const t = calculateUnixTimeFromSatelliteKey(file);
|
|
331
|
+
const minutes = new Date(t * 1000).getUTCMinutes();
|
|
332
|
+
return minutes % intervalMinutes === 0;
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
if (processedFiles.length === 0 && relevantFiles.length > 0) {
|
|
337
|
+
processedFiles = relevantFiles.slice(-1);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
const unixTimes = [];
|
|
341
|
+
const timeToFileMap = {};
|
|
342
|
+
processedFiles.forEach(file => {
|
|
343
|
+
const unixTime = calculateUnixTimeFromSatelliteKey(file);
|
|
344
|
+
if (unixTime > 0) {
|
|
345
|
+
unixTimes.push(unixTime);
|
|
346
|
+
timeToFileMap[unixTime] = file;
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
// Chronological (oldest → newest): matches standard time sliders (earlier left, later right).
|
|
351
|
+
unixTimes.sort((a, b) => a - b);
|
|
352
|
+
return {
|
|
353
|
+
unixTimes,
|
|
354
|
+
fileList: processedFiles,
|
|
355
|
+
timeToFileMap
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* All GOES-East spacecraft / sector / channel combinations the SDK knows (same naming as production).
|
|
361
|
+
* @param {string} [satelliteInstrumentId='GOES19-EAST']
|
|
362
|
+
* @returns {Array<{ satelliteInstrumentId: string, satelliteSectorLabel: string, satelliteChannel: string }>}
|
|
363
|
+
*/
|
|
364
|
+
function getAllGoesEastSatelliteSelections(satelliteInstrumentId = 'GOES19-EAST') {
|
|
365
|
+
const out = [];
|
|
366
|
+
for (const sector of GOES_EAST_SATELLITE_SECTORS) {
|
|
367
|
+
for (const ch of GOES_SATELLITE_CHANNELS) {
|
|
368
|
+
out.push({
|
|
369
|
+
satelliteInstrumentId,
|
|
370
|
+
satelliteSectorLabel: sector,
|
|
371
|
+
satelliteChannel: ch
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
return out;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* @param {string} satelliteChannel — band or RGB id (third segment of the archive descriptor)
|
|
380
|
+
*/
|
|
381
|
+
function resolveSatelliteS3FileName(satelliteChannel, timeToFileMap, satelliteTimestamp) {
|
|
382
|
+
const fileFromMap = timeToFileMap === null || timeToFileMap === void 0 ? void 0 : timeToFileMap[satelliteTimestamp];
|
|
383
|
+
if (fileFromMap) return fileFromMap;
|
|
384
|
+
const channelName = satelliteChannel;
|
|
385
|
+
const channelNameUpper = String(channelName).toUpperCase();
|
|
386
|
+
let name = fileFromMap || '';
|
|
387
|
+
if (!name && satelliteTimestamp != null) {
|
|
388
|
+
const suffix = `_${String(Math.floor(Number(satelliteTimestamp)))}`;
|
|
389
|
+
const multiName = Object.values(timeToFileMap || {}).find(f => f.includes('MULTI') && f.includes(suffix));
|
|
390
|
+
if (multiName) {
|
|
391
|
+
name = multiName.replace('MULTI', channelNameUpper);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
return name;
|
|
395
|
+
}
|