PatchFrequency.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2016 by Paul Demorest
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef _Pulsar_PatchFrequency_H
10 #define _Pulsar_PatchFrequency_H
11 
12 #include <vector>
13 #include "Pulsar/Algorithm.h"
14 
15 namespace Pulsar {
16 
17  class Archive;
18  class Integration;
19 
21  class PatchFrequency : public Algorithm
22  {
23 
24  public:
25 
27  PatchFrequency ();
28 
30  void operate (Archive* A, Archive* B);
31 
33  void set_frequency_tolerance (double tol) { freq_tol = tol; }
34 
35  protected:
36 
37  double freq_tol;
38 
39  // Add channels to the integration
40  void add_channels (Integration *into,
41  std::vector<double> frequencies) const;
42 
43  // Add channels to the integration
44  void add_channels (Archive *into,
45  std::vector<double> frequencies) const;
46 
47  };
48 
49 }
50 
51 #endif
const ScalarMath exp(const ScalarMath &x)
void insert(Integration *from)
Inserts Profiles from Integration into this.
Definition: IntegrationExpert.h:69
void set_maximum_harmonic(unsigned max)
Set the maximum number of harmonics to include in fit.
Definition: MatrixTemplateMatching.C:29
void operate(Archive *A, Archive *B)
Add to A whatever is missing with respect to B, and vice versa.
Definition: PatchFrequency.C:62
void set_nchan(unsigned numchan)
Set the number of frequency channels.
Definition: ArchiveExpert.h:52
void set_choose_maximum_harmonic(bool flag=true)
Allow software to choose the maximum harmonic.
Definition: MatrixTemplateMatching.C:35
virtual void set_centre_frequency(double cf)=0
Set the centre frequency of the observation.
Estimates phase shift in Fourier domain using matrix template matching.
Definition: MatrixTemplateMatching.h:26
PatchFrequency()
Default constructor.
Definition: PatchFrequency.C:20
virtual unsigned get_npol() const =0
Get the number of polarization measurements.
void zero()
Zero all the profiles, keeping all else the same.
Definition: Integration.C:185
Estimates phase shift via sinc interpolation of CCF.
Definition: SincInterpShift.h:24
virtual std::string get_source() const =0
Get the source name.
void remove_baseline()
Remove the baseline from all profiles.
Definition: Archive_remove_baseline.C:17
Expert * expert()
Provide access to the expert interface.
Definition: Integration.C:162
void add_channels(Integration *into, std::vector< double > frequencies) const
Add new zero-weighted profiles with the specified frequencies.
Definition: PatchFrequency.C:27
const float * get_amps() const
Return a pointer to the amplitudes array.
Definition: ProfileAmps.C:141
double get_centre_frequency() const
get the centre frequency (in MHz)
Definition: Profile.h:202
double get_centre_frequency(unsigned ichan) const
Get the Profile centre frequency attribute of the given channel.
Definition: Integration.C:359
virtual void set_bandwidth(double bw)=0
Set the overall bandwidth of the observation.
virtual unsigned get_nsubint() const =0
Get the number of sub-integrations stored in the file.
void set_centre_frequency(unsigned ichan, double frequency)
Set the Profile centre frequency attributes of the given channel.
Definition: Integration.C:372
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
The primary interface to pulsar observational data.
Definition: Archive.h:45
virtual unsigned get_nbin() const =0
Get the number of bins in each profile.
unsigned get_nbin() const
Return the number of bins.
Definition: ProfileAmps.h:50
const ScalarMath pow(const ScalarMath &x, const ScalarMath &y)
const ScalarMath sqrt(const ScalarMath &x)
Type * release()
Stores PSRFITS header extensions.
Definition: FITSHdrExtension.h:25
Type * get() const
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
Estimates phase shift in Fourier domain.
Definition: PhaseGradShift.h:27
virtual unsigned get_nchan() const =0
Get the number of frequency channels used.
void bscrunch(unsigned nscrunch)
Integrate pulse profiles in phase.
Definition: Archive_bscrunch.C:31
Smooths a Profile by convolution with a sinc function.
Definition: SmoothSinc.h:28
void set_frequency_tolerance(double tol)
Set the tolerance for matching frequencies (MHz)
Definition: PatchFrequency.h:38
Integration * get_Integration(unsigned subint)
Return pointer to the specified Integration.
Definition: IntegrationManager.C:41
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
BasicIntegration class.
Definition: BasicIntegration.h:24
Profile * get_Profile(unsigned subint, unsigned pol, unsigned chan)
Return pointer to the specified profile.
Definition: Archive.C:270
double get_stt_offs() const
Get the stt_offs.
Definition: FITSHdrExtension.h:121
Expert * expert()
Provide access to the expert interface.
Definition: Archive.C:40
void bscrunch(unsigned nscrunch)
integrate neighbouring phase bins in profile
Definition: Profile.C:505
bool verbose
Definition: timer++.C:25
virtual double get_bandwidth() const =0
Get the overall bandwidth of the observation.
void resize(unsigned npol=0, unsigned nchan=0, unsigned nbin=0)
Set the dimensions of the data container.
Definition: IntegrationExpert.h:61
Models a pulse profile using multiple components.
Definition: ComponentModel.h:34
std::string get_filename() const
Get the name of the file to which the archive will be unloaded.
Definition: Archive.h:108
Plot * construct(std::string name)
Return a new instance of the named plot.
Definition: PlotFactory.C:169
void set(Archive *data)
set the current Archive
Definition: Interpreter.C:441
Defines the PSRCHIVE library.
Definition: CalSource.h:17
Manages arrival time estimation.
Definition: ArrivalTime.h:40
Provides a text interface to create new plots.
Definition: PlotFactory.h:27
void unload(const char *filename=0) const
Write the archive to filename.
Definition: Archive_unload.C:36
virtual double get_folding_period() const =0
Get the folding or topocentric pulsar period (in seconds)
Stores information about the reference source (ATNF)
Definition: CalInfoExtension.h:28
virtual unsigned get_nbin() const =0
Get the number of pulsar phase bins used.
void uniform_weight(float new_weight=1.0)
Set the weight of each profile to the given number.
Definition: Integration.C:706
Base class of all plotters.
Definition: Plot.h:28
void sum(const Profile *profile)
add profile to this
Definition: Profile.C:336
Pulsar data processing command language interpreter.
Definition: Interpreter.h:57

Generated using doxygen 1.8.17