A "DC Offset"- means you just add a value to every pixel on right hand side.
A "Gain"- means you also need to multiply the pixel by a value. "Linear" means it is just a simple multiply, one value that does not change. Usually that works. You need a two-point calibration, one grey scale that is closer to black, one grey scale that is closer to white.
I wrote my code to ask for the directory name, read all the files in it, and process all of them. I create a copy of the file- give it a "c" for the first letter in the name- for "corrected". The files open in Lightroom, or any other DNG processor. The files that it processes must be straight out of the camera, not those from Photoshop or anything else.
Most of the code is written already. I used the Watcom Fortran-77 compiler, so it runs from XP to Win10. Most of the complicated code is to read in and parse the DNG file to get to the actual pixels. Adding code to do a non-uniformity correction means swapping out code in one subroutine. I would also offer the code as is to Dan, or if a new version does the trick- he can have that.
I use the same program to compute vignetting, reads in and process the DNG files. SO- Stop down to F8 or so when taking pictures of the grey cards.
I can probably use the same code to compute the corrections.
I've not dug into the firmware on the cameras- that can take some time. What I like about my own code: Much of it was written in the 1980s, when digital imagers were mostly in the R&D phase. Spent the 1980s doing that.