bug fix for missing runs

This commit is contained in:
Beale John Henry
2023-12-10 15:27:40 +01:00
parent 8fe51dc111
commit a597e41a5c

View File

@@ -90,15 +90,21 @@ def generate_lst_df( run_lst, endstation, label, pgroup ):
# make df of lsts to be concatenated
lst_df = pd.DataFrame()
for index, row in range_df.iterrows():
# get approximate dir pwd
lst_app_dir = row[ "lst_app_dir" ]
# find matching file
lst_dir = glob.glob( lst_app_dir )
# find lsts in lst directory depending on label
lst_dir_df = find_lst( lst_dir[0], label )
# find matching file
try:
lst_dir = glob.glob( lst_app_dir )
# find lsts in lst directory depending on label
lst_dir_df = find_lst( lst_dir[0], label )
except IndexError:
lst_dir_df = pd.DataFrame()
# append lst dir dfs
lst_df = pd.concat( [ lst_df, lst_dir_df ], ignore_index=True )
@@ -144,7 +150,7 @@ if __name__ == "__main__":
parser.add_argument(
"-p",
"--pgroup",
help="pgroup the data are collected in - in form p#####",
help="pgroup the data are collected in",
type=str
)
parser.add_argument(
@@ -157,7 +163,7 @@ if __name__ == "__main__":
parser.add_argument(
"-o",
"--output",
help="name of output file - script will add .lst",
help="name of output file",
type=str,
)
args = parser.parse_args()
@@ -177,3 +183,4 @@ if __name__ == "__main__":
# run main
main( run_lst, args.endstation, args.label, args.pgroup, args.output )
print( "done" )