Compare commits

...

3 Commits

@ -107,7 +107,11 @@ for site in os.listdir(images_dir): # Loop through SITES
# Add site stability data (# registered / # processed)
for i, row in stats_csv.iterrows():
stability = "{0:.0%}".format(stats_csv.at[i, '# registered'] / stats_csv.at[i, '# photoshop'])
if stats_csv.at[i, '# photoshop'] != 0:
stability = "{0:.0%}".format(stats_csv.at[i, '# registered'] / stats_csv.at[i, '# photoshop'])
else:
stability = 'NaN' # or whatever value makes sense in your context
stats_csv.at[i,'stability'] = stability
stats_csv.set_index('site', inplace = True)

@ -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)

Loading…
Cancel
Save