Skip to content

Commit

Permalink
Removed redundant file writing and fixed parameters to make clear wha…
Browse files Browse the repository at this point in the history
…t sets output
  • Loading branch information
PrinceWalnut committed Nov 23, 2023
1 parent 450347c commit 20c15dd
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions src/laue_dials/command_line/find_spots.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,19 @@
# Set the phil scope
main_phil = libtbx.phil.parse(
"""
laue_output {
filename = 'strong.refl'
.type = str
.help = "The output spotfinding reflection table filename."
include scope dials.command_line.find_spots.phil_scope
""",
process_includes=True,
)

output_phil = libtbx.phil.parse(
"""
output {
log = 'laue.find_spots.log'
.type = str
.help = "The log filename."
}
include scope dials.command_line.find_spots.phil_scope
""",
process_includes=True,
"""
)

spotfinder_phil = libtbx.phil.parse(
Expand All @@ -62,7 +60,7 @@
"""
)

working_phil = main_phil.fetch(sources=[spotfinder_phil])
working_phil = main_phil.fetch(sources=[output_phil, spotfinder_phil])


@show_mail_handle_errors()
Expand All @@ -84,7 +82,7 @@ def run(args=None, *, phil=working_phil):

# Configure logging
console = logging.StreamHandler(sys.stdout)
fh = logging.FileHandler(params.laue_output.log, mode="w", encoding="utf-8")
fh = logging.FileHandler(params.output.log, mode="w", encoding="utf-8")
loglevel = logging.INFO

logger.addHandler(fh)
Expand Down Expand Up @@ -136,9 +134,6 @@ def run(args=None, *, phil=working_phil):

strong_refls = find_spots(params, imported_expts)

logger.info("Saving strong spots to %s", params.laue_output.filename)
strong_refls.as_file(filename=params.laue_output.filename)

logger.info("")
logger.info("Time Taken Spotfinding = %f seconds", time.time() - spotfinding_time)

Expand Down

0 comments on commit 20c15dd

Please sign in to comment.