How do I import raw image file?

I am trying to import an 1024 x 1024 raw image from a CCD. The image lookes as follows

Importing with
Import["test.bin", "RawBitmap", ImageSize -> {1024,1024}]

gives an error message.

Import["test.bin", "RawBitmap", ImageSize ->1024]
works, but gives a somewhat altered image (1024 x 2048 px!):

Any ideas what happened here? I would love to provide the sample file “test.bin”, but the format is not supported.
Regards,
Constanze

Maybe using LibraryLink to create a c++ library,which read your CCD image with the help of LibRaw, convert CCD image to MImage_new2D and return to Mathematica Language.

Wolfram LibraryLink User Guide is what you need.

The last example in this tutorial shows how to use Wolfram LibraryLink and LibRaw to import Raw images.