How to handle Dark Current Correction with rawpy

148 views Asked by At

I'm trying to process a .NEF-file with rawpy. Before applying bad_pixel_fix_, white balance, etc. I want to subtract a dark-frame for the dark-current correction. I solve this by getting the ADU-values of the image with rawpy's raw_image-method and subtract the two images from one another.

Now my problem is that the raw_image-method returns a numpy ndarray and I'm not able to convert it back to a rawpy-object for the further processing.

Are there any ideas on how to further processs the numyp array or are there any better approaches on how to deal with dark current correction?

Any help is highly appreciated!

1

There are 1 answers

2
letmaik On

You can override the contents of the raw_image property like so:

raw.raw_image[:] = corrected_raw_image

Any subsequent operations will use the modified RAW image data.