From 8fe51dc11163ebd457dbc7fe7604cd28110c69e7 Mon Sep 17 00:00:00 2001 From: Beale John Henry Date: Sun, 10 Dec 2023 14:40:40 +0100 Subject: [PATCH] fixed naming bug --- clen_tools/sample_crystfel-ls.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clen_tools/sample_crystfel-ls.py b/clen_tools/sample_crystfel-ls.py index 8d99bc2..3993a9c 100644 --- a/clen_tools/sample_crystfel-ls.py +++ b/clen_tools/sample_crystfel-ls.py @@ -26,13 +26,13 @@ def h5_sample( lst, sample ): # read h5.lst - note - removes // from image column print( "reading SwissFEL ls file" ) # scrub file name - lst_name = os.path.basename( lst ) + lst_name = os.path.splitext( os.path.basename( lst ) )[0] cols = [ "h5", "image" ] sample_df = pd.read_csv( lst, sep="\s//", engine="python", names=cols ) print( "done" ) - print( "taking {0} image sample".format( sample ) ) + print( "taking {0} image sample of {1} image lst".format( sample, len( sample_df ) ) ) # take defined sample sample_df = sample_df.sample( sample ) @@ -71,3 +71,4 @@ if __name__ == "__main__": +