I have a layer called addLayer0 which is largely filled with nodata values.
for l in list_dfs:
l.panToExtent(addLayer0.getExtent())
where list_dfs is a list of all dataframes in the document.
I want all dataframes to show the extent of the layer called addLayer0.
However as the Layer is largely made up of nodata values, the layer extent is much larger than the relevant area which has values >0, so it zooms to the extent shown in the image instead of the colored area.
How can I zoom to the extent of the colored area only? EDIT: The extent needs to be determined automatically as the script runs over many different files with different extents.