The seqapplyreg command which lets you script filtering of registered light frames seems to allow only sigma or percentage values as filter criteria. If I understand the math implied in the description, this is relative to the average/median of the sequence.
I have data sets from multiple sessions where the quality of the sky is quite variable. It’s not all that hard to imagine that the average over all might be quite a bit higher than the average in the best session. If I wanted to do something like: “take the best frames from the lowest average session and then only take select frames from other sessions where the quality is roughly the same as from the best night’s captures”, then I think having average-relative filter values applied across the whole data set as a sequence is not what you want.
Indeed, what I’ve been doing manually is calibrating all the images and then getting them into the plot view. From there one can easily draw a box around the frame points that are of higher value (FWHM or round, etc.) and exclude frames that fall above the bottom edge value of the box.
Effectively that plot tab box-and-exclude operation is applying an absolute value to discard frames. So far as I can tell, there is no way to do the equivalent from a script.
Knowing my equipment and my sky, I have a pretty good idea from experience what a reasonable value for these filters should be. I note also that when you add filters to the stacking tab with percentage or sigma values, there is an animated value displayed which shows this absolute value. But it’s an output. What I would love to see is that same kind of value as an input type for these filters - in the UI and the command ideally although the reason I was thinking about this relates to scripting multisession data.
[while I’m here, it’s not clear to me from the description how the present code uses the sigma value in particular - does it only create a bound above the average/median and reject frames above that or does it look for frames that fall within the sigma value of the average/median both above and below?? It’s not all that hard to imagine data sets where “poor” frames dominate and purely sequence quality relative metrics could end up rejecting the best data frames if they fall outside (which is to say below) the lower bound of the sigma window…which would seem unfortunate.]
If you are scripting through the python API, you can fetch all the data necessary, and then unselect, so you can enforce any filtering algorithm you see fit for your data. Can’t remember the exact names but would be something like get_registration_data and select. Just go through the API doc and come back here if you can’t find them.
As for your other question, the rejection is only done on the “bad” tail of the values, say if it’s fwhm, we reject the high values above k x sigma of the median, then re-evaluate the median and sigma, clip again and so on. Conversely for roundness, we prioritize high values and only discard below median - k x sigma. So that we don’t converge prioritizing bad quality frames.
Thank you very much for taking the time to reply - much appreciated.
I did not know that the potential was there to, as you put it, enforce one’s own filtering. Sadly, I don’t speak Python so I wasn’t writing scripts that way. It seems unfortunate that there’s a simple GUI way to do something that by contrast needs non-trivial programming effort to reproduce in a scripting context. But I completely understand now that the means to fix my own concern does exist, even if beyond me at present; I speak c/c++/c#, just not Python to this point - perhaps this is the prod to make me try that
The explanation regarding the “bad” tail makes good sense. Thanks for clarifying. Perhaps that’s something that could be made clearer in the docs next time someone is editing those in the neighborhood of the relevant spot.
Best images from the sequence can be stacked by using the filtering arguments. Each of these arguments can remove bad images based on a property their name contains, taken from the registration data, with either of the three types of argument values:
- a numeric value for the worse image to keep depending on the type of data used (between 0 and 1 for roundness and quality, absolute values otherwise),
- a percentage of best images to keep if the number is followed by a % sign,
- or a k value for the k.sigma of the worse image to keep if the number is followed by a k sign.
It is also possible to use manually selected images, either previously from the GUI or with the select or unselect commands, using the -filter-included argument.
You can already pass an absolute value to the command (the first bullet point). Forgotten about that As for GUI implementation, as you said yourself, you can do it through the plot tab.
If you need some more complex filtering and you are coming from C type languages, Python will feel like a walk in the park
Well, gee, that’s too easy - why didn’t I see that?! Sorry…appreciate your patience.
I presume these work as the percentage and sigma do, so rejecting the bad tail values (which would be anything below the roundness value and anything above the others). I’ll try this out to verify - thank you for the shove in the right direction!