Pysiril file names and output

Hello,

I’m trying out pysiril for .bat file preprocessing my astroimages.
I’m able to run the preprocess command which performs bias, dark and flat calibration including debayer.
However in the output folder it saves both my calibration frames, the raw frames and the calibrated frames. But I only need the calibrated files. Outputting all frames only fills up hard disk space. Any way of turning this off?
Also the file names are just renamed pp_light00nn.FIT but I need the original filename on the pp_ output files. Any way to specify this in pysiril?

BR,
JP.

Hi,

good you’re trying pySiril, it is a fantastic tool…
Regarding your specific question, you can refer to this answer here: File name of calibrared and registered - #8 by cissou8 to find back the original name and rename your calibrated files as you like.
Regarding not generating the intermediate files, pySiril primary intention is to provide a wrapper around Siril commands, and no such option exists in Siril, so the same goes for pySiril. However, as you are using python, you can do whatever you like to dispose of any of these files. I believe there are a few methods to do so in PySiril::Addons which is a convenience class that adds extra capabilities to the classic Siril commands. Otherwise, as said, it’s nothing too difficult using python or shell commands.

Cheers,

C.

Hello cissou8,

Thaks for the tip - the problem is I’m not a programmer just a copycat;)
So when it comes to coding I need some good examples to get it done in a realistic timeframe, so it seems this will need more time than I have right now.
I use Pixinsight for pre and postprocessing, but I have been looking for a easier solution for preprosessing that is possible to automate. I want to be able to automatically calibrate and debayer frames on the go as they are saved or after each session so I was hoping that pysiril would be an easy solution for this. I’m sure this is possible but for the moment it seems II’ll have to stick to my tedious and time consuming pixinsight process for the time being.

BR,
JP.

Hi Joachim,

If you decide to spend a bit of time and write smthg, do not hesitate to ask and I’ll give a look.
The commands you are probably after are:

  • lightfilename=calibfilename.replace(‘r_pp_’,’’) #to remove the prefix
  • originalfilename=os.path.normpath(lightfilename) #to follow the symlink
  • outfolder=os.path.join(os.path.split(originalfilname)[0],‘processed’) #to generate an output folder name
  • os.makedirs(outfolder, exist_ok = True) #to create said output folder
  • outfilename=os.path.join(outfolder,os.path.split(originalfilename)[1]) #to create the dst filename
  • shutil.copy(calibfilename, outfilename) #to make the copy
    Of course, you will have to make tests as I have no idea whatsoever on how your files are organized…
    Automation is key in this hobby (it’s a good part of the fun if you ask me), so keep on trying :wink:

Cheers,

C.