fmemuir / COASTGUARD

Coastal Observation + Analysis using Satellite-derived Timeseries, Generated Using AI + Real-time Data
37 stars 5 forks source link

"VegetationLine.extract_veglines" Outputs empty output .pkl files #14

Closed ccromwellu closed 1 week ago

ccromwellu commented 5 months ago

Hi Freya et al.

I've been working a bit with the VedgeSat toolbox on a study site in NE Florida USA using Landsat and Sentinel 2 data and using the provided example driver notebooks. While the vegetation and water level detections appear to be working as shown in the attached classification image, the output .pkl files are empty (screenshot). Any thoughts on how I can address this?

2020-05-08_S2

Screenshot 2024-06-25 174349 73723280/56e04629-ff18-44ac-83b7-4561bae52cef)

fmemuir commented 5 months ago

Hi @ccromwellu, thanks for raising this. If lines exist on the plots, then a threshold value has been successfully calculated, so you're right that there should be entries in the output object. I wonder if some condition isn't being met by not having any tide data to extract water elevations from. Would you be able to send me a screenshot of your settings cell where you define your site and date range, so I can investigate for you?

ccromwellu commented 5 months ago

Hi @fmemuir , thank you for your quick response. I'm attaching the screenshots showing those settings below. I also thought the absence of the tide data could have prompted the empty output and reran the script with the PyFES tides but still received an empty output pkl file.

COASTGUARD_settings1 COASTGUARD_settings2

fmemuir commented 4 months ago

Hi @ccromwellu apologies for the delay on this. I've had a look at your bounding box coordinates, and while you're getting successful images for Fort Matanzas, from what I can see the coordinates don't actually stretch down to the coast and sit somewhere in the intertidal zone due north of the coast (see screenshot). I'm not sure how the coast is still successfully being included in the converted rasters from Google Earth Engine, but this difference might have something to do with the fact that outputs are not being saved properly, as the bounding box is used for clipping both the images and the resulting veg/lines lines.

Could you do me a favour and git pull the repository, and use the new VedgeSat_DriverTemplate.ipynb for setting up your site? I've restructured the bounding box definition cells so that there is an option to define the bounding box using the boundaries of your reference line shapefile:

# Return AOI from reference line bounding box and save AOI folium map HTML in sitename directory
referenceLinePath = os.path.join(filepath, 'referenceLines', referenceLineShp)
referenceLineDF = gpd.read_file(referenceLinePath)
polygon, point, lonmin, lonmax, latmin, latmax = Toolbox.AOIfromLine(referenceLinePath, max_dist_ref, sitename)

# It's recommended to convert the polygon to the smallest rectangle (sides parallel to coordinate axes)       
polygon = Toolbox.smallest_rectangle(polygon)

I'm not sure if this will fix things yet, so I'll continue hunting for the specific lines causing trouble.

Screenshot 2024-07-04 at 16 13 05