FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
defaults.ts
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-only
2// Copyright (c) 2025-present FERS Contributors (see AUTHORS.md).
3
4import { v4 as uuidv4 } from 'uuid';
5import { GlobalParameters, Waveform, Timing, Antenna, Platform } from './types';
6
7export const defaultGlobalParameters: GlobalParameters = {
8 id: 'global-parameters',
9 type: 'GlobalParameters',
10 simulation_name: 'FERS Simulation',
11 start: 0.0,
12 end: 10.0,
13 rate: 10000.0,
14 simSamplingRate: null,
15 c: 299792458.0,
16 random_seed: null,
17 adc_bits: 12,
18 oversample_ratio: 1,
19 // Default: UCT, South Africa
20 origin: {
21 latitude: -33.957652,
22 longitude: 18.4611991,
23 altitude: 111.01,
24 },
25 coordinateSystem: {
26 frame: 'ENU',
27 },
28};
29
30export const defaultWaveform: Omit<Waveform, 'id' | 'name'> = {
31 type: 'Waveform',
32 waveformType: 'pulsed_from_file',
33 power: 1000,
34 carrier_frequency: 1e9,
35 filename: '',
36};
37
38export const defaultTiming: Omit<Timing, 'id' | 'name'> = {
39 type: 'Timing',
40 frequency: 10e6,
41 freqOffset: null,
42 randomFreqOffsetStdev: null,
43 phaseOffset: null,
44 randomPhaseOffsetStdev: null,
45 noiseEntries: [],
46};
47
48export const defaultAntenna: Omit<
49 Extract<Antenna, { pattern: 'isotropic' }>,
50 'id' | 'name'
51> = {
52 type: 'Antenna',
53 pattern: 'isotropic',
54 efficiency: 1.0,
55 meshScale: 1.0,
56 design_frequency: null,
57};
58
59export const createDefaultPlatform = (): Omit<Platform, 'id' | 'name'> => ({
60 type: 'Platform',
61 motionPath: {
62 interpolation: 'static',
63 waypoints: [{ id: uuidv4(), x: 0, y: 0, altitude: 0, time: 0 }],
64 },
65 rotation: {
66 type: 'fixed',
67 startAzimuth: 0,
68 startElevation: 0,
69 azimuthRate: 0,
70 elevationRate: 0,
71 },
72 components: [],
73});