-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
""" | ||
Catalog of HFB test targets | ||
""" | ||
|
||
import os | ||
|
||
from .fluxcat import FluxCatalog | ||
|
||
# Define the source collection that should be loaded when this module is imported. | ||
HFB_COLLECTION = os.path.join( | ||
os.path.dirname(__file__), "catalogs", "hfb_target_list.json" | ||
) | ||
|
||
|
||
class HFBCatalog(FluxCatalog): | ||
""" | ||
Class for cataloguing HFB targets. | ||
Attributes | ||
---------- | ||
fields : list | ||
List of attributes that are read-from and written-to the | ||
JSON catalog files. | ||
""" | ||
|
||
fields = [ | ||
"ra", | ||
"dec", | ||
"alternate_names", | ||
"freq_abs", | ||
] | ||
|
||
def __init__( | ||
self, | ||
name, | ||
ra=None, | ||
dec=None, | ||
alternate_names=[], | ||
freq_abs=[], | ||
overwrite=0, | ||
): | ||
""" | ||
Instantiate an HFBCatalog object for an HFB target. | ||
Parameters | ||
---------- | ||
name : string | ||
Name of the source. | ||
ra : float | ||
Right Ascension in degrees. | ||
dec : float | ||
Declination in degrees. | ||
alternate_names : list of strings | ||
Alternate names for the source. | ||
freq_abs : list of floats | ||
Frequencies at which (the peaks of) absorption features are found. | ||
overwrite : int between 0 and 2 | ||
Action to take in the event that this source is already in the catalog: | ||
- 0 - Return the existing entry. | ||
- 1 - Add the measurements to the existing entry. | ||
- 2 - Overwrite the existing entry. | ||
Default is 0. | ||
BUG: Currently, `freq_abs` is always overwritten. | ||
""" | ||
|
||
super().__init__( | ||
name, | ||
ra=ra, | ||
dec=dec, | ||
alternate_names=alternate_names, | ||
overwrite=overwrite, | ||
) | ||
|
||
self.freq_abs = freq_abs | ||
|
||
|
||
# Load the HFB target list | ||
HFBCatalog.load(HFB_COLLECTION) |