FscrunchInterpreter.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2019 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/General/Pulsar/FscrunchInterpreter.h
10
11#ifndef __Pulsar_FscrunchInterpreter_h
12#define __Pulsar_FscrunchInterpreter_h
13
14#include <string>
15
16namespace Pulsar {
17
19 template <class Engine>
21 {
22 public:
23
25
26 template <class Container, class Interpreter>
27 void fscrunch (Interpreter* interpreter, Container* container, const std::string& args)
28 {
29 bool scrunch_by = false;
30 std::string temp = args;
31
32 if (args[0] == 'x')
33 {
34 scrunch_by = true;
35 temp.erase (0,1);
36 }
37
38 unsigned scrunch = interpreter->template setup<unsigned> (temp, 0);
39
40 if (!scrunch)
41 container -> fscrunch();
42 else if (scrunch_by)
43 container -> fscrunch (scrunch);
44 else
45 container -> fscrunch_to_nchan (scrunch);
46 }
47
48 protected:
49
51
52 };
53
54}
55
56#endif
57
Data storage implementations.
Definition Container.h:19
Manages Containter frequency integration for an Interpreter using an Engine.
Definition FscrunchInterpreter.h:21
void fscrunch(Interpreter *interpreter, Container *container, const std::string &args)
Default constructor.
Definition FscrunchInterpreter.h:27
Pulsar data processing command language interpreter.
Definition Interpreter.h:52
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0