Weight.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2005 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/General/Pulsar/Weight.h
10 
11 #ifndef _Pulsar_Weight_H
12 #define _Pulsar_Weight_H
13 
14 #include "Pulsar/Algorithm.h"
15 #include "Pulsar/ScrunchFactor.h"
16 #include "TextInterface.h"
17 
18 namespace Pulsar {
19 
20  class Archive;
21  class Integration;
22 
24  class Weight : public Algorithm {
25 
26  public:
27 
29  Weight ();
30 
32  virtual void operator () (Archive*);
33 
36 
38  class Interface;
39 
41  void set_fscrunch (const ScrunchFactor& f) { fscrunch_factor = f; }
42 
44  const ScrunchFactor get_fscrunch () const { return fscrunch_factor; }
45 
46  protected:
47 
49  virtual void weight (Integration*) = 0;
50 
52  void copy_weights (const Integration* from, Integration* to);
53 
56 
57  };
58 
59 }
60 
61 #endif
62 
Weight()
Default constructor.
Definition: Weight.C:12
ScrunchFactor fscrunch_factor
Compute weights from fscrunched clone of data, then apply to original.
Definition: Weight.h:60
virtual TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition: Weight.C:66
const ScrunchFactor get_fscrunch() const
Get the frequency scrunch factor.
Definition: Weight.h:49
virtual void operator()(Archive *)
Set the weights of all Profiles in the Archive.
Definition: Weight.C:17
The primary interface to pulsar observational data.
Definition: Archive.h:45
Manages a combined scrunch factor or target dimension.
Definition: ScrunchFactor.h:25
void fscrunch(Container *, const ScrunchFactor &)
Integrate frequency channels.
Definition: ScrunchFactor.h:102
float get_weight(unsigned ichan) const
Get the Profile weight attribute of the given channel.
Definition: Integration.C:388
void disable_scrunch()
Disable scrunching.
Definition: ScrunchFactor.h:59
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
void copy_weights(const Integration *from, Integration *to)
Copy the weights from 'from' to 'to'.
Definition: Weight.C:39
Algorithms that set the weights of all Profiles in an Archive.
Definition: Weight.h:29
void set_weight(unsigned ichan, float weight)
Set the Profile weight attributes of the given channel.
Definition: Integration.C:401
virtual unsigned get_nchan() const =0
Get the number of chans.
Defines the PSRCHIVE library.
Definition: CalSource.h:17
void set_fscrunch(const ScrunchFactor &f)
Set the frequency scrunch factor.
Definition: Weight.h:46
virtual void weight(Integration *)=0
Set the weight of each frequency channel in the sub-integration.

Generated using doxygen 1.8.17