ARW processing color shift

I am working on some ARW files but having some color shifting problem in raw post-processing. The color seems to be totally shifted specially the red channel values when i compare it with other consumer grade software (adobe PS, RAW therapee). It maybe a bug or perhaps i am doing something wrong. Please help
My raw.postprocess parameters
use_auto_wb=False,use_camera_wb=True,no_auto_bright=False,output_color=rawpy.ColorSpace.sRGB,fbdd_noise_reduction=rawpy.FBDDNoiseReductionMode(0),output_bps=16

Forums: 

issue solved

The problem was related with openCV not rawpy or libraw. OpenCV uses BGR format,not RGB. so when i used cv2.imshow() after debayering using libraw , the colors swapped in R and B channel.

Sloution: convert RGB matrix to BGR before using cv2.imshow(). Open CV has a builtin function to do so, cv2.cvtColor(img, cv2.COLOR_RGB2BGR)