Stack overview and optimal InSAR master selection

I’m studying ground motion. When I use SNAP I select Stack overview and optimal InSAR master selection and click Overview. The snap algorithm selects the master from the open files by criteria it applies. Is there a way to do THE SAME MASTER SELECTION via python scripts or via the snap tool GraphBuilder? Or some other way?

thank u