|
|
|
@ -178,11 +178,11 @@ def main(site):
|
|
|
|
|
else: # Stop tagging and go to the next site
|
|
|
|
|
site_complete = True;
|
|
|
|
|
if i == 0:
|
|
|
|
|
print(site + ": " + str(i) + " images tagged")
|
|
|
|
|
print(str(i) + " images tagged\n")
|
|
|
|
|
elif image2tag and image2tag.tide:
|
|
|
|
|
print(site + ": " + str(i) + " images tagged with tide")
|
|
|
|
|
print(str(i) + " images tagged with tide\n")
|
|
|
|
|
else:
|
|
|
|
|
print(site + ": " + str(i) + " images tagged no tide")
|
|
|
|
|
print(str(i) + " images tagged no tide\n")
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -193,15 +193,17 @@ def main(site):
|
|
|
|
|
|
|
|
|
|
pathname = os.path.join(year_path, image_filename)
|
|
|
|
|
image2tag = RegisteredImage(pathname, image_filename, registered_image_path) # Create image object
|
|
|
|
|
image2tag.get_font()
|
|
|
|
|
image2tag.get_dimensions()
|
|
|
|
|
if i == 1: # Retrieve Tide Data once for each site
|
|
|
|
|
try:
|
|
|
|
|
tides_df = get_site_tide_data(images_parent_dir, site)
|
|
|
|
|
except:
|
|
|
|
|
print("No tide data for " + site)
|
|
|
|
|
image2tag.get_font()
|
|
|
|
|
image2tag.get_dimensions()
|
|
|
|
|
if isinstance(tides_df, pd.DataFrame): # Check if tide data exists
|
|
|
|
|
image2tag.get_tide(tides_df)
|
|
|
|
|
except:
|
|
|
|
|
print("No tide data")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
image2tag.create_tag()
|
|
|
|
|
|
|
|
|
|
tag_image(image2tag)
|
|
|
|
@ -215,11 +217,11 @@ def main(site):
|
|
|
|
|
# Case: All images tagged
|
|
|
|
|
if not site_complete:
|
|
|
|
|
if i == 0:
|
|
|
|
|
print(site + ": " + str(i) + " images tagged")
|
|
|
|
|
print(str(i) + " images tagged\n")
|
|
|
|
|
elif image2tag.tide:
|
|
|
|
|
print(site + ": " + str(i) + " images tagged with tide")
|
|
|
|
|
print(str(i) + " images tagged with tide\n")
|
|
|
|
|
else:
|
|
|
|
|
print(site + ": " + str(i) + " images tagged no tide")
|
|
|
|
|
print(str(i) + " images tagged no tide\n")
|
|
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
|
# Case: Tag reregistered images
|
|
|
|
@ -264,6 +266,7 @@ else:
|
|
|
|
|
main(args.site)
|
|
|
|
|
else: # Case 2: No site specified. Tag all images
|
|
|
|
|
for site in site_list: # Code to loop over entire images directory: for site in os.listdir(images_dir):
|
|
|
|
|
print(site)
|
|
|
|
|
main(site)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|