Skip to content

Commit 7cd950b

Browse files
authored
Merge pull request #49 from AUAS-Pulsar/dedisp_documentation
Dedispersion documentation
2 parents cb9a638 + 48d0207 commit 7cd950b

File tree

4 files changed

+102
-14
lines changed

4 files changed

+102
-14
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,18 @@ Creating a free and open source framework that contains the generic algorithms a
4848
2. [Filter samples](docs/clipping.md#62-filter-samples)
4949
3. [Filter channels](docs/clipping.md#63-filter-channels)
5050
4. [Filter individual channels](docs/clipping.md#64-filter-individual-channels)
51-
7. [Pipeline](docs/pipeline.md)
51+
7. [Dedispersion](docs/dedispersion.md)
52+
1. [Dedisperse](docs/dedispersion.md#72-Dedisperse)
53+
2. [Find dispersion measure](docs/dedispersion.md#73-find_dm)
54+
3. [Find line](docs/dedispersion.md#74-find_line)
55+
4. [Find estimation intensity](docs/dedispersion.md#75-find_estimation_intensity)
56+
8. [Pipeline](docs/pipeline.md)
5257
1. [Introduction](docs/pipeline.md#71-introduction)
5358
2. [Read rows](docs/pipeline.md#72-read-rows)
5459
3. [Read n rows](docs/pipeline.md#73-read-n-rows)
5560
3. [Read static](docs/pipeline.md#74-read-static)
5661
4. [Measure methods](docs/pipeline.md#75-measure-methods)
57-
8. [Generating mock data](docs/generate.md)
62+
9. [Generating mock data](docs/generate.md)
5863
1. [Creating a filterbank file](docs/generate.md#81-creating-a-filterbank-file)
5964
2. [Generate signal](docs/generate.md#82-generate-signal)
6065
3. [Generate header](docs/generate.md#83-generate-header)

docs/dedispersion.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# 7. Dedispersion
2+
3+
## 7.1 Introduction
4+
5+
- Pulsars produce a narrow beam of electromagnetic
6+
radiation which rotates like a lighthouse beam, so
7+
a pulse is seen as it sweeps over a radiotelescope.
8+
The signal is spread over a wide frequency range.
9+
10+
- If space was an empty vacuum, all the signals would
11+
travel at the same speed, but due to free electrons
12+
different frequencies travel at slightly different speeds
13+
(dispersion).
14+
15+
## 7.2 Dedisperse
16+
17+
This method performs dedispersion on the filterbank data.
18+
19+
### 7.2.1 Parameters
20+
21+
| Parameters | Description |
22+
|---|---|
23+
| Samples | Array or sequence containing the data to be plotted. |
24+
| DM | Dispersion measure (cm<sup>-3</sup> pc) |
25+
26+
### 7.2.2 Returns
27+
28+
| Variable | Description |
29+
|---|---|
30+
| Samples | Dedispersed samples |
31+
32+
## 7.3 find_dm
33+
34+
This method finds the dispersion measure.
35+
36+
### 7.3.1 Parameters
37+
38+
| Parameters | Description |
39+
|---|---|
40+
| Samples | 1-D array or sequence. Array or sequence containing the data to be plotted. |
41+
42+
### 7.3.2 Returns
43+
44+
| Variable | Description |
45+
|---|---|
46+
| dm | Dispersion measure |
47+
48+
## 7.4 find_line
49+
50+
This method finds a line starting from the sample index given in the parameters. This will stop if there isn't a intensity within the max_delay higher than the average_intensity.
51+
52+
### 7.4.1 Parameters
53+
54+
| Parameters | Description |
55+
|---|---|
56+
| Samples | 1-D array or sequence. Array or sequence containing the data to be plotted. |
57+
| start_sample_index | The start sample index |
58+
| max_delay | The max delay of the recieved signal |
59+
| average_intensity | The average intensity |
60+
61+
### 7.4.2 Returns
62+
63+
| Variable | Description |
64+
|---|---|
65+
| start_sample_index | The first frequency |
66+
| previous_sample_index | The higher frequency |
67+
68+
## 7.5 find_estimation_intensity
69+
70+
This method finds the average intensity for top x intensities.
71+
The `average_intensity` is considered a requirement for intensities to be considered a pulsar.
72+
73+
### 7.5.1 Parameters
74+
75+
| Parameters | Description |
76+
|---|---|
77+
| Samples | Array or sequence containing the data to be plotted. |
78+
79+
### 7.5.2 Returns
80+
81+
| Variable | Description |
82+
|---|---|
83+
| average_intensity | The avarage intesity |

docs/generate.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# 8. Generating mock data
1+
# 9. Generating mock data
22

3-
## 8.1 Creating a filterbank file
3+
## 9.1 Creating a filterbank file
44

55
To generate a filterbank file you may use the following example code:
66
```python
@@ -25,7 +25,7 @@ header.generate_file("file_path/file_name", header)
2525

2626
The header data is passed in a header dict. For a more detailed explanation on the file header, please consult [chapter 2.2](docs/filterbank.md#22-read-the-header-from-filterbank-data).
2727

28-
## 8.2 Generate signal
28+
## 9.2 Generate signal
2929

3030
The generate_signal method generates a mock signal based on the following parameters:
3131

@@ -36,15 +36,15 @@ The generate_signal method generates a mock signal based on the following parame
3636
| t_obs | observation time in s |
3737
| n_pts | intervals between samples |
3838

39-
## 8.3 Generate header
39+
## 9.3 Generate header
4040

4141
The generate_header method generates a header string based on the header dict provided in the example in chapter 8.1. The dict provides keys encoded in bytes and the method converts each keyword to a string using the keyword_to_string method (see below).
4242

43-
## 8.4 Keyword to string
43+
## 9.4 Keyword to string
4444

4545
The keyword_to_string method converts a keyword from the header dict to a serialized string.
4646

47-
## 8.5 Write data
47+
## 9.5 Write data
4848

4949
Once all the required data is generated to a filterbank file. The data is written to the file as bytes.
5050

docs/pipeline.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# 7. Pipeline
1+
# 8. Pipeline
22

3-
## 7.1 Introduction
3+
## 8.1 Introduction
44

55
The Pipeline module is used to execute the different modules in a specific order.
66
There are currently three different options for running the pipeline.
@@ -23,15 +23,15 @@ The constructor of the pipeline module will recognize which method is fit for ru
2323

2424
After deciding which method to run for running the filterbank in a pipeline, it will measure the time it takes to run each method using `measure_method`. After running all the different methods, the constructor will append the results (a dictionary) to a txt file.
2525

26-
## 7.2 Read rows
26+
## 8.2 Read rows
2727

2828
The `read_rows` method reads the Filterbank data row per row. Because it only reads the filterbank per row, it is unable to execute most methods. The alternative for this method is the `read_n_rows` method, which is able to run all methods.
2929

3030
```
3131
pipeline.Pipeline(<filterbank_file>, as_stream=True)
3232
```
3333

34-
## 7.3 Read n rows
34+
## 8.3 Read n rows
3535

3636
The `read_n_rows` method first splits all the filterbank data into chunks of n samples. After splitting the filterbank data in chunks, it will run the different modules of the pipeline for each chunk. The remaining data, that which does not fit into the sample size, is currently ignored.
3737

@@ -41,15 +41,15 @@ The `n` or sample size should be a power of 2 multiplied with the given scale fo
4141
pipeline.Pipeline(<filterbank_file>, n=<size> , as_stream=True)
4242
```
4343

44-
## 7.4 Read static
44+
## 8.4 Read static
4545

4646
The `read_static` method reads the entire filterbank at once, and applies each method to the entire dataset. If the filterbank file is too large for running it in-memory, the alternative is using `read_n_rows`.
4747

4848
```
4949
pipeline.Pipeline(<filterbank_file>)
5050
```
5151

52-
## 7.5 Measure methods
52+
## 8.5 Measure methods
5353

5454
The `measure_methods` is ran for each of the above methods, and calculates the time it takes to run each of the different methods. For each method it will create a key using the name of the method, and save the time it took to run the method as a value.
5555
At the end, it will returns a dictionary with all the keys and values.

0 commit comments

Comments
 (0)