From f440686a16f243900bf11999b2e4ddff11c94bb9 Mon Sep 17 00:00:00 2001 From: Jonathan Chan Date: Wed, 14 Jun 2023 16:51:26 +1000 Subject: [PATCH] Reads from coastsnap_sites.csv --- coastsnap/tag_registered.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/coastsnap/tag_registered.py b/coastsnap/tag_registered.py index 0829363..1d756f4 100644 --- a/coastsnap/tag_registered.py +++ b/coastsnap/tag_registered.py @@ -40,6 +40,9 @@ coastsnap_sites_csv = pd.read_csv(sites_csv_path) images_parent_dir = coastsnap_sites_csv.parent_directory[0] images_dir = os.path.join(images_parent_dir, "Images") +site_list = coastsnap_sites_csv['site_name'] # Loop through sites in coastsnap_sites.csv +#site_list = os.listdir(images_dir) # Loop through all sites in /CoastSnap/Images + #-----------------------------------------------------------------------------# # Tag image function @@ -227,7 +230,7 @@ if args.tag_reregistered: if args.site: count = loop_reregistered(args.site, tag, reregister_all) else: - for site in os.listdir(images_dir): + for site in site_list: # Code to loop over entire images directory: for site in os.listdir(images_dir): x = loop_reregistered(site, tag, reregister_all) count = count + x @@ -247,7 +250,7 @@ if args.tag_reregistered: if args.site: # Case 1: User specifies a site loop_reregistered(args.site, tag, reregister_all) else: # Case 2: No site specified. Tag all images - for site in os.listdir(images_dir): + for site in site_list: # Code to loop over entire images directory: for site in os.listdir(images_dir): loop_reregistered(site, tag, reregister_all) #-----------------------------------------------------------------------------# @@ -258,7 +261,7 @@ else: if args.site: # Case 1: User specifies a site main(args.site) else: # Case 2: No site specified. Tag all images - for site in os.listdir(images_dir): + for site in site_list: # Code to loop over entire images directory: for site in os.listdir(images_dir): main(site)