Index: example/latex_smeared_out_0.txt
===================================================================
--- example/latex_smeared_out_0.txt	(revision 1a4d4c0aca8494eb0d3fcd09e8c26f2fb1388d46)
+++ example/latex_smeared_out_0.txt	(revision 1a4d4c0aca8494eb0d3fcd09e8c26f2fb1388d46)
@@ -0,0 +1,302 @@
+<X>   <Y>   <dY>   <dX>
+0.003797  4006.06  160.351  0.00109
+0.004197  1594.13  144.194  0.001093
+0.004596  772.578  47.4453  0.001096
+0.004996  491.193  1.64213  0.0011
+0.005396  339.222  18.6638  0.001105
+0.005795  234.025  10.9659  0.001111
+0.006195  167.756  14.4727  0.001117
+0.006595  127.185  11.3388  0.001124
+0.006995  97.8743  7.72497  0.001131
+0.007394  75.7387  1.28727  0.00114
+0.007794  59.9675  5.6673  0.001148
+0.008194  48.5643  0.775068  0.001157
+0.008593  39.5624  2.9947  0.001167
+0.008993  32.4132  0.11281  0.001177
+0.009393  26.9845  1.75595  0.001187
+0.009792  22.7193  1.70873  0.001198
+0.01019  19.1396  0.870622  0.001209
+0.01059  16.3107  1.27846  0.00122
+0.01099  13.9942  1.09312  0.001232
+0.01139  12.0789  0.321913  0.001244
+0.01179  10.4539  0.82622  0.001257
+0.01219  9.10093  0.719849  0.00127
+0.01259  8.00642  0.684723  0.001283
+0.01299  7.04569  0.1667  0.001296
+0.01339  6.21725  0.153869  0.00131
+0.01374  6.74668  0.184976  0.002327
+0.01379  5.51301  0.118763  0.001324
+0.01419  4.91258  0.17697  0.001338
+0.01459  4.39  0.311353  0.001353
+0.01499  3.94346  0.38786  0.001367
+0.01505  4.50083  0.013978  0.002353
+0.01539  3.54651  0.231355  0.001382
+0.01579  3.20079  0.236882  0.001397
+0.01619  2.8957  0.0558839  0.001413
+0.01636  3.14491  0.286904  0.002381
+0.01659  2.62598  0.0778103  0.001429
+0.01699  2.38848  0.123004  0.001444
+0.01738  2.17876  0.177344  0.001461
+0.01767  2.26909  0.17148  0.002411
+0.01778  1.99128  0.077618  0.001477
+0.01818  1.82792  0.0244195  0.001493
+0.01858  1.67849  0.0887006  0.00151
+0.01898  1.68662  0.0465056  0.002444
+0.01898  1.68662  0.0287818  0.001527
+0.01938  1.4241  0.040758  0.001544
+0.01978  1.3155  0.0341713  0.001561
+0.02018  1.2177  0.0391147  0.001578
+0.02029  1.28605  0.117319  0.002479
+0.02058  1.12934  0.0695536  0.001596
+0.02098  1.04908  0.103946  0.001613
+0.02138  0.976282  0.0294678  0.001631
+0.0216  1.00273  0.01241  0.002515
+0.02178  0.911738  0.0287996  0.001649
+0.02218  0.851316  0.00949506  0.001667
+0.02258  0.79612  0.00735078  0.001685
+0.0229  0.796271  0.0803724  0.002554
+0.02298  0.745657  0.0597791  0.001703
+0.02338  0.699515  0.00790529  0.001722
+0.02378  0.657153  0.0586252  0.00174
+0.02418  0.618262  0.0168711  0.001759
+0.02421  0.644819  0.0494125  0.002594
+0.02458  0.582489  0.0188058  0.001778
+0.02498  0.549546  0.0417924  0.001797
+0.02537  0.519158  0.00547406  0.001816
+0.02552  0.530684  0.00553776  0.002636
+0.02577  0.491088  0.0220638  0.001835
+0.02617  0.465767  0.00219192  0.001854
+0.02657  0.441691  0.00224346  0.001873
+0.02683  0.442667  0.021504  0.00268
+0.02697  0.419376  0.0277205  0.001892
+0.02737  0.398683  0.00203185  0.001912
+0.02777  0.379442  0.0180346  0.001931
+0.02814  0.374856  0.000629509  0.002725
+0.02817  0.361565  0.0022687  0.001951
+0.02857  0.344921  0.0340542  0.001971
+0.02897  0.329395  0.00707027  0.00199
+0.02937  0.314925  0.0241933  0.00201
+0.02944  0.32148  0.0292489  0.002771
+0.02977  0.301413  0.0230294  0.00203
+0.03017  0.288785  0.0104349  0.00205
+0.03057  0.277263  0.0231223  0.00207
+0.03075  0.278702  0.0122599  0.002819
+0.03097  0.266183  0.0212227  0.00209
+0.03137  0.2558  0.00512776  0.00211
+0.03176  0.246072  0.00419684  0.002131
+0.03206  0.244583  0.0172838  0.002868
+0.03216  0.23693  0.0212266  0.002151
+0.03256  0.228344  0.0200454  0.002171
+0.03296  0.220281  0.0220163  0.002192
+0.03336  0.212684  0.020541  0.002212
+0.03337  0.216673  0.00536164  0.002918
+0.03376  0.205538  0.0141463  0.002233
+0.03416  0.198805  0.0141397  0.002253
+0.03456  0.192456  0.00119407  0.002274
+0.03467  0.194003  0.0119743  0.00297
+0.03496  0.186609  0.013586  0.002295
+0.03536  0.180954  0.00501272  0.002316
+0.03576  0.175605  0.0158523  0.002336
+0.03598  0.175128  0.0164386  0.003022
+0.03616  0.170531  0.0141909  0.002357
+0.03656  0.165751  0.0154903  0.002378
+0.03695  0.161246  0.0134668  0.002399
+0.03729  0.159547  0.00168878  0.003075
+0.03735  0.156933  0.00687817  0.00242
+0.03775  0.152848  0.00991327  0.002441
+0.03815  0.149048  0.00286749  0.002462
+0.03855  0.145384  0.00387577  0.002483
+0.0386  0.146384  0.0109531  0.00313
+0.03895  0.141917  0.00406869  0.002504
+0.03935  0.138688  0.00523333  0.002525
+0.03975  0.135632  0.00371785  0.002547
+0.0399  0.135379  0.0110586  0.003185
+0.04015  0.132475  0.00657339  0.002568
+0.04055  0.129651  0.0105797  0.002589
+0.0407  0.135016  0.010121  0.004896
+0.04095  0.127208  0.0113851  0.00261
+0.04121  0.125964  0.00229885  0.003241
+0.04134  0.124426  0.00470491  0.002632
+0.04174  0.121751  0.0104201  0.002653
+0.04214  0.119907  0.00478612  0.002675
+0.04252  0.118032  0.00711389  0.003298
+0.04254  0.117719  0.00842475  0.002696
+0.04294  0.114902  0.00187717  0.002717
+0.04334  0.11339  0.00784272  0.002739
+0.04374  0.112055  0.00323708  0.00276
+0.04382  0.11117  0.00177199  0.003356
+0.04457  0.111162  0.00477407  0.005008
+0.04513  0.10534  0.011246  0.003414
+0.04644  0.100213  0.00950031  0.003473
+0.04774  0.0957801  0.00552336  0.003533
+0.04844  0.0962656  0.000920809  0.005127
+0.04905  0.0918706  0.00349038  0.003593
+0.05035  0.0884226  0.00115125  0.003654
+0.05166  0.0855054  0.00994029  0.003716
+0.05231  0.0867504  0.00566911  0.005254
+0.05296  0.0830818  0.00666713  0.003778
+0.05427  0.0811207  0.0074602  0.00384
+0.05557  0.079487  0.00353932  0.003903
+0.05618  0.0803397  0.00188154  0.005387
+0.05688  0.0779981  0.00915173  0.003967
+0.05818  0.0765054  0.00422076  0.004031
+0.05949  0.0750177  0.00463642  0.004095
+0.06004  0.0744534  0.000653902  0.005526
+0.06079  0.0736271  0.00378671  0.00416
+0.0621  0.0724887  0.000498991  0.004225
+0.0634  0.0716005  0.00354187  0.00429
+0.06391  0.0681489  0.00165855  0.005671
+0.0647  0.0708574  0.00389765  0.004356
+0.06601  0.0700572  0.00248225  0.004422
+0.06731  0.0691437  0.0077172  0.004488
+0.06777  0.0647272  0.00253797  0.005821
+0.06861  0.0682506  0.0064718  0.004555
+0.06991  0.0675541  0.00121909  0.004622
+0.07122  0.0671144  0.00342322  0.004689
+0.07163  0.0663921  0.00432163  0.005975
+0.07252  0.0667916  0.001663  0.004756
+0.07382  0.0663952  0.0017736  0.004824
+0.07512  0.0658687  0.00720148  0.004892
+0.07548  0.0669862  0.00178997  0.006134
+0.07642  0.0653305  0.000526446  0.00496
+0.07772  0.0649219  0.00682181  0.005029
+0.07903  0.0646575  0.00143881  0.005097
+0.07934  0.064797  0.0027576  0.006297
+0.08033  0.0644343  0.000428514  0.005166
+0.08163  0.0641604  0.0070179  0.005235
+0.08293  0.0638446  0.00535247  0.005304
+0.08319  0.0638274  0.00261353  0.006463
+0.08423  0.0635538  0.00445288  0.005373
+0.08552  0.0633235  0.00729931  0.005443
+0.08682  0.0631333  0.00299518  0.005512
+0.08704  0.0631156  0.00316068  0.006633
+0.08812  0.0629518  0.00565525  0.005582
+0.08942  0.0627731  0.00521701  0.005652
+0.09072  0.0626095  0.00463162  0.005722
+0.09089  0.0626499  0.000325069  0.006806
+0.09202  0.0624599  0.00130131  0.005792
+0.09331  0.0623193  0.0038679  0.005862
+0.09461  0.0621841  0.0017932  0.005933
+0.09473  0.0621987  0.00159306  0.006981
+0.09591  0.0620583  0.00448677  0.006003
+0.0972  0.0619407  0.0031727  0.006074
+0.0985  0.0618316  0.00644575  0.006144
+0.09857  0.0618537  0.00228425  0.00716
+0.0998  0.0617265  0.00010975  0.006215
+0.1011  0.0616292  0.00069786  0.006286
+0.1024  0.0615505  5.81126e-05  0.00734
+0.1024  0.0615505  0.00220706  0.006357
+0.1037  0.0614432  0.00461344  0.006428
+0.105  0.0613557  0.00388457  0.006499
+0.1062  0.061307  0.00342626  0.007523
+0.1063  0.0612716  0.00490766  0.00657
+0.1076  0.0611905  0.00690639  0.006642
+0.1089  0.0611136  0.00312108  0.006713
+0.1101  0.0611149  0.00631372  0.007708
+0.1102  0.0610438  0.00491988  0.006784
+0.1114  0.0609843  0.00162792  0.006856
+0.1127  0.0609359  0.000522921  0.006928
+0.1139  0.0609644  0.0018573  0.007894
+0.114  0.0608901  0.00241839  0.006999
+0.1153  0.0608509  0.0058435  0.007071
+0.1166  0.0608159  0.00494211  0.007143
+0.1177  0.0608463  0.003438  0.008083
+0.1179  0.0607827  0.00103131  0.007214
+0.1192  0.0607507  0.00108194  0.007286
+0.1205  0.0607197  0.00469422  0.007358
+0.1216  0.0607285  0.00436273  0.008272
+0.1218  0.0606901  0.00568642  0.00743
+0.1231  0.0606614  0.00493913  0.007502
+0.1243  0.0606313  0.00262958  0.007574
+0.1254  0.0605124  0.00458272  0.008464
+0.1256  0.0605978  0.000380796  0.007646
+0.1269  0.0605573  0.00616227  0.007718
+0.1282  0.0605242  0.00570397  0.00779
+0.1292  0.0602981  0.00055111  0.008656
+0.1295  0.0605001  0.00478302  0.007862
+0.1308  0.0604825  0.000855793  0.007934
+0.1321  0.0604629  0.00657395  0.008007
+0.133  0.0602505  0.00414749  0.00885
+0.1334  0.0604335  0.00304607  0.008079
+0.1346  0.0603955  0.00217981  0.008151
+0.1359  0.0603399  0.00657831  0.008223
+0.1368  0.0604853  0.00566644  0.009045
+0.1372  0.0603197  0.00534151  0.008296
+0.1385  0.0603094  0.00284853  0.008368
+0.1398  0.0602967  0.00295337  0.00844
+0.1406  0.0603607  0.00487405  0.009241
+0.1411  0.0602743  0.00349396  0.008513
+0.1423  0.060248  0.00566498  0.008585
+0.1444  0.0602321  0.00726208  0.009437
+0.1482  0.0602373  0.000551871  0.009635
+0.152  0.0601918  0.000174825  0.009833
+0.1558  0.0601626  0.00506296  0.01003
+0.1596  0.0601247  0.00275908  0.01023
+0.1633  0.0601072  0.00318664  0.01043
+0.1671  0.0600827  0.00679728  0.01063
+0.1709  0.060062  0.00510791  0.01083
+0.1746  0.0600405  0.00171873  0.01104
+0.1784  0.060017  0.00481894  0.01124
+0.1821  0.0599997  0.00523105  0.01144
+0.1859  0.0600346  0.00446256  0.01164
+0.1896  0.0600406  0.00110037  0.01185
+0.1934  0.0599392  0.00479194  0.01205
+0.1971  0.0599562  0.000864313  0.01225
+0.2008  0.0599802  0.00347171  0.01246
+0.2045  0.0599178  0.000373845  0.01266
+0.2082  0.0599556  0.00307239  0.01286
+0.2119  0.0599215  0.00516388  0.01307
+0.2156  0.0599286  0.00708695  0.01327
+0.2193  0.0599152  0.00129626  0.01348
+0.223  0.0599147  0.00657813  0.01368
+0.2267  0.0599125  0.00192308  0.01388
+0.2304  0.0599062  0.00528098  0.01409
+0.234  0.0599036  0.00450717  0.01429
+0.2377  0.059902  0.00715206  0.0145
+0.2414  0.0598986  0.000232374  0.0147
+0.245  0.0598751  0.0014432  0.0149
+0.2486  0.0598816  0.00708249  0.01511
+0.2523  0.0598949  0.00121759  0.01531
+0.2559  0.0598726  0.00278898  0.01551
+0.2595  0.0598866  0.00590043  0.01571
+0.2631  0.0598715  0.0050679  0.01592
+0.2667  0.0598797  0.00413815  0.01612
+0.2703  0.0598696  0.000570358  0.01632
+0.2739  0.0598747  0.00514749  0.01652
+0.2775  0.0598711  0.00233949  0.01673
+0.2811  0.0598652  0.00130688  0.01693
+0.2847  0.0598696  0.00145841  0.01713
+0.2882  0.0598647  0.0064527  0.01733
+0.2918  0.0598627  0.00743014  0.01753
+0.2953  0.0598615  0.00159526  0.01773
+0.2988  0.0598641  0.00532105  0.01793
+0.3024  0.0598612  0.00362077  0.01813
+0.3059  0.0598554  0.000694343  0.01833
+0.3094  0.0598611  0.000164907  0.01853
+0.3129  0.0598565  0.000292255  0.01873
+0.3164  0.0598574  0.00173369  0.01893
+0.3199  0.0598565  0.00656001  0.01912
+0.3234  0.0598545  0.0014528  0.01932
+0.3268  0.059854  0.000379713  0.01952
+0.3303  0.0598554  0.000238661  0.01972
+0.3338  0.0598527  0.00604867  0.01991
+0.3372  0.0598518  0.00241504  0.02011
+0.3406  0.0598537  0.00486344  0.0203
+0.3441  0.05985  0.00299483  0.0205
+0.3475  0.059851  0.00582814  0.0207
+0.3509  0.0598507  0.003436  0.02089
+0.3543  0.0598513  0.00375554  0.02108
+0.3577  0.059847  0.00145158  0.02128
+0.3611  0.0598505  0.00265475  0.02147
+0.3645  0.0598483  0.00674573  0.02166
+0.3678  0.0598487  0.00111161  0.02186
+0.3712  0.0598477  0.0030374  0.02205
+0.3745  0.0598483  0.00364758  0.02224
+0.3779  0.0598469  0.00247959  0.02243
+0.3812  0.0598471  0.003716  0.02262
+0.3845  0.0598463  0.00453922  0.02281
+0.3878  0.0598466  0.00677953  0.023
+0.3911  0.0598456  0.0072377  0.02319
+0.3944  0.0598463  0.00259365  0.02338
+0.3977  0.059845  0.00205279  0.02357
+0.401  0.0598462  0.00379298  0.02375
Index: example/latex_smeared_out_1.txt
===================================================================
--- example/latex_smeared_out_1.txt	(revision 1a4d4c0aca8494eb0d3fcd09e8c26f2fb1388d46)
+++ example/latex_smeared_out_1.txt	(revision 1a4d4c0aca8494eb0d3fcd09e8c26f2fb1388d46)
@@ -0,0 +1,83 @@
+<X>   <Y>   <dY>
+7.7457e-05  8432.04  153.745
+8.3007e-05  8298.38  152.01
+8.8557e-05  8091.51  149.908
+9.4107e-05  7947.7  148.184
+9.9657e-05  8174.04  149.824
+0.000105207  7890.52  147.061
+0.000110757  8067.04  74.9155
+0.000121857  7995.24  74.0244
+0.000132957  7969.3  73.7818
+0.000144057  7953.56  73.6532
+0.000155157  7896.35  73.3392
+0.000166257  7877.91  73.1936
+0.000177357  7769.46  72.6739
+0.000188457  7746.93  72.5899
+0.000199557  7820.8  72.9063
+0.000210657  7656.83  72.1007
+0.000221757  7777.33  72.6551
+0.000232857  7613.01  71.8768
+0.000243957  7498.28  71.316
+0.000255057  7494.75  71.2836
+0.000266157  7266.92  70.182
+0.000277257  7292.37  57.4236
+0.000305007  7214.55  57.0526
+0.000332757  7103.18  56.5915
+0.000360507  6883.81  55.7205
+0.000388257  6818.14  55.4232
+0.000416007  6591.98  54.4991
+0.000443757  6420.5  53.7756
+0.000471507  6120.15  52.5042
+0.000499257  5950.12  51.7582
+0.000527007  5792.76  51.0591
+0.000554757  5524.39  43.2058
+0.000610257  5127.92  41.599
+0.000665757  4753.49  40.0733
+0.000721257  4355.25  38.3487
+0.000776757  3878.25  36.2076
+0.000832257  3471.25  34.2637
+0.000887757  3022.77  31.9597
+0.000943257  2600.33  29.6463
+0.000998757  2309.11  27.9459
+0.00105426  1975.45  25.8603
+0.00110976  1701.57  21.4532
+0.00122076  1156.72  17.7038
+0.00133176  748.659  14.2685
+0.00144276  465.515  11.2799
+0.00155376  252.307  8.35705
+0.00166476  157.822  6.66382
+0.00177576  117.146  5.78352
+0.00188676  93.1465  5.19397
+0.00199776  103.864  5.46342
+0.00210876  128.147  6.0333
+0.00221976  135.96  6.20529
+0.00233076  138.712  6.26599
+0.00244176  126.272  5.99155
+0.00255276  114.46  5.72081
+0.00266376  74.2613  4.67786
+0.00277476  72.3794  4.62347
+0.00288576  47.3385  3.82544
+0.00299676  36.0379  3.40491
+0.00310776  30.3854  3.17364
+0.00321876  24.7429  2.92505
+0.00332976  28.5101  3.09348
+0.00344076  27.9635  3.06924
+0.00355176  33.3649  3.29833
+0.00366276  35.237  3.37337
+0.00377376  29.0365  3.11578
+0.00388476  32.5455  3.26424
+0.00399576  23.1284  2.84982
+0.00410676  23.6642  2.87489
+0.00421776  19.3575  2.66567
+0.00432876  12.8971  2.31662
+0.00443976  12.8958  2.31647
+0.00455076  9.66256  2.12012
+0.00466176  9.66792  2.1208
+0.00477276  9.39793  2.10354
+0.00488376  13.7138  2.36412
+0.00499476  14.2495  2.39427
+0.00510576  9.12935  2.08632
+0.00521676  11.822  2.25339
+0.00532776  10.7551  2.18935
+0.00543876  11.8258  2.25385
+0.00554976  8.04703  2.01492
Index: example/simul_fit.py
===================================================================
--- example/simul_fit.py	(revision 1a4d4c0aca8494eb0d3fcd09e8c26f2fb1388d46)
+++ example/simul_fit.py	(revision 1a4d4c0aca8494eb0d3fcd09e8c26f2fb1388d46)
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# To Sasview/documents/scripts
+
+from bumps.names import *
+from sasmodels.core import load_model
+from sasmodels.bumps_model import Model, Experiment
+from sasmodels.data import load_data, plot_data
+
+
+""" IMPORT THE DATA USED """
+datafiles = ['latex_smeared_out_0.txt', 'latex_smeared_out_1.txt']
+datasets = [load_data(el) for el in datafiles]
+
+for data in datasets:
+    data.qmin = 0.0
+    data.qmax = 10.0
+
+#sphere model
+kernel = load_model('sphere', dtype="single")
+pars = dict(scale=0.01, background=0.0, sld=1.0, sld_solvent=6.0, radius=1500.)
+model = Model(kernel, **pars)
+model.radius.range(0, inf)
+#model.background.range(-inf, inf)
+#model.scale.range(0, inf)
+model.sld.range(-inf, inf)
+model.sld_solvent.range(-inf, inf)
+
+free = FreeVariables(
+    names=[data.filename for data in datasets],
+    background=model.background,
+    scale=model.scale,
+    )
+free.background.range(-inf, inf)
+free.scale.range(0, inf)
+
+M = [Experiment(data=data, model=model) for data in datasets]
+
+problem = FitProblem(M, freevars=free)
+
+print(problem._parameters)
