Skip to content

Commit

Permalink
Fix csv whitespace delimiters and use more modern rv_shift backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Sujay-Shankar committed May 28, 2024
1 parent 327de86 commit 66cc7b9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/tutorials/best_fit_for_fixed_template.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/gollum/coolTLUSTY.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(
fn = "{}T{:3d}_g{:0.2f}_Z{:0.3f}.21".format(base_path, int(teff), logg, z)

df_native = read_csv(
fn, delim_whitespace=True, usecols=["LAMBDA(mic)", "FLAM"]
fn, sep=r"\s+", usecols=["LAMBDA(mic)", "FLAM"]
)
df_native["wavelength_um"] = (
df_native["LAMBDA(mic)"].str.replace("D", "e").astype(float)
Expand Down
2 changes: 1 addition & 1 deletion src/gollum/precomputed_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def rv_shift(self, rv):
RV-Shifted Spectrum
"""
shifted_spec = deepcopy(self)
shifted_spec.radial_velocity = rv * u.km / u.s
shifted_spec.shift_spectrum_to(radial_velocity=rv*u.km/u.s)
return shifted_spec

def resample(self, target_spectrum):
Expand Down
6 changes: 3 additions & 3 deletions src/gollum/sonora.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(
read_csv(
fn,
skiprows=[0, 1, 2],
delim_whitespace=True,
sep=r"\s+",
names=["wavelength_um", "flux"],
)
.sort_values("wavelength_um")
Expand Down Expand Up @@ -170,7 +170,7 @@ def __init__(
read_csv(
fn,
skiprows=[0, 1],
delim_whitespace=True,
sep=r"\s+",
compression="gzip",
names=["wavelength_um", "flux"],
)
Expand Down Expand Up @@ -265,7 +265,7 @@ def __init__(
read_csv(
fn,
skiprows=[0, 1],
delim_whitespace=True,
sep=r"\s+",
names=["wavelength_um", "flux"],
)
.sort_values("wavelength_um")
Expand Down
4 changes: 2 additions & 2 deletions src/gollum/telluric.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(
df_native = (
read_csv(
path,
delim_whitespace=True,
sep=r"\s+",
names=["wavelength_nm", "transmittance"],
)
.sort_values("wavelength_nm")
Expand Down Expand Up @@ -88,7 +88,7 @@ def __init__(self, *args, path=None, **kwargs):
names = ["wavelength_nm", "transmission", "continuum", "err"]
df_native = read_csv(
path,
delim_whitespace=True,
sep=r"\s+",
names=names,
usecols=names[0:2],
encoding="unicode_escape", # or UTF-8?
Expand Down

0 comments on commit 66cc7b9

Please sign in to comment.