Skip to content

Commit

Permalink
further tidy up standard stars folder, included (ra, dec) in one of t…
Browse files Browse the repository at this point in the history
…he new json files.
  • Loading branch information
cylammarco committed May 7, 2023
1 parent d910fb5 commit bf9b728
Show file tree
Hide file tree
Showing 222 changed files with 1,621 additions and 1,859 deletions.
File renamed without changes.
Expand Up @@ -80,7 +80,3 @@
9832. 0.053
10256. 0.023
10400. 0.024


# Last four extinction coefficients from CTIO list - no data available
# for KPNO.
30 changes: 12 additions & 18 deletions src/aspired/flux_calibration.py
Expand Up @@ -124,7 +124,7 @@ def __init__(
self.ftype = "flux"
self.cutoff = 0.4

self.designation_to_filename = None
self.designation_to_lib_filename = None
self.lib_to_filename = None
self.filename_to_lib = None

Expand All @@ -138,10 +138,10 @@ def _load_standard_dictionary(self):
"""

self.designation_to_filename = json.load(
self.designation_to_lib_filename = json.load(
open(
pkg_resources.resource_filename(
"aspired", "standards/designation_to_filename.json"
"aspired", "standards/designation_to_lib_filename.json"
),
encoding="ascii",
)
Expand All @@ -163,7 +163,7 @@ def _load_standard_dictionary(self):
)
)

self.designation_list = self.designation_to_filename.keys()
self.designation_list = self.designation_to_lib_filename.keys()
self.lib_list = self.lib_to_filename.keys()
self.filename_list = self.filename_to_lib.keys()

Expand Down Expand Up @@ -205,18 +205,14 @@ def _get_ing_standard(self):
"""

folder = self.library.split("_")[0]
folder = self.library

# the first part of the file name
filename = self.target
extension = self.library.split("_")[-1]
extension = self.library[3:]

# last letter (or nothing) of the file name
if self.ftype == "flux":
# .mas only contain magnitude files
if extension == "mas":
filename += "a"

if (filename == "g24" or filename == "g157") and (
extension == "fg"
):
Expand Down Expand Up @@ -347,7 +343,7 @@ def lookup_standard_libraries(self, target: str, cutoff: float = 0.4):

# If the provided designation exists
if target.lower() in self.designation_list:
_filename_list = self.designation_to_filename[target.lower()]
_filename_list = self.designation_to_lib_filename[target.lower()]

exact_match = True

Expand All @@ -357,21 +353,19 @@ def lookup_standard_libraries(self, target: str, cutoff: float = 0.4):
# difflib uses Gestalt pattern matching.
designation_list = difflib.get_close_matches(
target.lower(),
list(self.designation_to_filename.keys()),
list(self.designation_to_lib_filename.keys()),
n=5,
cutoff=cutoff,
)

for designation in designation_list:
_filename_list = self.designation_to_filename[designation]
_filename_list = self.designation_to_lib_filename[designation]

exact_match = False

for filename in _filename_list:
_library_list = self.filename_to_lib[filename]
for l in _library_list:
filename_list.append(filename)
library_list.append(l)
for libname, filename in _filename_list.items():
filename_list.append(filename)
library_list.append(libname)

if len(filename_list) > 0:
self.logger.warning(
Expand Down
8 changes: 8 additions & 0 deletions src/aspired/onedspec.py
Expand Up @@ -4679,6 +4679,12 @@ def set_atmospheric_extinction(
THE ESO USERS MANUAL 1993
https://www.eso.org/public/archives/techdocs/pdf/report_0003.pdf
The KP (Kitt Peak) atmospheric extinction correction table is taken
from iraf
The CT (Cerro Tololo) atmospheric extinctioncorrection table is taken
from iraf
Parameters
----------
location: str (Default: orm)
Expand All @@ -4687,6 +4693,8 @@ def set_atmospheric_extinction(
(2) mk - Mauna Kea (4205 m)
(3) cp - Cerro Paranal (2635 m)
(4) ls - La Silla (2400 m) [up to 9000A only]
(5) kp - Kitt Peak (2096 m)
(6) ct - Cerro Tololo (2207 m)
Only used if extinction_func is None.
extinction_func: callable function (Default: None)
Input wavelength in Angstrom, output magnitude of extinction per
Expand Down
251 changes: 0 additions & 251 deletions src/aspired/standards/README

This file was deleted.

1 change: 0 additions & 1 deletion src/aspired/standards/designation_to_filename.json

This file was deleted.

1 change: 1 addition & 0 deletions src/aspired/standards/designation_to_lib_filename.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/aspired/standards/designation_to_position.json

Large diffs are not rendered by default.

0 comments on commit bf9b728

Please sign in to comment.