Skip to content

Commit

Permalink
Merge pull request #60 from Sunmish/textfile-input
Browse files Browse the repository at this point in the history
allow input listfile to avoid sh limits on max number of arguments on the command line
  • Loading branch information
AlecThomson authored Jul 11, 2024
2 parents cf959ba + 14a86e9 commit 2713fd5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions racs_tools/beamcon_2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ def main(
tolerance: float = 0.0001,
nsamps: int = 200,
epsilon: float = 0.0005,
listfile: bool = False,
):
"""Main script.
Expand Down Expand Up @@ -525,6 +526,9 @@ def main(
outdir = os.path.abspath(outdir)

# Get file list
if listfile:
with open(infile[0]) as f:
infile = f.read().splitlines()
files = sorted(infile)
if files == []:
raise Exception("No files found!")
Expand Down Expand Up @@ -664,6 +668,12 @@ def cli():
nargs="+",
)

parser.add_argument(
"--listfile",
action="store_true",
help="Switch to assume `infile` is a text file list of images.",
)

parser.add_argument(
"-p",
"--prefix",
Expand Down

0 comments on commit 2713fd5

Please sign in to comment.