pytorch_dedispersion.candidate_finder
CandidateFinder
Source code in pytorch_dedispersion/candidate_finder.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
__init__
__init__(boxcar_data, window_size=50)
Initialize CandidateFinder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
boxcar_data
|
Tensor
|
Boxcar filtered data. |
required |
window_size
|
int
|
Window size (in samples) for trend removal. Defaults to 50. |
50
|
Source code in pytorch_dedispersion/candidate_finder.py
6 7 8 9 10 11 12 13 14 15 | |
calculate_baseline
calculate_baseline(data)
Calculate the baseline using a moving average.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Tensor
|
The input data. |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
torch.Tensor: The baseline data. |
Source code in pytorch_dedispersion/candidate_finder.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
calculate_snr
calculate_snr(data)
Calculate the signal-to-noise ratio (SNR).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Tensor
|
The input data. |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
torch.Tensor: The SNR of the data. |
Source code in pytorch_dedispersion/candidate_finder.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
find_candidates
find_candidates(
snr_threshold, boxcar_widths, remove_trend=False
)
Find candidates based on SNR threshold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snr_threshold
|
float
|
SNR threshold for candidate detection. |
required |
boxcar_widths
|
list[int]
|
List of boxcar widths. |
required |
remove_trend
|
bool
|
Whether to remove trend from data. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
list[dict]: List of detected candidates. |
Source code in pytorch_dedispersion/candidate_finder.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |