Skip to content

Commit

Permalink
Merge pull request #6 from ornlneutronimaging/img339_summedfits_output
Browse files Browse the repository at this point in the history
Copy `_SummedImg.fits` from raw folder to corrected folder when running the mcp_correction code
  • Loading branch information
KedoKudo authored Oct 3, 2022
2 parents 4805cdb + 23712bb commit 213e1f4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/mcp_detector_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
shutter_count_file = glob.glob(input_dir + "/*_ShutterCount.txt")[0]
shutter_time_file = glob.glob(input_dir + "/*_ShutterTimes.txt")[0]
spectra_file = glob.glob(input_dir + "/*_Spectra.txt")[0]
summed_file = glob.glob(input_dir + "/*_SummedImg.fits")[0]

# validation
print("Validating input arguments")
Expand All @@ -59,6 +60,7 @@
assert Path(shutter_count_file).exists()
assert Path(shutter_time_file).exists()
assert Path(spectra_file).exists()
assert Path(summed_file).exists()

# process metadata
print("Processing metadata")
Expand Down Expand Up @@ -95,8 +97,11 @@
os.path.basename(shutter_time_file))
out_spectra_file = os.path.join(output_dir,
os.path.basename(spectra_file))
out_summed_file = os.path.join(output_dir,
os.path.basename(summed_file))
shutil.copyfile(shutter_count_file, out_shutter_count)
shutil.copyfile(shutter_time_file, out_shutter_time)
shutil.copyfile(summed_file, out_summed_file)
# handle proper spectra parsing
if skip_first_last_img:
skipping_meta_data(df_meta).to_csv(
Expand Down

0 comments on commit 213e1f4

Please sign in to comment.