Script for discarding subs using NINA CSV exported files Stefan Berg Nighttime Imaging 'N' Astronomy (N.I.N.A. / NINA) · Guiem Kimi · ... · 9 · 652 · 1

birelian 5.49
...
· 
·  7 likes
Hi all,

I wrote a simple Python script that analyzes CSV data exported from NINA and filters bad subs according to certain parameters. It allows discarding subs by HFR, median value, RMS, eccentricity and number of stars. This allows me to discard subs because of clouds, bad tracking, bad dome sync (less common), etc.
I know there are beautiful tools for this purpose. This is just my own implementation of the workflow I follow.

I was tired of spending so many time deleting subs from the Blink process in PI so I decided to filter them before. Now, after filtering the subs by using the script, the Blink part is very fast, as I usually keep all the remaining subs.

I built it to my needs, but it's free software under GPLv3

You can find it here: https://github.com/birelian/subs-analyzer

CS,

Guiem.
Like
FabianButkovich 0.00
...
· 
·  1 like
Very nice! I actually did a similar thing a while ago to parse a list of files and sort images based on HFR or star count and then re-number them in ascending order. I threw in some error handling and logging functionality in the python script to catch issues with filenames or folder names that don't exist.

In the end I ended up not really using this much as I still prefer to just open up .fits files in ASI fits viewer and cull bad images manually before proceeding with stacking in DSS. But this was still a neat project that helped me learn even more things in my python experience. 

Attached is my code. 

Astrophotography Image Frame Preprocessor.py
Like
birelian 5.49
...
· 
·  1 like
Thank you @Fabian Butkovich  for sharing the script. Solving time consuming tasks by developing applications is very nice.

I've checked your GitHub and the StarAdventurer project is just awesome. Congratulations!

Guiem.
Like
FabianButkovich 0.00
...
· 
·  1 like
Thank you as well @Guiem Kimi, it was a fun project I pursued as a cost saving alternative to purchasing a full GOTO mount, which in the end I did end up doing anyways lol. 

Interestingly enough, it surprised me when SkyWatcher did end up releasing the Star Adventurer GTI, so I knew my idea wasn't silly or aimless to begin with.  

Fabian
Like
blackrig 4.52
...
· 
·  1 like
I looked at your script in detail. Thanks for sharing.
Why not use Pandas or Numpy arrays if you load the entire csv?  That would simplify the csv loading and array manipulation.

I like the idea to autodetect the best frame and compare the others to it, a bit the the Pixinsight Preprocessing script does. Ideally it needs to be done by target & filter as you mentioned. 

I have been working on similar things, but I am not yet where I want to be. The goal is to have NINA run a script automatically at the end of each session, every morning and remove the drudgery of going through thousand of frames every day.

The obvious alternative, the Pixinsight frame selector does a descent job, but it does not run full automatic, and it insists on converting to the xisf, when it should only do a selection.
Like
birelian 5.49
...
· 
Why not use Pandas or Numpy arrays if you load the entire csv? That would simplify the csv loading and array manipulation.

Thanks for the advice. Didn't know about them. I will have a look.
I have been working on similar things, but I am not yet where I want to be. The goal is to have NINA run a script automatically at the end of each session, every morning and remove the drudgery of going through thousand of frames every day.


Thanks for sharing the repo. I'll check it.

Running the script after NINA ends the session sounds very nice. The thing is at the moment I have not been able of exporting the CSV in an automatic way. Please let me know if you get to it.
The obvious alternative, the Pixinsight frame selector does a descent job, but it does not run full automatic, and it insists on converting to the xisf, when it should only do a selection.

Correct. That was the motivation for building my own script for doing that, although is far of being at the point I would like.

CS,
Guiem.
Like
blackrig 4.52
...
· 
·  1 like
Here is the script I autorun after each NINA session to remove obviously bad frames. Here is how it is called in NINA. Works on its own while the Session Metadata plugin is properly configured properly.

This cleans up bad frames (cloud messing with seeing or guiding).

The final clean up in done with the Subframe Selector in PixInsight once all the subs have been collected. But the little python script takes care of the tedious work.
Edited ...
Like
birelian 5.49
...
· 
Here is the script I autorun after each NINA session to remove obviously bad frames. Here is how it is called in NINA. Works on its own while the Session Metadata plugin is properly configured properly.


Thanks so much for sharing. I'll check it.

It's a different approach and I find it very interesting.

Guiem.
Like
blackrig 4.52
...
· 
New version of my python post session script is available, it does a bunch of thinks I wanted to automate post imaging, daily, for my remote scope and also provides plenty of updates and status to the telescope Discord server for the rest of the imaging team:
  • clean bad images according to results form NINA Session MetaData plug in. Those are the images I do not even care to blink or run through subframe selector. Use criteria: FWHM, guiding stats and number of stars in image to separate the wheat from the chaff.
  • back up phd log, nina log to daily production directory
  • back up daily production
  • save the sequence JSON files
  • move production to synchronization folder
  • use the pdu python api to log on the PDU and verify the mount & camera are OFF. If they are on switch them OFF. Nina should have been doing that already, but it is a second line of defense against the equipment staying on when I run full auto for days.

Anyways, here it is.
https://github.com/erellaz/NINA/blob/main/Nina_day_cleaner.py
Like
blackrig 4.52
...
· 
Here is what it looks like on the telescope Discord server:
Nina_discord.png
Like
 
Register or login to create to post a reply.