Skip to content

Commit

Permalink
Fixed conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
scottransom committed Feb 14, 2018
2 parents b45a56a + 9ee2d26 commit 7ce6320
Show file tree
Hide file tree
Showing 28 changed files with 1,985 additions and 962 deletions.
7 changes: 6 additions & 1 deletion clig/accelsearch.1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
.\" it edited by clig, remove the respective pair of cligPart-lines.
.\"
.\" cligPart TITLE
.TH "accelsearch" 1 "07Dec16" "Clig-manuals" "Programmer's Manual"
.TH "accelsearch" 1 "19Sep17" "Clig-manuals" "Programmer's Manual"
.\" cligPart TITLE end

.\" cligPart NAME
Expand All @@ -26,6 +26,7 @@ accelsearch \- Search an FFT or short time series for pulsars using a Fourier do
[-lobin lobin]
[-numharm numharm]
[-zmax zmax]
[-wmax wmax]
[-sigma sigma]
[-rlo rlo]
[-rhi rhi]
Expand Down Expand Up @@ -69,6 +70,10 @@ The max (+ and -) Fourier freq deriv to search,
1 Int value between 0 and 1200.
.br
Default: `200'
.IP -wmax
The max (+ and -) Fourier freq double derivs to search,
.br
1 Int value between 0 and 4000.
.IP -sigma
Cutoff sigma for choosing candidates,
.br
Expand Down
2 changes: 2 additions & 0 deletions clig/accelsearch_cmd.cli
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Int -numharm numharm {The number of harmonics to sum (power-of-two)}\
-r 1 32 -d 8
Int -zmax zmax {The max (+ and -) Fourier freq deriv to search} \
-r 0 1200 -d 200
Int -wmax wmax {The max (+ and -) Fourier freq double derivs to search} \
-r 0 4000
Float -sigma sigma {Cutoff sigma for choosing candidates}\
-r 1.0 30.0 -d 2.0
Double -rlo rlo {The lowest Fourier frequency (of the highest harmonic!) to search} \
Expand Down
7 changes: 6 additions & 1 deletion docs/accelsearch.1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
.\" it edited by clig, remove the respective pair of cligPart-lines.
.\"
.\" cligPart TITLE
.TH "accelsearch" 1 "07Dec16" "Clig-manuals" "Programmer's Manual"
.TH "accelsearch" 1 "19Sep17" "Clig-manuals" "Programmer's Manual"
.\" cligPart TITLE end

.\" cligPart NAME
Expand All @@ -26,6 +26,7 @@ accelsearch \- Search an FFT or short time series for pulsars using a Fourier do
[-lobin lobin]
[-numharm numharm]
[-zmax zmax]
[-wmax wmax]
[-sigma sigma]
[-rlo rlo]
[-rhi rhi]
Expand Down Expand Up @@ -69,6 +70,10 @@ The max (+ and -) Fourier freq deriv to search,
1 Int value between 0 and 1200.
.br
Default: `200'
.IP -wmax
The max (+ and -) Fourier freq double derivs to search,
.br
1 Int value between 0 and 4000.
.IP -sigma
Cutoff sigma for choosing candidates,
.br
Expand Down
152 changes: 85 additions & 67 deletions include/accel.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,94 +25,112 @@
#define ACCEL_DZ 2
/* Reciprocal of ACCEL_DZ */
#define ACCEL_RDZ 0.5
/* Stepsize in Fourier F-dot-dot */
#define ACCEL_DW 20
/* Reciprocal of ACCEL_DW */
#define ACCEL_RDW 0.05
/* Closest candidates we will accept as independent */
#define ACCEL_CLOSEST_R 15.0
/* Padding for .dat file reading so that we don't SEGFAULT */
#define ACCEL_PADDING 2000

typedef struct accelobs{
long long N; /* Number of data points in observation */
long long numbins; /* Number of spectral bins in the file */
long long lobin; /* Lowest spectral bin present in the file */
long long highestbin;/* Highest spectral bin present in the file */
int fftlen; /* Length of short FFTs to us in search */
int numharmstages; /* Number of stages of harmonic summing */
int numz; /* Number of f-dots searched */
int numbetween; /* Highest fourier freq resolution (2=interbin) */
int numzap; /* Number of birdies to zap */
int dat_input; /* The input file is a short time series */
int mmap_file; /* The file number if using MMAP */
int inmem; /* True if we want to keep the full f/fdot plan in RAM */
int norm_type; /* 0 = old-style block median, 1 = local-means power norm */
double dt; /* Data sample length (s) */
double T; /* Total observation length */
double rlo; /* Minimum fourier freq to search */
double rhi; /* Maximum fourier freq to search */
double dr; /* Stepsize in fourier freq (1/numbetween) */
double zlo; /* Minimum fourier fdot to search */
double zhi; /* Maximum fourier fdot to search */
double dz; /* Stepsize in fourier fdot */
double baryv; /* Average barycentric velocity during observation */
float nph; /* Freq 0 level if requested, 0 otherwise */
float sigma; /* Cutoff sigma to choose a candidate */
float *powcut; /* Cutoff powers to choose a cand (per harmsummed) */
float *ffdotplane; /* The full F-Fdot plane if working in memory */
double *lobins; /* The low Fourier freq boundaries to zap (RFI) */
double *hibins; /* The high Fourier freq boundaries to zap (RFI) */
long long *numindep; /* Number of independent spectra (per harmsummed) */
FILE *fftfile; /* The FFT file that we are analyzing */
FILE *workfile; /* A text file with candidates as they are found */
fcomplex *fft; /* A pointer to the FFT for MMAPing or input time series */
char *rootfilenm; /* The root filename for associated files. */
char *candnm; /* The fourierprop save file for the fundamentals */
char *accelnm; /* The filename of the final candidates in text */
char *workfilenm; /* The filename of the working candidates in text */
int use_harmonic_polishing; /* Should we force harmonics to be related */
long long N; /* Number of data points in observation */
long long numbins; /* Number of spectral bins in the file */
long long lobin; /* Lowest spectral bin present in the file */
long long highestbin;/* Highest spectral bin present in the file */
int maxkernlen; /* Maximum full width (in points, not Fourier bins) of corr kernels */
int corr_uselen; /* Number of good data points we will get from high-harm correlations */
int fftlen; /* Length of short FFTs to us in search */
int numharmstages; /* Number of stages of harmonic summing */
int numz; /* Number of f-dots searched */
int numw; /* Number of f-dot-dots searched */
int numbetween; /* Highest fourier freq resolution (2=interbin) */
int numzap; /* Number of birdies to zap */
int dat_input; /* The input file is a short time series */
int mmap_file; /* The file number if using MMAP */
int inmem; /* True if we want to keep the full f-fdot plane in RAM */
int norm_type; /* 0 = old-style block median, 1 = local-means power norm */
double dt; /* Data sample length (s) */
double T; /* Total observation length */
double rlo; /* Minimum fourier freq to search */
double rhi; /* Maximum fourier freq to search */
double dr; /* Stepsize in fourier freq (1/numbetween) */
double zlo; /* Minimum fourier fdot to search */
double zhi; /* Maximum fourier fdot to search */
double dz; /* Stepsize in fourier fdot */
double wlo; /* Minimum fourier f-dot-dot to search */
double whi; /* Maximum fourier f-dot-dot to search */
double dw; /* Stepsize in fourier f-dot-dot */
double baryv; /* Average barycentric velocity during observation */
float nph; /* Freq 0 level if requested, 0 otherwise */
float sigma; /* Cutoff sigma to choose a candidate */
float *powcut; /* Cutoff powers to choose a cand (per harmsummed) */
float *ffdotplane; /* The full f-fdot-fdotdot plane if working in memory */
double *lobins; /* The low Fourier freq boundaries to zap (RFI) */
double *hibins; /* The high Fourier freq boundaries to zap (RFI) */
long long *numindep; /* Number of independent spectra (per harmsummed) */
FILE *fftfile; /* The FFT file that we are analyzing */
FILE *workfile; /* A text file with candidates as they are found */
fcomplex *fft; /* A pointer to the FFT for MMAPing or input time series */
char *rootfilenm; /* The root filename for associated files. */
char *candnm; /* The fourierprop save file for the fundamentals */
char *accelnm; /* The filename of the final candidates in text */
char *workfilenm; /* The filename of the working candidates in text */
int use_harmonic_polishing; /* Should we force harmonics to be related */
} accelobs;

typedef struct accelcand{
float power; /* Summed power level (normalized) */
float sigma; /* Equivalent sigma based on numindep (above) */
int numharm; /* Number of harmonics summed */
double r; /* Fourier freq of first harmonic */
double z; /* Fourier f-dot of first harmonic */
double *pows; /* Optimized powers for the harmonics */
double *hirs; /* Optimized freqs for the harmonics */
double *hizs; /* Optimized fdots for the harmonics */
rderivs *derivs; /* An rderivs structure for each harmonic */
float power; /* Summed power level (normalized) */
float sigma; /* Equivalent sigma based on numindep (above) */
int numharm; /* Number of harmonics summed */
double r; /* Fourier freq of first harmonic */
double z; /* Fourier f-dot of first harmonic */
double w; /* Fourier f-dot-dot of first harmonic */
double *pows; /* Optimized powers for the harmonics */
double *hirs; /* Optimized freqs for the harmonics */
double *hizs; /* Optimized f-dots for the harmonics */
double *hiws; /* Optimized f-dot-dots for the harmonics */
rderivs *derivs; /* An rderivs structure for each harmonic */
} accelcand;

typedef struct kernel{
int z; /* The fourier f-dot of the kernel */
int fftlen; /* Number of complex points in the kernel */
int numgoodbins; /* The number of good points you can get back */
int numbetween; /* Fourier freq resolution (2=interbin) */
int kern_half_width; /* Half width (bins) of the raw kernel. */
fcomplex *data; /* The FFTd kernel itself */
int z; /* The fourier f-dot of the kernel */
int w; /* The fourier f-dot-dot of the kernel */
int fftlen; /* Number of complex points in the kernel */
int numgoodbins; /* The number of good points you can get back */
int numbetween; /* Fourier freq resolution (2=interbin) */
int kern_half_width; /* Half width (bins) of the raw kernel. */
fcomplex *data; /* The FFTd kernel itself */
} kernel;

typedef struct subharminfo{
int numharm; /* The number of sub-harmonics */
int harmnum; /* The sub-harmonic number (fundamental = numharm) */
int zmax; /* The maximum Fourier f-dot for this harmonic */
int numkern; /* Number of kernels in the vector */
kernel *kern; /* The kernels themselves */
unsigned short *rinds; /* Table of indices for Fourier Freqs */
int numharm; /* The number of sub-harmonics */
int harmnum; /* The sub-harmonic number (fundamental = numharm) */
int zmax; /* The maximum Fourier f-dot for this harmonic */
int wmax; /* The maximum Fourier f-dot-dot for this harmonic */
int numkern_zdim; /* Number of kernels calculated in the z dimension */
int numkern_wdim; /* Number of kernels calculated in the w dimension */
int numkern; /* Total number of kernels in the vector */
kernel **kern; /* A 2D array of the kernels themselves, with dimensions of z and w */
unsigned short *rinds; /* Table of lookup indices for Fourier Freqs: subharmonic r values corresponding to "fundamental" r values */
unsigned short *zinds; /* Table of lookup indices for Fourier F-dots */
} subharminfo;

typedef struct ffdotpows{
int numrs; /* Number of Fourier freqs present */
int numzs; /* Number of Fourier f-dots present */
int rlo; /* Lowest Fourier freq present */
int zlo; /* Lowest Fourier f-dot present */
float **powers; /* Matrix of the powers */
unsigned short *rinds; /* Table of indices for Fourier Freqs */
long long rlo; /* Lowest Fourier freq present */
int zlo; /* Lowest Fourier f-dot present */
int wlo; /* Lowest Fourier f-dot-dot present */
int numrs; /* Number of Fourier freqs present */
int numzs; /* Number of Fourier f-dots present */
int numws; /* Number of Fourier f-dot-dots present */
float ***powers; /* 3D Matrix of the powers */
unsigned short *rinds; /* Table of lookup indices for Fourier Freqs */
unsigned short *zinds; /* Table of lookup indices for Fourier f-dots */
} ffdotpows;

/* accel_utils.c */

/* accel_utils.c */

subharminfo **create_subharminfos(accelobs *obs);
void free_subharminfos(accelobs *obs, subharminfo **shis);
void create_accelobs(accelobs *obs, infodata *idata,
Expand All @@ -127,7 +145,7 @@ void output_harmonics(GSList *list, accelobs *obs, infodata *idata);
void free_accelcand(gpointer data, gpointer user_data);
void print_accelcand(gpointer data, gpointer user_data);
fcomplex *get_fourier_amplitudes(long long lobin, int numbins, accelobs *obs);
ffdotpows *subharm_ffdot_plane(int numharm, int harmnum,
ffdotpows *subharm_fderivs_vol(int numharm, int harmnum,
double fullrlo, double fullrhi,
subharminfo *shi, accelobs *obs);
ffdotpows *copy_ffdotpows(ffdotpows *orig);
Expand Down
4 changes: 4 additions & 0 deletions include/accelsearch_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ typedef struct s_Cmdline {
char zmaxP;
int zmax;
int zmaxC;
/***** -wmax: The max (+ and -) Fourier freq double derivs to search */
char wmaxP;
int wmax;
int wmaxC;
/***** -sigma: Cutoff sigma for choosing candidates */
char sigmaP;
float sigma;
Expand Down
Loading

0 comments on commit 7ce6320

Please sign in to comment.