Skip to content

Commit

Permalink
define level0 file name
Browse files Browse the repository at this point in the history
  • Loading branch information
ludwiglierhammer committed Jul 12, 2024
1 parent 6e43ae1 commit 63b7d3d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion glamod_marine_processing/obs_suite/scripts/_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ def __init__(self, process_options, inargs, level, level_prev):
if self.prev_fileID is None:
self.prev_fileID = self.fileID

self.prev_level_path = os.path.join(release_path, level_prev, self.sid_dck)
if level = "level1a":
self.prev_level_path = os.path.join(self.data_path, "datasets", self.dataset, "level0", self.sid_dck)
else:
self.prev_level_path = os.path.join(release_path, level_prev, self.sid_dck)
self.level_path = os.path.join(release_path, level, self.sid_dck)
self.level_ql_path = os.path.join(
release_path, level, "quicklooks", self.sid_dck
Expand Down
9 changes: 5 additions & 4 deletions glamod_marine_processing/obs_suite/scripts/level1a.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ def write_out_junk(dataObj, filename):

correction_path = os.path.join(params.data_path, params.release, params.corrections)

L0_path = os.path.join(
params.data_path, "datasets", params.dataset, "level0", params.sid_dck
)
L0_filename = os.path.join(params.prev_level_path, params.filename)
if not os.path.isfile(L0_filename):
logging.error(f"L0 file not found: {L0_filename}")
sys.exit(1)

# CLEAN PREVIOUS L1A PRODUCTS AND SIDE FILES ----------------------------------
L1a_prods = glob.glob(
Expand Down Expand Up @@ -148,7 +149,7 @@ def write_out_junk(dataObj, filename):
"sections": params.read_sections,
"chunksize": 200000,
}
data_in = mdf_reader.read(params.filename, **read_kwargs)
data_in = mdf_reader.read(L0_filename, **read_kwargs)
logging.info(data_in.data)
io_dict["read"] = {"total": inspect.get_length(data_in.data)}

Expand Down

0 comments on commit 63b7d3d

Please sign in to comment.