I was able to open it in darktable - first converted to dng with PiDNG, though.
For some reason Rawtherapee does not recognize the file at all (it does not show up in the browser). ART gives an error that it cannot open the file.
Perhaps there should be, for instance, camera name and model in the DNG metadata that are then also defined in some configuration file for those programs (camconst.json or something). I’m not an expert on either program…
I made trivial changes to the example program that comes with PiDNG in order to convert your file. Here is my changes to the raw2dng.py file in the examples folder of PiDNG:
from pidng.core import RAW2DNG, DNGTags, Tag
from pidng.defs import *
import numpy as np
import struct
# image specs
width = 4000
height = 3000
bpp= 16
# load raw data into 16-bit numpy array.
numPixels = width*height
#rawFile = '../extras/scene_daylight_211ms_c2.raw16'
rawFile = '../extras/RAWPLAIN16.raw'
rf = open(rawFile, mode='rb')
rawData = struct.unpack("H"*numPixels,rf.read(2*numPixels))
rawFlatImage = np.zeros(numPixels, dtype=np.uint16)
rawFlatImage[:] = rawData[:]
rawImage = np.reshape(rawFlatImage,(height,width))
#rawImage = rawImage >> (16 - bpp)
rawImage *= 64
# uncalibrated color matrix, just for demo.
ccm1 = [[19549, 10000], [-7877, 10000], [-2582, 10000],
[-5724, 10000], [10121, 10000], [1917, 10000],
[-1267, 10000], [ -110, 10000], [ 6621, 10000]]
# set DNG tags.
t = DNGTags()
t.set(Tag.ImageWidth, width)
t.set(Tag.ImageLength, height)
t.set(Tag.TileWidth, width)
t.set(Tag.TileLength, height)
t.set(Tag.Orientation, Orientation.Horizontal)
t.set(Tag.PhotometricInterpretation, PhotometricInterpretation.Color_Filter_Array)
t.set(Tag.SamplesPerPixel, 1)
t.set(Tag.BitsPerSample, bpp)
t.set(Tag.CFARepeatPatternDim, [2,2])
t.set(Tag.CFAPattern, CFAPattern.BGGR)
t.set(Tag.BlackLevel, (4096 >> (16 - bpp)))
t.set(Tag.WhiteLevel, ((1 << bpp) -1) )
t.set(Tag.ColorMatrix1, ccm1)
t.set(Tag.CalibrationIlluminant1, CalibrationIlluminant.D65)
t.set(Tag.AsShotNeutral, [[1,1],[1,1],[1,1]])
t.set(Tag.BaselineExposure, [[-150,100]])
t.set(Tag.Make, "Camera Brand")
t.set(Tag.Model, "Camera Model")
t.set(Tag.DNGVersion, DNGVersion.V1_4)
t.set(Tag.DNGBackwardVersion, DNGVersion.V1_2)
t.set(Tag.PreviewColorSpace, PreviewColorSpace.sRGB)
# save to dng file.
r = RAW2DNG()
r.options(t, path="", compress=False)
r.convert(rawImage, filename="custom")
Of course most of the parameters are still wrong above, but I think this shows it can be done.
I hope this helps,
Harri