rinex-cli 0.5.0

Command line tool parse and analyze RINEX data
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
use clap::{
    Command, 
    Arg, ArgMatches, 
    ArgAction,
    ColorChoice,
};
use crate::parser::{
    parse_epoch,
};
use rinex::prelude::*;

pub struct Cli {
    /// Arguments passed by user
    pub matches: ArgMatches,
}

impl Cli {
    /// Build new command line interface 
    pub fn new() -> Self {
        Self {
            matches: {
                Command::new("rinex-cli")
                    .author("Guillaume W. Bres, <guillaume.bressaix@gmail.com>")
                    .version("1.0")
                    .about("RINEX analysis and processing tool")
                    .arg_required_else_help(true)
                    .color(ColorChoice::Always)
                    .arg(Arg::new("filepath")
                        .short('f')
                        .long("fp")
                        .value_name("FILE")
                        .help("Input RINEX file")
                        .action(ArgAction::Append)
                        .required(true))
                .next_help_heading("RINEX identification commands")
                    .arg(Arg::new("epochs")
                        .long("epochs")
                        .short('e')
                        .action(ArgAction::SetTrue)
                        .help("Identify epochs"))
                    .arg(Arg::new("constellations")
                        .long("constellations")
                        .short('c')
                        .action(ArgAction::SetTrue)
                        .help("Identify GNSS constellations"))
                    .arg(Arg::new("sv")
                        .long("sv")
                        .action(ArgAction::SetTrue)
                        .help("Identify space vehicules"))
                    .arg(Arg::new("sv-epoch")
                        .long("sv-epoch")
                        .action(ArgAction::SetTrue)
                        .help("Plots encountered space vehicules per epoch.
Useful graph to determine unexpected and determine vehicules of interest, inside this record.
When both `--fp` and extra Navigation Context (`--nav`) are provided,
this emphasizes epochs where vehicules were sampled on both contexts."))
                    .arg(Arg::new("epoch-hist")
                        .long("epoch-hist")
                        .action(ArgAction::SetTrue)
                        .help("Epoch duration histogram (graphical) analysis."))
                    .arg(Arg::new("header")
                        .long("header")
                        .action(ArgAction::SetTrue)
                        .help("Extract header fields"))
                .next_help_heading("Record resampling methods")
                    .arg(Arg::new("resample-ratio")
                        .long("resample-ratio")
                        .short('r')
                        .value_name("RATIO(u32)")
                        .help("Downsample record content by given factor. 
For example, \"--resample-ratio 2\" would keep one every other epoch"))
                    .arg(Arg::new("resample-interval")
                        .long("resample-interval")
                        .short('i')
                        .value_name("DURATION")
                        .help("Shrinks record so adjacent epochs match 
the |e(n)-e(n-1)| > interval condition. 
Interval must be a valid \"HH:MM:SS\" duration description.
Example: -i 00:10:00 will have all epochs spaced by at least 10 minutes."))
                    .arg(Arg::new("time-window")
                        .long("time-window")
                        .value_name("START, END")
                        .short('w')
                        .help("Center record content around specified epoch window. 
All epochs that do not lie within the specified (start, end) 
interval are dropped out. User must pass two valid Datetime description. Epochs are specified in UTC timescale.
Example: -w \"2020-01-01 2020-01-02\" will restrict to 2020/01/01 midnight to 24hours.
Example: -w \"2020-01-01 00:00:00 2020-01-01 01:00:00\" will restrict the first hour."))
                .next_help_heading("Retain filters (focus on data of interest)")
                    .arg(Arg::new("retain-constell")
                        .long("retain-constell")
                        .value_name("list(Constellation)")
                        .help("Retain only given GNSS constellation"))
                    .arg(Arg::new("retain-sv")
                        .long("retain-sv")
                        .value_name("list(Sv)")
                        .help("Retain only given Space vehicules"))
                    .arg(Arg::new("retain-epoch-ok")
                        .long("retain-epoch-ok")
                        .action(ArgAction::SetTrue)
                        .help("Retain only epochs where associated flag is \"Ok\" or \"Unknown\".
Truly applies to Observation RINEX only."))
                    .arg(Arg::new("retain-epoch-nok")
                        .long("retain-epoch-nok")
                        .action(ArgAction::SetTrue)
                        .help("Retain only non valid epochs.
Truly applies to Observation RINEX only."))
                    .arg(Arg::new("retain-elev-above")
                        .long("retain-elev-above")
                        .value_name("LIMIT(f64)")
                        .help("Retain vehicules (strictly) above given elevation angle.
-fp must be a NAV file, or NAV context must be provided with -nav"))
                    .arg(Arg::new("retain-elev-below")
                        .long("retain-elev-below")
                        .value_name("LIMIT(f64)")
                        .help("Retain vehicules (strictly) below given elevation angle.
-fp must be a NAV file, or NAV context must be provided with -nav"))
                    .arg(Arg::new("retain-best-elev")
                        .long("retain-best-elev")
                        .action(ArgAction::SetTrue)
                        .help("Retain vehicules per epoch and per constellation, 
that exhibit the best elevation angle.
-fp must be a NAV file, or NAV context must be provided with -nav"))
                .next_help_heading("Observation RINEX specific (-fp)")
                    .arg(Arg::new("observables")
                        .long("observables")
                        .short('o')
                        .action(ArgAction::SetTrue)
                        .help("Identify observables. Applies to Observation and Meteo RINEX"))
                    .arg(Arg::new("retain-obs")
                        .long("retain-obs")
                        .value_name("List(Observables)")
                        .help("Retain only given list of Observables")) 
                    .arg(Arg::new("retain-phase")
                        .long("retain-phase")
                        .action(ArgAction::SetTrue)
                        .help("Retain only Phase Observations (all carriers)")) 
                    .arg(Arg::new("retain-doppler")
                        .long("retain-doppler")
                        .action(ArgAction::SetTrue)
                        .help("Retain only Doppler Observation (all carriers)")) 
                    .arg(Arg::new("retain-pr")
                        .long("retain-pr")
                        .action(ArgAction::SetTrue)
                        .help("Retain only Pseudo Range Observations (all carriers)")) 
                    .arg(Arg::new("retain-ssi")
                        .long("retain-ssi")
                        .help("Retain only observations that have at least this signal quality"))
                    .arg(Arg::new("ssi-range")
                        .long("ssi-range")
                        .action(ArgAction::SetTrue)
                        .help("Display SSI (min,max) range, accross all epochs and vehicules"))
                    .arg(Arg::new("ssi-sv-range")
                        .long("ssi-sv-range")
                        .action(ArgAction::SetTrue)
                        .help("Extract SSI (min,max) range, per vehicule, accross all epochs"))
                    .arg(Arg::new("lli-mask")
                        .long("lli-mask")
                        .short('l')
                        .help("Applies given LLI AND() mask. 
Also drops observations that did not come with an LLI flag"))
                    .arg(Arg::new("clock-offset")
                        .long("clock-offset")
                        .action(ArgAction::SetTrue)
                        .help("Plot receiver clock offsets per epoch."))
                    .arg(Arg::new("gf")
                        .long("gf")
                        .action(ArgAction::SetTrue)
                        .help("Geometry Free recombination of Phase and PR measurements. 
This serves as a CS indicator or atmospheric delay estimator. Refer to README."))
                    .arg(Arg::new("wl")
                        .long("wl")
                        .action(ArgAction::SetTrue)
                        .help("Wide Lane Phase and PR signal combination. 
These combination are more sensitive to CS (phase slope discontinuities). Refer to README."))
                    .arg(Arg::new("nl")
                        .long("nl")
                        .action(ArgAction::SetTrue)
                        .help("Narrow Lane Phase and PR signal combination. 
These combination are more sensitive to CS (phase slope discontinuities). Refer to README."))
                    .arg(Arg::new("mw")
                        .long("mw")
                        .action(ArgAction::SetTrue)
                        .help("Melbourne-Wübbena combination, combines both Wide lane and Narrow lane combinations, 
and serves as the ultimate CS (phase slope discontinuities) detector. Refer to README."))
                    .arg(Arg::new("dcb")
                        .long("dcb")
                        .action(ArgAction::SetTrue)
                        .help("Differential Code Bias analysis (DCBs).
Useful to determine correlation and biases between Phase and PR observations.
For instance \"2S-2W\" means S code against W code, for L2 carrier. Refer to README."))
                    .arg(Arg::new("multipath")
                        .long("mp")
                        .action(ArgAction::SetTrue)
                        .help("Run code multipath analysis. Refer to README."))
                    .arg(Arg::new("lock-loss")
                        .long("lock-loss")
                        .action(ArgAction::SetTrue)
                        .help("Visualize which code might be affected by CS, accross all epochs."))
                    .arg(Arg::new("pr2distance")
                        .long("pr2distance")
                        .action(ArgAction::SetTrue)
                        .help("Converts all Pseudo Range data to real physical distances. 
This is destructive, original pseudo range codes are lost and overwritten"))
                .next_help_heading("Navigation RINEX specific")
                    .arg(Arg::new("orbits")
                        .long("orbits")
                        .action(ArgAction::SetTrue)
                        .help("Identify orbits data fields. -fp must be a NAV file"))
                    .arg(Arg::new("nav-msg")
                        .long("nav-msg")
                        .action(ArgAction::SetTrue)
                        .help("Identify Navigation frame types. -fp must be a NAV file")) 
                    .arg(Arg::new("elevation")
                        .long("elevation")
                        .action(ArgAction::SetTrue)
                        .help("Display elevation angles, per vehicules accross all epochs.
-fp must be a NAV file"))
                    .arg(Arg::new("clock-bias")
                        .long("clock-bias")
                        .action(ArgAction::SetTrue)
                        .help("Display clock biases (offset, drift, drift changes) per epoch and vehicule.
-fp must be a NAV file"))
                    .arg(Arg::new("retain-orb")
                        .long("retain-orb")
                        .help("Retain only given list of Orbits fields.
For example, \"satPosX\" and \"satPosY\" are valid Glonass Orbit fields.
Applies to either -fp or -nav context"))
                    .arg(Arg::new("retain-lnav")
                        .long("retain-lnav")
                        .action(ArgAction::SetTrue)
                        .help("Retain only Legacy Navigation frames.
Applies to either -fp or -nav context"))
                    .arg(Arg::new("retain-mnav")
                        .long("retain-mnav")
                        .action(ArgAction::SetTrue)
                        .help("Retain only Modern Navigation frames.
Applies to either -fp or -nav context"))
                    .arg(Arg::new("retain-nav-msg")
                        .long("retain-nav-msg")
                        .action(ArgAction::SetTrue)
                        .help("Retain only given list of Navigation messages.
Applies to either -fp or -nav context"))
                    .arg(Arg::new("retain-nav-eph")
                        .long("retain-nav-eph")
                        .action(ArgAction::SetTrue)
                        .help("Retains only Navigation ephemeris frames.
Applies to either -fp or -nav context"))
                    .arg(Arg::new("retain-nav-iono")
                        .long("retain-nav-iono")
                        .action(ArgAction::SetTrue)
                        .help("Retains only Navigation ionospheric models. 
-fp must be a NAV file"))
                .next_help_heading("RINEX processing")
                    .arg(Arg::new("nav")
                        .long("nav")
                        .value_name("FILE")
                        .help("Provide Navigation context for advanced RINEX processing.
Usually combined to Observation data, provided with -fp.
Only identical epochs can be analyzed and processed.
Ideally, both contexts have strictly identical sample rates.
Refer to README."))
                .next_help_heading("`teqc` operations")
                    .arg(Arg::new("merge")
                        .short('m')
                        .value_name("FILE")
                        .long("merge")
                        .help("RINEX merge operation.
Combine this RINEX, considered secondary, into `--fp`. RINEX format must match."))
                    .arg(Arg::new("split")
                        .long("split")
                        .value_name("DATETIME")
                        .short('s')
                        .help("Split RINEX into two seperate files"))
                    .arg(Arg::new("ascii-plot")
                        .long("ascii-plot")
                        .action(ArgAction::SetTrue)
                        .help("Prints a tiny plot, similar to \"teqc\""))
                    .arg(Arg::new("qc")
                        .short('q')
                        .long("qc")
                        .action(ArgAction::SetTrue)
                        .help("RINEX quality check,
generates verbose report, similar to \"teqc\""))
                .next_help_heading("RINEX output")
                    .arg(Arg::new("output")
                        .long("output")
                        .value_name("FILE")
                        .action(ArgAction::Append)
                        .help("Custom file paths to be generated from preprocessed RINEX files.
For example -fp was filtered and decimated, use --output to dump results into a new RINEX."))
                    .arg(Arg::new("custom-header")
                        .long("custom-header")
                        .value_name("JSON")
                        .action(ArgAction::Append)
                        .help("Custom header attributes, in case we're generating data.
--custom-header must either be plain JSON or an external JSON descriptor.
Refer to README"))
                .next_help_heading("Terminal options")
                    .arg(Arg::new("pretty")
                        .long("pretty")
                        .action(ArgAction::SetTrue)
                        .help("Make terminal output more readable"))
                .next_help_heading("Data visualization")
                    .arg(Arg::new("skyplot")
                        .short('y')
                        .long("skyplot")
                        .action(ArgAction::SetTrue)
                        .help("Generate a \"skyplot\". NAV context must be provided, either with -fp or -nav"))
                    .arg(Arg::new("plot-width")
                        .long("plot-width")
                        .value_name("WIDTH(u32)")
                        .help("Set plot width. Default is 1024px.
Example \"--plot-width 2048"))
                    .arg(Arg::new("plot-height")
                        .long("plot-height")
                        .value_name("HEIGHT(u32)")
                        .help("Set plot height. Default is 768px.
Example \"--plot-height 1024"))
                    .arg(Arg::new("plot-dim")
                        .long("plot-dim")
                        .value_name("DIM(u32,u32)")
                        .help("Set plot dimensions. Example \"--plot-dim 2048,768\". Default is (1024, 768)px"))
                    .get_matches()
            },
        }
    }
    /// Returns input filepaths
    pub fn input_path(&self) -> &str {
        self.matches
            .get_one::<String>("filepath")
            .unwrap()
    }
    /// Returns output filepaths
    pub fn output_path(&self) -> Option<&str> {
        if let Some(args) = self.matches.get_one::<String>("output") {
            Some(&args)
        } else {
            None
        }
    }
    /// Returns true if GF recombination requested
    pub fn gf_recombination(&self) -> bool {
        self.matches.get_flag("gf")
    }
    pub fn wl_recombination(&self) -> bool {
        self.matches.get_flag("wl")
    }
    pub fn nl_recombination(&self) -> bool {
        self.matches.get_flag("nl")
    }
    pub fn mw_recombination(&self) -> bool {
        self.matches.get_flag("mw")
    }
    pub fn basic_identification(&self) -> bool {
        self.matches.get_flag("sv")
        | self.matches.get_flag("epochs")
        | self.matches.get_flag("header")
        | self.matches.get_flag("observables")
        | self.matches.get_flag("ssi-range")
        | self.matches.get_flag("orbits")
        | self.matches.get_flag("nav-msg")
    }
    /// Returns true if Sv accross epoch display is requested 
    pub fn sv_epoch(&self) -> bool {
        self.matches.get_flag("sv-epoch")
    }
    /// Epoch interval (histogram) analysis
    pub fn epoch_histogram(&self) -> bool {
        self.matches.get_flag("epoch-hist")
    }
    /// Phase /PR DCBs analysis requested 
    pub fn dcb(&self) -> bool {
        self.matches.get_flag("dcb")
    }
    /// Code Multipath analysis requested 
    pub fn multipath(&self) -> bool {
        self.matches.get_flag("multipath")
    }
    /// Returns list of requested data to extract
    pub fn identification_ops(&self) -> Vec<&str> {
        let flags = vec![
            "sv",
            "epochs",
            "header",
            "constellations",
            "observables",
            "ssi-range",
            "ssi-sv-range",
            "orbits",
            "nav-msg",
        ];
        flags.iter()
            .filter(|x| self.matches.get_flag(x))
            .map(|x| *x)
            .collect()
    }
    /// Returns true if at least one retain filter should be applied
    pub fn retain(&self) -> bool {
        self.matches.contains_id("retain-constell")
        | self.matches.contains_id("retain-sv")
        | self.matches.contains_id("retain-epoch-ok")
        | self.matches.contains_id("retain-epoch-nok")
        | self.matches.contains_id("retain-obs")
        | self.matches.contains_id("retain-ssi")
        | self.matches.contains_id("retain-orb")
        | self.matches.contains_id("retain-lnav")
        | self.matches.contains_id("retain-mnav")
        | self.matches.contains_id("retain-nav-msg")
        | self.matches.contains_id("retain-nav-eph")
        | self.matches.contains_id("retain-nav-iono")
        | self.matches.contains_id("retain-phase")
        | self.matches.contains_id("retain-doppler")
        | self.matches.contains_id("retain-best-elev")
        | self.matches.contains_id("retain-elev-above")
        | self.matches.contains_id("retain-elev-below")
        | self.matches.contains_id("retain-pr")
    }

    pub fn retain_flags(&self) -> Vec<&str> {
        let flags = vec![
            "retain-epoch-ok",
            "retain-epoch-nok",
            "retain-lnav",
            "retain-mnav",
            "retain-nav-msg",
            "retain-nav-eph",
            "retain-nav-iono",
            "retain-phase",
            "retain-doppler",
            "retain-pr",
            "retain-best-elev",
        ];
        flags.iter()
            .filter_map(|x| {
                if self.matches.get_flag(x) {
                    Some(*x)
                } else {
                    None
                }
            })
            .collect()
    }
    /// Returns list of retain ops to perform with given list of arguments
    pub fn retain_ops(&self) -> Vec<(&str, Vec<&str>)> {
        // this list order is actually important,
        //   because they describe the filter operation order
        //   it is better to have epochs filter first
        //    then the rest will follow
        let flags = vec![
            "retain-constell",
            "retain-sv",
            "retain-obs",
            "retain-ssi",
            "retain-elev-above",
            "retain-elev-below",
            "retain-orb",
        ];
        flags.iter()
            .filter(|x| self.matches.contains_id(x))
            .map(|id| {
                let descriptor = self.matches.get_one::<String>(id)
                    .unwrap();
                let args: Vec<&str> = descriptor
                    .split(",")
                    .collect();
                (id, args)
            })
            .map(|(id, args)| (*id, args)) 
            .collect()
    }
    /// Returns true if at least one resampling op is to be performed
    pub fn resampling(&self) -> bool {
        self.matches.contains_id("resample-ratio")
        | self.matches.contains_id("resample-interval")
        | self.matches.contains_id("time-window")
    }

    pub fn resampling_ops(&self) -> Vec<(&str, &str)> {
        // this order describes eventually the order of filtering operations
        let flags = vec![
            "resample-ratio",
            "resample-interval",
            "time-window",
        ];
        flags.iter()
            .filter(|x| self.matches.contains_id(x))
            .map(|id| {
                let args = self.matches.get_one::<String>(id)
                    .unwrap();
                (id, args.as_str())
            })
            .map(|(id, args)| (*id, args))
            .collect()
    }

    /// Returns true if at least one filter should be applied 
    pub fn filter(&self) -> bool {
        self.matches.contains_id("lli-mask")
    }
    pub fn filter_ops(&self) -> Vec<(&str, &str)> {
        let flags = vec![
            "lli-mask",
        ];
        flags.iter()
            .filter(|x| self.matches.contains_id(x))
            .map(|id| {
                let args = self.matches.get_one::<String>(id)
                    .unwrap();
                (id, args.as_str())
            })
            .map(|(id, args)| (*id, args))
            .collect()
    }
    fn get_flag (&self, flag: &str) -> bool {
        self.matches
            .get_flag(flag)
    }
    pub fn pretty (&self) -> bool {
        self.get_flag("pretty")
    }
    /// Returns optionnal RINEX file to "merge"
    pub fn merge(&self) -> Option<&str> {
        if self.matches.contains_id("merge") {
            if let Some(s) = self.matches.get_one::<String>("merge") {
                Some(&s)
            } else {
                None
            }
        } else {
            None
        }
    }
    /// Returns split operation args
    pub fn split(&self) -> Option<Epoch> {
        if self.matches.contains_id("split") {
            if let Some(args) = self.matches.get_one::<String>("split") {
                if let Ok(epoch) = parse_epoch(args) {
                    Some(epoch)
                } else { 
                    panic!("failed to parse [DATETIME]");
                }
            } else {
                None
            }
        } else {
            None
        }
    }
    /// Returns optionnal Navigation context
    pub fn nav_context(&self) -> Option<Rinex> {
        if self.matches.contains_id("nav") {
            let args = self.matches.get_one::<String>("nav")
                .unwrap();
            if let Ok(rnx) = Rinex::from_file(args) {
                if rnx.is_navigation_rinex() {
                    Some(rnx)
                } else {
                    panic!("--nav must be a Navigation RINEX");
                }
            } else {
                println!("Failed to parse Navigation Context \"{}\"", args);
                None
            }
        } else {
            None
        }
    }
    /// Returns desired plot dimensions
    pub fn plot_dimensions(&self) -> (u32,u32) {
        let mut dim = (1024, 768);
        if self.matches.contains_id("plot-dim") {
            let args = self.matches.get_one::<String>("plot-dim")
                .unwrap();
            let items: Vec<&str> = args.split(",").collect();
            if items.len() == 2 {
                if let Ok(w) = u32::from_str_radix(items[0].trim(), 10) {
                    if let Ok(h) = u32::from_str_radix(items[1].trim(), 10) {
                        dim = (w, h);
                    }
                }
            }
        } else if self.matches.contains_id("plot-width") {
            let arg = self.matches.get_one::<String>("plot-width")
                .unwrap();
            if let Ok(w) = u32::from_str_radix(arg.trim(), 10) {
                dim.0 = w;
            }
        } else if self.matches.contains_id("plot-height") {
            let arg = self.matches.get_one::<String>("plot-height")
                .unwrap();
            if let Ok(h) = u32::from_str_radix(arg.trim(), 10) {
                dim.1 = h;
            }
        }
        dim
    }
}