Author Topic: Calibration of DSLR/OSC frames and BatchPreprocessing  (Read 3618 times)

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Howdy folks -

i have been discussing calibration of OSC images on another forum, and i've come across a couple of questions and things that need validation. hopefully people that use DSLRs and BPP can fill me in. since i started with PI long before BPP i pretty much never use it, and it's been years since i've used a DSLR or any kind of OSC.

1) from reading the source code to BatchPreProcessing, i believe that:
    a. bias subs are not calibrated by the script unless overscan regions are turned on, hence the master bias is usually uncalibrated.
    b. dark subs are not calibrated by the script, and so the master dark created is uncalibrated. if dark scaling is desired, the script is doing the equivalent of ticking "calibrate" and "optimize" on the dark master during light calibration.
    c. flat subs are calibrated, however, they are calibrated by scaling the closest matching dark. there is no option to calibrate flats with bias only.

is this correct? in particular if c. is correct, then it means that one could prepare a calibrated master flat either external to BPP or by using BPP on only the flats, and in a later run of BPP (when calibrating lights) select this master flat. it will be used by the script untouched while calibrating lights. the flat could in theory be calibrated only with bias frames if the user so desires.

in the context of DSLR astrophotograhy, if you happen to take flats at a different ISO than your lights, this flow would be the only correct way to calibrate your lights. if instead you dumped your lights and flats into the script, assuming the darks and biases have the same ISO as the lights, the flat calibration/scaling will be wrong, as the darks used are not of the same ISO as the flats.

2) flat scaling in OSC cameras

my understanding from reading HAIP is that when OSC images are flat-calibrated, any color bias in the flat is not important. however, it may be important in the sense that at least in pixinsight, a single flat scaling multiplier is computed for the entire flat in CFA form, and so if the flat has a strong color cast, the scaling factor might not be accurate if the histograms of the 3 channels are not similar to one another, that is, the debayered flat is grey when an equal stretch is applied to all 3 channels, such as with STF with the channels locked. also regardless of scaling, if one channel is weak then the flat SNR in that channel is compromised and the calibration may be suboptimal.

is this correct? or will flat scaling be correct despite a color bias in a flat, and the only problem is related to SNR of the weak channel(s)?

thanks,

rob



Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: Calibration of DSLR/OSC frames and BatchPreprocessing
« Reply #1 on: 2016 April 18 17:18:49 »
Rob,

On flatfield SNR, IMO SNR of weak channel is an issue no matter what. I would want to expose for the weakest channel (e.g. more flatfield subs needed).

On flatfield scaling, IMO a test might be worthwhile (e.g. apply iif(x() % 2 == 0 && y() % 2 == 0, 0.5 * $T, $T) to the flatfield which weakens one of the channels), and see how color balance of lights is affected. (You may need to change one or both of the "0"'s to "1"'s to weaken blue or red rather than one of the greens).

If a single scale factor is used for all channels (likely?), then a target object whose color balance happens to equal the color balance of the flatfield will end up being "white" (r == g == b) after flatfielding.

Thanks,
Mike

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Calibration of DSLR/OSC frames and BatchPreprocessing
« Reply #2 on: 2016 April 18 17:38:56 »
OK, i will mess around with that. perhaps easiest is to just flatten a flat sub with a master flat and see what color it ends up being. i do have a bunch of old flats with bad color casts lying around somewhere.

rob




Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: Calibration of DSLR/OSC frames and BatchPreprocessing
« Reply #3 on: 2016 April 18 17:52:45 »
yes good idea

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Calibration of DSLR/OSC frames and BatchPreprocessing
« Reply #4 on: 2016 April 18 19:50:22 »
you know what, i think there is a difference between CFA and bayer RGB. i happened to have an old master flat in bayer RGB format and when i used it to calibrate a flat sub, i noticed 3 scaling factors. earlier today i was working with mono CFA flats and there was only one scaling factor, which makes sense.

BPP seems to call DSLR_RAW with "raw cfa" which i assume means that any CR2 files given to the script are converted to mono CFA files.

it seems like there's an inherent advantage to using bayer RGB with respect to flat scaling, so i wonder why BPP explcitly uses mono CFA? there must be some other advantage to that format for purposes of the script...

rob

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Calibration of DSLR/OSC frames and BatchPreprocessing
« Reply #5 on: 2016 April 18 21:19:17 »
OK - well i did the experiment and sure enough, in the case where the input files are mono CFA, the resultant calibrated flat is (relatively) grey. if the input files are bayer RGB then there's a cast in the output, since each channel was scaled separately.

in this case the input flats were taken thru an astronomik Ha filter so they have a serious color cast. regardless, aside from a multiplicative factor, each channel of both images are perfectly identical; diving one calibrated flat by the other produces an image that is constant in each channel.

so it would appear that both representations of OSC data yield exactly the same results - maybe not a surprise. this project started out as an attempt to understand what might cause a flat to overcorrect an image; probably this is entirely due to mis-calibration of the flat rather than the signal levels in the flat.

rob