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