Index: src/sas/sascalc/file_converter/BSLLoader.py
===================================================================
--- src/sas/sascalc/file_converter/BSLLoader.py	(revision 18e73093a1cac56cb9c9fb237df8a08062ab6d5f)
+++ src/sas/sascalc/file_converter/BSLLoader.py	(revision 18e73093a1cac56cb9c9fb237df8a08062ab6d5f)
@@ -0,0 +1,16 @@
+from sas.sascalc.file_converter.core.bsl_loader import CLoader
+
+class BSLLoader(CLoader):
+
+    # See invertor.py for implementation of pickling and setters/getters
+
+
+    # def __setattr__(self, name, value):
+    #     # if name == 'param':
+    #     #     return self.set_param(value)
+    #     return CBSLLoader.__set_attr__(self, name, value)
+    #
+    # def __getattr__(self, name):
+    #     if name == 'val':
+    #         return self.get_val()
+    #     return CBSLLoader.__getattr__(self, name)
Index: src/sas/sascalc/file_converter/c_ext/bsl_loader.c
===================================================================
--- src/sas/sascalc/file_converter/c_ext/bsl_loader.c	(revision 18e73093a1cac56cb9c9fb237df8a08062ab6d5f)
+++ src/sas/sascalc/file_converter/c_ext/bsl_loader.c	(revision 18e73093a1cac56cb9c9fb237df8a08062ab6d5f)
@@ -0,0 +1,164 @@
+#include <Python.h>
+#include <numpy/arrayobject.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "structmember.h"
+#include "bsl_loader.h"
+
+typedef struct {
+    PyObject_HEAD
+    CLoader_params params;
+} CLoader;
+
+static PyObject *CLoader_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
+    CLoader *self;
+
+    self = (CLoader *)type->tp_alloc(type, 0);
+
+    return (PyObject *)self;
+}
+
+static PyObject *CLoader_init(CLoader *self, PyObject *args, PyObject *kwds) {
+    const char *filename;
+    const int frame;
+    const int n_pixels;
+    const int n_rasters;
+    if (self != NULL) {
+        if (!PyArg_ParseTuple(args, "siii", &filename, &frame, &n_pixels, &n_rasters))
+            Py_RETURN_NONE;
+        if (!(self->params.filename = malloc(strlen(filename) + 1)))
+            Py_RETURN_NONE;
+        strcpy(self->params.filename, filename);
+        self->params.n_pixels = n_pixels;
+        self->params.n_rasters = n_rasters;
+    }
+
+    return 0;
+}
+
+static void CLoader_dealloc(CLoader *self) {
+    free(self->params.filename);
+    self->ob_type->tp_free((PyObject *)self);
+}
+
+static PyObject *to_string(CLoader *self, PyObject *params) {
+    char str[100];
+    sprintf(str,
+        "Filename: %s\nframe: %d\nn_pixels: %d\nn_rasters: %d\n",
+        self->params.filename,
+        self->params.frame,
+        self->params.n_pixels,
+        self->params.n_rasters);
+    return Py_BuildValue("s", str);
+}
+
+static PyObject *load_data(CLoader *self, PyObject *args) {
+    int raster;
+    int pixel;
+    int frame_pos;
+    int size[2] = {self->params.n_rasters, self->params.n_pixels};
+    float cur_val;
+    PyObject *read_val;
+    FILE *input_file;
+    PyArrayObject *data;
+
+    printf("load_data called\n");
+
+    if (!PyArg_ParseTuple(args, "O!", &PyArray_Type, &data)) {
+        printf("Failed parsing PyArray object");
+        return NULL;
+    }
+
+    input_file = fopen(self->params.filename, "rb");
+    if (!input_file) {
+        printf("Failed opening file\n");
+        return NULL;
+    }
+
+    printf("Calculating frame_pos\n");
+    frame_pos = self->params.n_pixels * self->params.n_rasters * self->params.frame;
+    printf("frame_pos: %d\n", frame_pos);
+    fseek(input_file, frame_pos*sizeof(float), SEEK_SET);
+    printf("fseek completed\n");
+
+    for (raster = 0; raster < self->params.n_rasters; raster++) {
+        for (pixel = 0; pixel < self->params.n_pixels; pixel++) {
+            fread(&cur_val, sizeof(float), 1, input_file);
+            PyArray_SETITEM(data, PyArray_GETPTR2(data, raster, pixel), PyFloat_FromDouble(cur_val));
+            read_val = PyArray_GETITEM(data, PyArray_GETPTR2(data, raster, pixel));
+        }
+    }
+    printf("Data read.\n");
+
+    fclose(input_file);
+    printf("File closed\n");
+    Py_DECREF(data);
+    printf("Function completed\n");
+    return Py_BuildValue("O", data);
+}
+
+static PyMethodDef CLoader_methods[] = {
+    { "to_string", (PyCFunction)to_string, METH_VARARGS, "Print the objects params" },
+    {"load_data", (PyCFunction)load_data, METH_VARARGS, "Load the data into a numpy array"},
+    {NULL}
+};
+
+static PyMemberDef CLoader_members[] = {
+    {NULL}
+};
+
+static PyTypeObject CLoaderType = {
+    PyObject_HEAD_INIT(NULL)
+    0,                         /*ob_size*/
+    "CLoader",             /*tp_name*/
+    sizeof(CLoader),             /*tp_basicsize*/
+    0,                         /*tp_itemsize*/
+    (destructor)CLoader_dealloc, /*tp_dealloc*/
+    0,                         /*tp_print*/
+    0,                         /*tp_getattr*/
+    0,                         /*tp_setattr*/
+    0,                         /*tp_compare*/
+    0,                         /*tp_repr*/
+    0,                         /*tp_as_number*/
+    0,                         /*tp_as_sequence*/
+    0,                         /*tp_as_mapping*/
+    0,                         /*tp_hash */
+    0,                         /*tp_call*/
+    0,                         /*tp_str*/
+    0,                         /*tp_getattro*/
+    0,                         /*tp_setattro*/
+    0,                         /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
+    "CLoader objects",           /* tp_doc */
+    0,		               /* tp_traverse */
+    0,		               /* tp_clear */
+    0,		               /* tp_richcompare */
+    0,		               /* tp_weaklistoffset */
+    0,		               /* tp_iter */
+    0,		               /* tp_iternext */
+    CLoader_methods,             /* tp_methods */
+    CLoader_members,             /* tp_members */
+    0,                         /* tp_getset */
+    0,                         /* tp_base */
+    0,                         /* tp_dict */
+    0,                         /* tp_descr_get */
+    0,                         /* tp_descr_set */
+    0,                         /* tp_dictoffset */
+    (initproc)CLoader_init,      /* tp_init */
+    0,                         /* tp_alloc */
+    CLoader_new,                 /* tp_new */
+};
+
+PyMODINIT_FUNC
+initbsl_loader(void)
+{
+    PyObject *module;
+    module = Py_InitModule("bsl_loader", NULL);
+    import_array();
+
+    if (PyType_Ready(&CLoaderType) < 0)
+        return;
+
+    Py_INCREF(&CLoaderType);
+    PyModule_AddObject(module, "CLoader", (PyObject *)&CLoaderType);
+}
Index: src/sas/sascalc/file_converter/c_ext/bsl_loader.h
===================================================================
--- src/sas/sascalc/file_converter/c_ext/bsl_loader.h	(revision 18e73093a1cac56cb9c9fb237df8a08062ab6d5f)
+++ src/sas/sascalc/file_converter/c_ext/bsl_loader.h	(revision 18e73093a1cac56cb9c9fb237df8a08062ab6d5f)
@@ -0,0 +1,15 @@
+#ifndef bsl_loader_h
+#define bsl_loader_h
+
+typedef struct {
+    // File to load
+    char *filename;
+    // Frame to load
+    int frame;
+    // Number of pixels in the file
+    int n_pixels;
+    // Number of rasters in the file
+    int n_rasters;
+} CLoader_params;
+
+#endif
