FINDSTAR not selecting stars when initiated from a script.

when calling ‘findstar’ in a script it all runs as expected and finds plenty of stars but fails to select them on the screen. Running from the command line I get the same console output but the stars do get selected. Is this expected behavior and is there any other way to force selection?

Hello and welcome.

Yes, this is expected behavior. We want to avoid display interaction with scripts. So in this case, everything is normal.

Thanks for your reply, the issue I’m facing is that I’m trying to run synthstar but the default setting isn’t selecting enough stars for me, I want to find all stars and the findstar output is being ignored, is there a way around this please?

If you want to run a script, you can use this command: setfindstar

Well I tried that but seem to get a totally different result to if I run findstar in the console then run synthstar, I’m just trying to get everything but the output is strange.

the first image is created using this on a linear image
setfindstar -radius=5 -sigma=0.5 -roundness=0.5 -gaussian -minA=0 -maxA=1 -convergence=3
synthstar

The second is created using the Dynamic PSF and full resynthesis option in the star processing menu

They are both autostretched

It’s been a while since I looked at that code bu this line stands out:

    stars = peaker(input_image, channel, &com.pref.starfinder_conf, &nb_stars, NULL, FALSE, FALSE, MAX_STARS, PSF_MOFFAT_BFREE, com.max_thread);

I think I forced Moffat fitting for synthstars because it gives much better stars and avoids the nasty square blocky stars you can see in the top image where the Gaussian psf spills out over the edge of the synthetic patch.
The huge stars aren’t necessarily even bright stars (in fact they are almost certainly not!), so don’t worry that the second image is missing bright stars in corresponding locations. It’s just a side effect of the autostretch that you can get Gaussian stars that are really faint (so inaccurately measured with a big fwhm) that end up looking like massive bright stars because with a zero background level outside the synthesized psfs the autostretch ends up highlighting the full area of the psf and gives essentially no useful information about brightness. They are much better dealt with by the Moffat fitter.
So the algorithm defaults to Moffat fitting, and if it needs to detect stars itself it will override the preference for Gaussian set using setfindstar. But if you really insist on using Gaussian fits, if you already have stars detected when you run synthstar it will accept your choices.

It’s perhaps an area where I can improve the behaviour by forcing larger synthetic psfs if the fitting type is Gaussian, but really my recommendation is to allow synthstar to do the fitting itself. I know the star mask looks a bit weird with autostretch (they always do, synthetic or otherwise…) but when mixed back into a starless image the bottom image where full resynthesis has been allowed to do its own star fitting will generally look better.

1 Like

Many thanks for the detailed response, I think my issue is that I can only seem to detect the stars through either the Dynamic PSF dialog or command line, it doesn’t seem possible to adjust the selection parameters of the stars via scripting using setfindstar/findstar?