usnistgov / mass

Microcalorimeter pulse-analysis software
MIT License
6 stars 0 forks source link

Make bin/ljh_merge work with brace-expansion #258

Closed joefowler closed 10 months ago

joefowler commented 10 months ago

Original report by Joseph Fowler (Bitbucket: joe_fowler, ).


Python package glob cannot do brace-expansion, but the shell can. By this, I mean expressions like

ls /path/to/stuff/202301{23,26,27,29}/*_chan13.ljh

glob can handle the * part of the filename, but it can’t accept the {23,26,27,29} part.

Change ljh_merge so it accepts 2 or more glob patterns. Then you can run the above like:

mass/bin/ljh_merge -d $OUTPUT /path/to/stuff/202301{23,26,27,29}/"*_chan13.ljh"

In the above expression, the shell will expand the braces, then pass the quoted *-string to Python.

joefowler commented 10 months ago

Original comment by Joseph Fowler (Bitbucket: joe_fowler, ).


Allow bin/ljh_merge to accept 2+ file patterns

Fixes #258