public:user_software:cr-tools:datareader

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
public:user_software:cr-tools:datareader [2011-10-18 12:08] Lars Bahrenpublic:user_software:cr-tools:datareader [2017-03-08 15:27] (current) – external edit 127.0.0.1
Line 9: Line 9:
     * [[#Performance]]     * [[#Performance]]
   * [[#Development]]   * [[#Development]]
 +  * [[#Usage with C/C++ code]]
  
 ==== Overview ==== ==== Overview ====
Line 163: Line 164:
 {{datareader_init_sequence.png?550}} {{datareader_init_sequence.png?550}}
  
-===== Usage =====+==== Usage with C/C++ code ====
  
-==== ... with C/C++ code ==== +  - Creation of a new DataReader object: <code cpp>
- +
-=== Usage within an application === +
- +
-<code cpp>+
 #include <lopes/IO/DataReader.h> #include <lopes/IO/DataReader.h>
 #include <lopes/Data/LopesEvent.h> #include <lopes/Data/LopesEvent.h>
Line 176: Line 173:
 LopesEvent *le = new LopesEvent (eventfile,      // location the LopesEvent file LopesEvent *le = new LopesEvent (eventfile,      // location the LopesEvent file
                                  blocksize,      // nof. samples per block of data                                  blocksize,      // nof. samples per block of data
-                                 adc2voltage,    // conversion weights: ADC values to voltages [optional] +                                 adc2voltage,    // conversion weights [optional] 
-                                 fft2calfft);    // calibration weights: raw to calibrated FFT [optional]+                                 fft2calfft);    // calibration weights [optional]
 dr = le; dr = le;
- +</code> With the conversion arrays optional you can even use the simpler construction method: <code cpp> 
-// processing of the data+LopesEvent *le = new LopesEvent (eventfile,      // location the LopesEvent file 
 +                                 blocksize)      // nof. samples per block of data 
 +</code> 
 +  - Reading in data for processing: <code cpp>
 for (int block(0); block<nofBlocks; block++) { for (int block(0); block<nofBlocks; block++) {
   fft = dr->fft();   fft = dr->fft();
 } }
 </code> </code>
- +  - Data selectionSelection of frequency channels and antennas can be performed directly within the DataReader, e.g. <code cpp>
-With the conversion arrays optional you can even use the simpler construction method +
-<code cpp> +
-LopesEvent *le = new LopesEvent (eventfile,      // location the LopesEvent file +
-                                 blocksize)      // nof. samples per block of data +
-</code> +
- +
-=== Data selection === +
- +
-Selection of frequency channels and antennas can be performed directly within the DataReader, e.g.  +
-<code cpp>+
     dr->setSelectedChannels (selection);     dr->setSelectedChannels (selection);
-</code> +</code> where ''selection'' is an array of boolians of length ''fftLength''.
-where ''selection'' is an array of boolians of length ''fftLength''.+
  
 {{datareader_-_channel_selection.png?550|Selection of frequency channels in the FFT}} {{datareader_-_channel_selection.png?550|Selection of frequency channels in the FFT}}
- 
  
 \\ \\
 ---- ----
 <- [[public:user software:User Software]] • [[public:user software:CR-Tools]] <- [[public:user software:User Software]] • [[public:user software:CR-Tools]]
  • Last modified: 2011-10-18 12:08
  • by Lars Bahren