Skip to content

Commit

Permalink
pass load kwargs to chunking too
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsavel committed Mar 21, 2024
1 parent 029bfc5 commit 7128b86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/cortecs/opac/chunking.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def add_lams(max_lam_to_add_ind, file, next_file):
return


def add_overlap(filename, v_max=11463.5):
def add_overlap(filename, v_max=11463.5, load_kwargs=None):
"""
Adds overlap from file n+1 to file n. The last file has nothing added to it. This
step is necessary for the Doppler-on version of the RT code.
Expand Down Expand Up @@ -241,12 +241,12 @@ def add_overlap(filename, v_max=11463.5):
next_file = filename + str(i + 1) + ".dat"

# go into file n to determine the delta lambda
opac = Opac(file, loader="exotransmit")
opac = Opac(file, loader="exotransmit", load_kwargs=load_kwargs)
curr_lams = opac.wl
del opac

try:
opac = Opac(next_file, loader="exotransmit")
opac = Opac(next_file, loader="exotransmit", load_kwargs=load_kwargs)
next_lams = opac.wl
del opac
except FileNotFoundError:
Expand Down
4 changes: 2 additions & 2 deletions src/cortecs/tests/test_chunking.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_add_overlap_wl_increase_or_same(self):
self.second_file, loader="exotransmit", load_kwargs=self.load_kwargs
)

add_overlap(self.file_base, v_max=0.0)
add_overlap(self.file_base, v_max=0.0, load_kwargs=self.load_kwargs)

# now get the wavelengths of each file
opac_obj_ref = Opac(
Expand Down Expand Up @@ -140,7 +140,7 @@ def add_overlap_with_single_overlap_point(self):
c = 3e8
max_curr_lam = np.max(opac_obj0_orig.wl)
v_max = c * (opac_obj1_orig.wl[0] - max_curr_lam) / max_curr_lam
add_overlap(self.file_base, v_max=v_max)
add_overlap(self.file_base, v_max=v_max, load_kwargs=self.load_kwargs)

# now get the wavelengths of each file
opac_obj_ref = Opac(
Expand Down

0 comments on commit 7128b86

Please sign in to comment.