I noticed that RawTherapee has a option for using a flat frame to correct an image, and as an astrophotographer I usually take a large number of flat frames and then stack them in SIRIL, which gives me a FITS file. I’d like to use this master flat frame in RawTherapee, but it seems like it doesn’t support FITS format for this particular operation. I’ve tried converting to a TIFF, but that format also doesn’t seem to work, and ImageMagick doesn’t appear to be able to write DNG files.
How should I go about performing this correction? I don’t need to write a FITS file, just read it for the flat field.
To be honest, I don’t know much about this. But since nobody else reponded here is what the rawpedia has to say on the topic:
“It is sufficient to shoot a single flat field image using the same camera body and lens setup as the images you want to apply it to - you do not need several flat-field images with identical settings, unlike dark-frame shots where in order to get higher quality you do need to take several shots with identical settings and merge them. You do not need to merge flat-field shots since merging serves to increase the signal:noise ratio, and this is unnecessary as the flat-field image gets blurred and should have a low ISO.”
At the moment, RawTherapee only allows raw images with the same dimensions to be used as flat-field images. Your best bet is to convert the flat frame into a DNG. There is a thread discussing the creation of synthetic raw images. One of the comments links to this RawPedia section that shows how ExifTool can turn a tiff into a linear DNG. I think it’s possible to create a mosaiced DNG by setting the right tags (probably “CFA” or “Color Filter Array” for PhotometricInterpretation, your camera’s value for CFAPattern, etc.).
I’ll try to dig up one of my scripts tonight (if I remember), but for me, getting stacked FITS files into RT was done as follows:
Output FITS file
Convert to TIFF in ImageMagick
Use exiftool or exiv2 (I can’t remember, either should work) to add appropriate DNG tags to the TIFF to make it a DNG
Alternatively, you can try stacking your flats using pyimageconvert/pystack.py at master · Entropy512/pyimageconvert · GitHub - it lacks a bunch of Siril’s capabilities, but for simply stacking mosaiced raw images without alignment it’s MUCH faster and more memory efficient than siril (or at least was - does siril still convert all input to FITS as an intermediary?) and doesn’t suffer from precision truncation of the output.
SIRIL does convert to FITS as an intermediary, and honestly I wish I could use FITS images in RawTherapee since I use them for pretty much all my imaging. SIRIL outputs are always 32 bit float unless specified otherwise, so I don’t know if there is an issue with precision truncation here?