TargetDuration.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2021 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/General/Pulsar/TargetDuration.h
10
11#ifndef __Pulsar_TargetDuration_h
12#define __Pulsar_TargetDuration_h
13
14#include "Pulsar/TimeIntegrate.h"
15#include "debug.h"
16
17namespace Pulsar {
18
19 class TimeIntegrate::TargetDuration :
20 public Integrate<Archive>::RangePolicy
21 {
22
23 public:
24
25 TargetDuration (double seconds = 0.0) { duration = seconds; }
26
27 void set_duration (double seconds) { duration = seconds; }
28 double get_duration () const { return duration; }
29
31 void initialize (Integrate<Archive>*, Archive*);
32
34 unsigned get_nrange () { return ranges.size(); }
35
36 void get_range (unsigned irange, unsigned& start, unsigned& stop)
37 {
38 start = ranges[irange].first;
39 stop = ranges[irange].second;
40 }
41
42 protected:
43
45 std::vector< std::pair<unsigned,unsigned> > ranges;
46
48 double duration;
49
50 };
51
52}
53
54#endif
virtual unsigned get_nrange()=0
Return the number of ranges.
Profile integration algorithms.
Definition Integrate.h:36
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0