Skip to content

Commit

Permalink
Added ability to ignore channels in raw data files (-ignorechan)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottransom committed Jun 3, 2017
1 parent 6d23e56 commit 2fade8e
Show file tree
Hide file tree
Showing 34 changed files with 6,000 additions and 5,972 deletions.
1 change: 1 addition & 0 deletions clig/mpiprepsubband_cmd.cli
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Int -nsub nsub {The number of sub-bands to use} \
Int -downsamp downsamp {The number of neighboring bins to co-add} \
-r 1 128 -d 1
String -mask maskfile {File containing masking information to use}
String -ignorechan ignorechanstr {Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step]}

# Rest of command line:

Expand Down
7 changes: 6 additions & 1 deletion clig/prepdata.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 "prepdata" 1 "17Mar15" "Clig-manuals" "Programmer's Manual"
.TH "prepdata" 1 "03Jun17" "Clig-manuals" "Programmer's Manual"
.\" cligPart TITLE end

.\" cligPart NAME
Expand Down Expand Up @@ -47,6 +47,7 @@ prepdata \- Prepares a raw data file for pulsar searching or folding (conversion
[-shorts]
[-dm dm]
[-mask maskfile]
[-ignorechan ignorechanstr]
infile ...
.\" cligPart SYNOPSIS end

Expand Down Expand Up @@ -130,6 +131,10 @@ Default: `0'
File containing masking information to use,
.br
1 String value
.IP -ignorechan
Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step],
.br
1 String value
.IP infile
Input data file name. If the data is not in a known raw format, it should be a single channel of single-precision floating point data. In this case a '.inf' file with the same root filename must also exist (Note that this means that the input data file must have a suffix that starts with a period).
.\" cligPart OPTIONS end
Expand Down
1 change: 1 addition & 0 deletions clig/prepdata_cmd.cli
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Flag -shorts shorts {Use short ints for the output data instead of floats}
Double -dm dm {The dispersion measure to de-disperse (cm^-3 pc)} \
-r 0 oo -d 0
String -mask maskfile {File containing masking information to use}
String -ignorechan ignorechanstr {Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step]}

# Rest of command line:

Expand Down
7 changes: 6 additions & 1 deletion clig/prepfold.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 "prepfold" 1 "21Apr15" "Clig-manuals" "Programmer's Manual"
.TH "prepfold" 1 "03Jun17" "Clig-manuals" "Programmer's Manual"
.\" cligPart TITLE end

.\" cligPart NAME
Expand Down Expand Up @@ -95,6 +95,7 @@ prepfold \- Prepares (if required) and folds raw radio data, standard time serie
[-w w]
[-wdot wdot]
[-mask maskfile]
[-ignorechan ignorechanstr]
[-events]
[-days]
[-mjds]
Expand Down Expand Up @@ -373,6 +374,10 @@ Default: `0'
File containing masking information to use,
.br
1 String value
.IP -ignorechan
Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step],
.br
1 String value
.IP -events
Use a event file instead of a time series (.dat) file.
.IP -days
Expand Down
2 changes: 2 additions & 0 deletions clig/prepfold_cmd.cli
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ Double -wdot wdot {Rate of advance of periastron (deg/yr)} \

String -mask maskfile {File containing masking information to use}

String -ignorechan ignorechanstr {Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step]}

# Parameters if we are using events instead of a timeseries

Flag -events events {Use a event file instead of a time series (.dat) file}
Expand Down
7 changes: 6 additions & 1 deletion clig/prepsubband.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 "prepsubband" 1 "17Mar15" "Clig-manuals" "Programmer's Manual"
.TH "prepsubband" 1 "03Jun17" "Clig-manuals" "Programmer's Manual"
.\" cligPart TITLE end

.\" cligPart NAME
Expand Down Expand Up @@ -53,6 +53,7 @@ prepsubband \- Converts a raw radio data file into many de-dispersed time-series
[-downsamp downsamp]
[-dmprec dmprec]
[-mask maskfile]
[-ignorechan ignorechanstr]
infile ...
.\" cligPart SYNOPSIS end

Expand Down Expand Up @@ -168,6 +169,10 @@ Default: `2'
File containing masking information to use,
.br
1 String value
.IP -ignorechan
Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step],
.br
1 String value
.IP infile
Input data file name. If the data is not in a known raw format, it should be a single channel of single-precision floating point data. In this case a '.inf' file with the same root filename must also exist (Note that this means that the input data file must have a suffix that starts with a period).
.\" cligPart OPTIONS end
Expand Down
1 change: 1 addition & 0 deletions clig/prepsubband_cmd.cli
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Int -downsamp downsamp {The number of neighboring bins to co-add} \
Int -dmprec dmprec {The number of decimals in the precision of the DM in the filename.} \
-r 2 4 -d 2
String -mask maskfile {File containing masking information to use}
String -ignorechan ignorechanstr {Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step]}

# Rest of command line:

Expand Down
11 changes: 8 additions & 3 deletions clig/rfifind.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 "rfifind" 1 "17Mar15" "Clig-manuals" "Programmer's Manual"
.TH "rfifind" 1 "03Jun17" "Clig-manuals" "Programmer's Manual"
.\" cligPart TITLE end

.\" cligPart NAME
Expand Down Expand Up @@ -54,6 +54,7 @@ rfifind \- Examines radio data for narrow and wide band interference as well as
[-zapchan zapchanstr]
[-zapints zapintsstr]
[-mask maskfile]
[-ignorechan ignorechanstr]
infile ...
.\" cligPart SYNOPSIS end

Expand Down Expand Up @@ -156,17 +157,21 @@ The fraction of bad intervals that will mask a full channel,
.br
Default: `0.3'
.IP -zapchan
Comma separated string (no spaces!) of channels to explicitly remove from analysis (zero-offset). Ranges are specified by min:max[:step],
Comma separated string (no spaces!) of channels to explicitly mask. Ranges are specified by min:max[:step],
.br
1 String value
.IP -zapints
Comma separated string (no spaces!) of intervals to explicitly remove from analysis (zero-offset). Ranges are specified by min:max[:step],
Comma separated string (no spaces!) of intervals to explicitly mask. Ranges are specified by min:max[:step],
.br
1 String value
.IP -mask
File containing masking information to use,
.br
1 String value
.IP -ignorechan
Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step],
.br
1 String value
.IP infile
Input data file name(s)..
.\" cligPart OPTIONS end
Expand Down
5 changes: 3 additions & 2 deletions clig/rfifind_cmd.cli
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ Float -chanfrac chantrigfrac {The fraction of bad channels that will mask a ful
-r 0.0 1.0 -d 0.7
Float -intfrac inttrigfrac {The fraction of bad intervals that will mask a full channel} \
-r 0.0 1.0 -d 0.3
String -zapchan zapchanstr {Comma separated string (no spaces!) of channels to explicitly remove from analysis (zero-offset). Ranges are specified by min:max[:step]}
String -zapints zapintsstr {Comma separated string (no spaces!) of intervals to explicitly remove from analysis (zero-offset). Ranges are specified by min:max[:step]}
String -zapchan zapchanstr {Comma separated string (no spaces!) of channels to explicitly mask. Ranges are specified by min:max[:step]}
String -zapints zapintsstr {Comma separated string (no spaces!) of intervals to explicitly mask. Ranges are specified by min:max[:step]}
String -mask maskfile {File containing masking information to use}
String -ignorechan ignorechanstr {Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step]}

# Rest of command line:

Expand Down
2 changes: 1 addition & 1 deletion clig/show_pfd.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 "show_pfd" 1 "03Apr14" "Clig-manuals" "Programmer's Manual"
.TH "show_pfd" 1 "03Jun17" "Clig-manuals" "Programmer's Manual"
.\" cligPart TITLE end

.\" cligPart NAME
Expand Down
7 changes: 6 additions & 1 deletion docs/prepdata.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 "prepdata" 1 "17Mar15" "Clig-manuals" "Programmer's Manual"
.TH "prepdata" 1 "03Jun17" "Clig-manuals" "Programmer's Manual"
.\" cligPart TITLE end

.\" cligPart NAME
Expand Down Expand Up @@ -47,6 +47,7 @@ prepdata \- Prepares a raw data file for pulsar searching or folding (conversion
[-shorts]
[-dm dm]
[-mask maskfile]
[-ignorechan ignorechanstr]
infile ...
.\" cligPart SYNOPSIS end

Expand Down Expand Up @@ -130,6 +131,10 @@ Default: `0'
File containing masking information to use,
.br
1 String value
.IP -ignorechan
Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step],
.br
1 String value
.IP infile
Input data file name. If the data is not in a known raw format, it should be a single channel of single-precision floating point data. In this case a '.inf' file with the same root filename must also exist (Note that this means that the input data file must have a suffix that starts with a period).
.\" cligPart OPTIONS end
Expand Down
7 changes: 6 additions & 1 deletion docs/prepfold.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 "prepfold" 1 "21Apr15" "Clig-manuals" "Programmer's Manual"
.TH "prepfold" 1 "03Jun17" "Clig-manuals" "Programmer's Manual"
.\" cligPart TITLE end

.\" cligPart NAME
Expand Down Expand Up @@ -95,6 +95,7 @@ prepfold \- Prepares (if required) and folds raw radio data, standard time serie
[-w w]
[-wdot wdot]
[-mask maskfile]
[-ignorechan ignorechanstr]
[-events]
[-days]
[-mjds]
Expand Down Expand Up @@ -373,6 +374,10 @@ Default: `0'
File containing masking information to use,
.br
1 String value
.IP -ignorechan
Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step],
.br
1 String value
.IP -events
Use a event file instead of a time series (.dat) file.
.IP -days
Expand Down
7 changes: 6 additions & 1 deletion docs/prepsubband.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 "prepsubband" 1 "17Mar15" "Clig-manuals" "Programmer's Manual"
.TH "prepsubband" 1 "03Jun17" "Clig-manuals" "Programmer's Manual"
.\" cligPart TITLE end

.\" cligPart NAME
Expand Down Expand Up @@ -53,6 +53,7 @@ prepsubband \- Converts a raw radio data file into many de-dispersed time-series
[-downsamp downsamp]
[-dmprec dmprec]
[-mask maskfile]
[-ignorechan ignorechanstr]
infile ...
.\" cligPart SYNOPSIS end

Expand Down Expand Up @@ -168,6 +169,10 @@ Default: `2'
File containing masking information to use,
.br
1 String value
.IP -ignorechan
Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step],
.br
1 String value
.IP infile
Input data file name. If the data is not in a known raw format, it should be a single channel of single-precision floating point data. In this case a '.inf' file with the same root filename must also exist (Note that this means that the input data file must have a suffix that starts with a period).
.\" cligPart OPTIONS end
Expand Down
11 changes: 8 additions & 3 deletions docs/rfifind.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 "rfifind" 1 "17Mar15" "Clig-manuals" "Programmer's Manual"
.TH "rfifind" 1 "03Jun17" "Clig-manuals" "Programmer's Manual"
.\" cligPart TITLE end

.\" cligPart NAME
Expand Down Expand Up @@ -54,6 +54,7 @@ rfifind \- Examines radio data for narrow and wide band interference as well as
[-zapchan zapchanstr]
[-zapints zapintsstr]
[-mask maskfile]
[-ignorechan ignorechanstr]
infile ...
.\" cligPart SYNOPSIS end

Expand Down Expand Up @@ -156,17 +157,21 @@ The fraction of bad intervals that will mask a full channel,
.br
Default: `0.3'
.IP -zapchan
Comma separated string (no spaces!) of channels to explicitly remove from analysis (zero-offset). Ranges are specified by min:max[:step],
Comma separated string (no spaces!) of channels to explicitly mask. Ranges are specified by min:max[:step],
.br
1 String value
.IP -zapints
Comma separated string (no spaces!) of intervals to explicitly remove from analysis (zero-offset). Ranges are specified by min:max[:step],
Comma separated string (no spaces!) of intervals to explicitly mask. Ranges are specified by min:max[:step],
.br
1 String value
.IP -mask
File containing masking information to use,
.br
1 String value
.IP -ignorechan
Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step],
.br
1 String value
.IP infile
Input data file name(s)..
.\" cligPart OPTIONS end
Expand Down
2 changes: 1 addition & 1 deletion docs/show_pfd.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 "show_pfd" 1 "03Apr14" "Clig-manuals" "Programmer's Manual"
.TH "show_pfd" 1 "03Jun17" "Clig-manuals" "Programmer's Manual"
.\" cligPart TITLE end

.\" cligPart NAME
Expand Down
12 changes: 8 additions & 4 deletions include/backend_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,22 @@ struct spectra_info {
int remove_zerodm; // Do zero-DM substraction?
int use_poln; // The number of the specific polarization to use 0-num_polns-1
int flip_bytes; // Hack to flip the order of the bits in a byte of data
int num_ignorechans; // Number of channels to explicitly ignore (set to zero)
float zero_offset; // A DC zero-offset value to apply to all the data
float clip_sigma; // Clipping value in standard deviations to use
long double *start_MJD; // Array of long double MJDs for the file starts
char **filenames; // Array of the input file names
FILE **files; // Array of normal file pointers if needed
fitsfile **fitsfiles; // Array of FITS file pointers if needed
fitsfile **fitsfiles; // Array of FITS file pointers if needed
float *padvals; // Array of length num_channels for current padding values
int *header_offset; // Number of bytes to skip in each file to get to spectra
int *start_subint; // Starting ISUBINT in each file (for PSRFITS)
int *num_subint; // Number of subints per file
long long *start_spec; // Starting spectra for each file (zero offset)
long long *num_spec; // Number of spectra per file
long long *num_pad; // Number of padding samples after each file
int *ignorechans; // Array of channels to explicitly ignore (set to zero)
char *ignorechans_str; // String describing the ignorechans
long long *start_spec; // Starting spectra for each file (zero offset)
long long *num_spec; // Number of spectra per file
long long *num_pad; // Number of padding samples after each file
int (*get_rawblock)(float *, struct spectra_info *, int *); // Raw data block function pointer
long long (*offset_to_spectra)(long long, struct spectra_info *); // Shift into file(s) function pointer
};
Expand All @@ -101,6 +104,7 @@ void get_channel(float chandat[], int channum, int numsubints, float rawdata[],
int prep_subbands(float *fdata, float *rawdata, int *delays, int numsubbands, struct spectra_info *s, int transpose, int *maskchans, int *nummasked, mask *obsmask);
int read_subbands(float *fdata, int *delays, int numsubbands, struct spectra_info *s, int transpose, int *padding, int *maskchans, int *nummasked, mask *obsmask);
void flip_band(float *fdata, struct spectra_info *s);
int *get_ignorechans(char *ignorechans_str, int minchan, int maxchan, int *num_ignorechans, char **filestr);

/* zerodm.c */
void remove_zerodm(float *fdata, struct spectra_info *s);
4 changes: 4 additions & 0 deletions include/prepdata_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ typedef struct s_Cmdline {
char maskfileP;
char* maskfile;
int maskfileC;
/***** -ignorechan: Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step] */
char ignorechanstrP;
char* ignorechanstr;
int ignorechanstrC;
/***** uninterpreted command line parameters */
int argc;
/*@null*/char **argv;
Expand Down
4 changes: 4 additions & 0 deletions include/prepfold_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ typedef struct s_Cmdline {
char maskfileP;
char* maskfile;
int maskfileC;
/***** -ignorechan: Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step] */
char ignorechanstrP;
char* ignorechanstr;
int ignorechanstrC;
/***** -events: Use a event file instead of a time series (.dat) file */
char eventsP;
/***** -days: Events are in days since the EPOCH in the '.inf' file (default is seconds) */
Expand Down
4 changes: 4 additions & 0 deletions include/prepsubband_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ typedef struct s_Cmdline {
char maskfileP;
char* maskfile;
int maskfileC;
/***** -ignorechan: Comma separated string (no spaces!) of channels to ignore (or file containing such string). Ranges are specified by min:max[:step] */
char ignorechanstrP;
char* ignorechanstr;
int ignorechanstrC;
/***** uninterpreted command line parameters */
int argc;
/*@null*/char **argv;
Expand Down
Loading

0 comments on commit 2fade8e

Please sign in to comment.