Format

NICOS instruments write raw SANS detector images in the BerSANS format (extension .001): ASCII sections marked by %, with metadata in the %File section and comma-separated integer counts in the %Counts section:

%File
FileName=D0665591.001
Type=SANSDRaw
DataSize=16384
DataSizeX=128
DataSizeY=128
...
%Counts
0,0,1,0,2,0,0,1, ...

Import

BornAgain provides a dedicated reader:

from bornagain import ba_io

image = ba_io.read_bersans(fname)

It returns the counts as a float array of shape (height, width), with row 0 at the detector bottom, matching the layout of simulated intensities. The reader accepts gz/bz2-compressed files, and rejects files that declare any type other than SANSDRaw.