Proposal:

1. Store calibration files in a subdirectory (axiombeta-calibration) 2. That subdirectory can be placed in a way similar to dcraw's badpixels file:

dcraw badpixels (from man page):

./.badpixels, ../.badpixels, ../../.badpixels, ...

beta calibration files

./axiombeta-calibration ../axiombeta-calibration ../../axiombeta-calibration

or maybe also ~/axiombeta-calibration ?

3. Inside that subdirectory, we can have a generic profile (one size fits all) and various profiles for different setting combinations (that can cover either just one particular situation, or can also be generic to some degree):

axiombeta-calibration/generic/
axiombeta-calibration/gain1_expo1-50/
axiombeta-calibration/gain1_expo100-1000/
axiombeta-calibration/blacksun8192_expo100-1000/

That means, from all the settings that might affect the calibration, we can build an unique name from the settings that differ from the generic profile. A calibration might cover files at some particular setting value, or some range of values (detected from the supplied input files during calibration).

When selecting a profile, we may want to choose the one with the narrowest setting range that fits the settings of the file being rendered (that one should probably give the lowest calibration errors). If no match is found, the generic profile will be used.

Or, we may want to test the profile against some validation data, store the results, and pick the profile likely to minimize the calibration errors (some solid math skills required for this one).

4. Inside one profile, we can have the following calibration files (all optional; if missing, no correction is done for that specific parameter):

For black calibration:

beforegain.pgm : static offsets whose source is before the gain amplifiers (that means, will be multiplied by gain, then subtracted)
aftergain.pgm  : static offsets whose source is after the gain amplifiers
darkcurrent.pgm: dynamic offsets dependent on many variables (exposure, temperature, gain), whose scaling factor can be measured from hot pixels (idea from [1])

These 3 files allow computing a dark frame for every gain/expo/temperature combination (at least in theory), and should generalize fairly well to other settings (to be tested).

Other calibration files:

gainframe.pgm   : per-pixel gain variations
clipframe.pgm   : clipping offsets (might be changed)
responseXXXX.pgm: per-pixel response curve data point (raw sensor outputs that should give the corrected value XXXX)
lut.spi1d       : overall or per-channel response curve (shaper)

5. Color calibration files should be independent of sensor profiling (if they are not, we probably did a poor job with calibrating the sensor), so we'll place them in a different directory:

axiombeta-calibration/color-profiles/

These depend on other things, like ambient light and maybe lens used, so we could think about something like:

axiombeta-calibration/color-profiles/D50/
axiombeta-calibration/color-profiles/Tungsten/
axiombeta-calibration/color-profiles/OsramDulux/                 # model of the light bulbs
axiombeta-calibration/color-profiles/InTheCave/                  # or the location where the calibration was performed
axiombeta-calibration/color-profiles/D50/EF50mm_f/1.8_II/        # from lens metadata

Those variables will be entered manually by the user (or chosen from a pickbox from a GUI), except maybe lens metadata, where it can be obtained from the lens itself (when the lens communication will be functional).

6. Color profile formats:

- ICC (as saved by argyll)
- config.ocio files?
- ...

7. A way to identify which sensor or camera is used (by serial numbers) could be very helpful for those who own more than one camera, or more than one sensor.