Index: sasmodels/__init__.py
===================================================================
--- sasmodels/__init__.py	(revision 59d94b30cf6f3b1641925686dfa567ac03900ccd)
+++ sasmodels/__init__.py	(revision 32e3c9bc7952e078b48a3a2ce4bd06b565d7326a)
@@ -41,5 +41,5 @@
     # can build model docs on the fly, including images.
     return_list = [
-        expand_patterns([], ['*.c', '*.cl', 'convert.json']),
+        expand_patterns([], ['*.c', '*.cl']),
         expand_patterns(['models'], ['*.py', '*.c']),
         expand_patterns(['models', 'lib'], ['*.c']),
Index: sasmodels/conversion_table.py
===================================================================
--- sasmodels/conversion_table.py	(revision 32e3c9bc7952e078b48a3a2ce4bd06b565d7326a)
+++ sasmodels/conversion_table.py	(revision 32e3c9bc7952e078b48a3a2ce4bd06b565d7326a)
@@ -0,0 +1,775 @@
+CONVERSION_TABLE = {
+    "adsorbed_layer": [
+        "Core2ndMomentModel",
+        {
+            "scale": "scale",
+            "second_moment": "second_moment",
+            "density_shell": "density_poly",
+            "sld_solvent": "sld_solv",
+            "radius": "radius_core",
+            "volfraction": "volf_cores",
+            "background": "background",
+            "adsorbed_amount": "ads_amount",
+            "sld_shell": "sld_poly"
+        }
+    ],
+    "barbell": [
+        "BarBellModel",
+        {
+            "sld": "sld_barbell",
+            "length": "len_bar",
+            "bell_radius": "rad_bell",
+            "radius": "rad_bar",
+            "sld_solvent": "sld_solv"
+        }
+    ],
+    "bcc_paracrystal": [
+        "BCCrystalModel",
+        {
+            "sld": "sldSph",
+            "sld_solvent": "sldSolv"
+        }
+    ],
+    "be_polyelectrolyte": [
+        "BEPolyelectrolyte",
+        {
+            "ionization_degree": "alpha",
+            "polymer_concentration": "c",
+            "salt_concentration": "cs",
+            "virial_param": "h",
+            "background": "background",
+            "contrast_factor": "k",
+            "bjerrum_length": "lb",
+            "monomer_length": "b"
+        }
+    ],
+    "binary_hard_sphere": [
+        "BinaryHSModel",
+        {
+            "sld_sm": "ss_sld",
+            "sld_lg": "ls_sld",
+            "volfraction_sm": "vol_frac_ss",
+            "radius_lg": "l_radius",
+            "radius_sm": "s_radius",
+            "volfraction_lg": "vol_frac_ls",
+            "sld_solvent": "solvent_sld"
+        }
+    ],
+    "broad_peak": [
+        "BroadPeakModel",
+        {
+            "peak_pos": "q_peak",
+            "scale": None,
+            "lorentz_length": "length_l",
+            "porod_scale": "scale_p",
+            "lorentz_exp": "exponent_l",
+            "lorentz_scale": "scale_l",
+            "porod_exp": "exponent_p"
+        }
+    ],
+    "capped_cylinder": [
+        "CappedCylinderModel",
+        {
+            "sld": "sld_capcyl",
+            "length": "len_cyl",
+            "cap_radius": "rad_cap",
+            "radius": "rad_cyl",
+            "sld_solvent": "sld_solv"
+        }
+    ],
+    "core_multi_shell": [
+        "CoreMultiShellModel",
+        {
+            "thickness": "thick_shell",
+            "sld": "sld_shell",
+            "radius": "rad_core0",
+            "sld_core": "sld_core0",
+            "sld_solvent": "sld_solv",
+            "n": "n_shells"
+        }
+    ],
+    "core_shell_bicelle": [
+        "CoreShellBicelleModel",
+        {
+            "phi": "axis_phi",
+            "sld_core": "core_sld",
+            "sld_rim": "rim_sld",
+            "face_thickness": "face_thick",
+            "sld_solvent": "solvent_sld",
+            "rim_thickness": "rim_thick",
+            "sld_face": "face_sld",
+            "theta": "axis_theta"
+        }
+    ],
+    "core_shell_cylinder": [
+        "CoreShellCylinderModel",
+        {
+            "theta": "axis_theta",
+            "phi": "axis_phi",
+            "sld_shell": "shell_sld",
+            "sld_solvent": "solvent_sld",
+            "sld_core": "core_sld"
+        }
+    ],
+    "core_shell_ellipsoid": [
+        "CoreShellEllipsoidModel",
+        {
+            "phi": "axis_phi",
+            "sld_core": "sld_core",
+            "polar_shell": "polar_shell",
+            "sld_solvent": "sld_solvent",
+            "equat_shell": "equat_shell",
+            "equat_core": "equat_core",
+            "theta": "axis_theta",
+            "polar_core": "polar_core",
+            "sld_shell": "sld_shell"
+        }
+    ],
+    "core_shell_ellipsoid_xt": [
+        "CoreShellEllipsoidXTModel",
+        {
+            "phi": "axis_phi",
+            "sld_core": "sld_core",
+            "x_core": "X_core",
+            "sld_solvent": "sld_solvent",
+            "t_shell": "T_shell",
+            "x_polar_shell": "XpolarShell",
+            "theta": "axis_theta",
+            "sld_shell": "sld_shell"
+        }
+    ],
+    "core_shell_parallelepiped": [
+        "CSParallelepipedModel",
+        {
+            "phi": "parallel_phi",
+            "psi": "parallel_psi",
+            "sld_core": "sld_pcore",
+            "sld_c": "sld_rimC",
+            "sld_b": "sld_rimB",
+            "sld_solvent": "sld_solv",
+            "a_side": "shortA",
+            "sld_a": "sld_rimA",
+            "b_side": "midB",
+            "crim_thickness": "rimC",
+            "theta": "parallel_theta",
+            "arim_thickness": "rimA",
+            "c_side": "longC",
+            "brim_thickness": "rimB"
+        }
+    ],
+    "core_shell_sphere": [
+        "CoreShellModel",
+        {
+            "sld_shell": "shell_sld",
+            "sld_solvent": "solvent_sld",
+            "sld_core": "core_sld"
+        }
+    ],
+    "correlation_length": [
+        "CorrLengthModel",
+        {
+            "porod_scale": "scale_p",
+            "lorentz_scale": "scale_l",
+            "exponent_p": "exponent_p",
+            "exponent_l": "exponent_l",
+            "cor_length": "length_l"
+        }
+    ],
+    "cylinder": [
+        "CylinderModel",
+        {
+            "sld": "sldCyl",
+            "theta": "cyl_theta",
+            "phi": "cyl_phi",
+            "sld_solvent": "sldSolv",
+            "M0:sld": "M0_sld_cyl",
+            "mtheta:sld": "M_theta_cyl",
+            "mphi:sld": "M_phi_cyl",
+            "M0:sld_solvent": "M0_sld_solv",
+            "mtheta:sld_solvent": "M_theta_solv",
+            "mphi:sld_solvent": "M_phi_solv",
+            "up:frac_i": "Up_frac_i",
+            "up:frac_f": "Up_frac_f",
+            "up:angle": "Up_theta"
+        }
+    ],
+    "dab": [
+        "DABModel",
+        {
+            "length": "length"
+        }
+    ],
+    "ellipsoid": [
+        "EllipsoidModel",
+        {
+            "phi": "axis_phi",
+            "r_equatorial": "radius_b",
+            "sld": "sldEll",
+            "theta": "axis_theta",
+            "r_polar": "radius_a",
+            "sld_solvent": "sldSolv"
+        }
+    ],
+    "elliptical_cylinder": [
+        "EllipticalCylinderModel",
+        {
+            "phi": "cyl_phi",
+            "psi": "cyl_psi",
+            "theta": "cyl_theta",
+            "sld": "sldCyl",
+            "axis_ratio": "r_ratio",
+            "sld_solvent": "sldSolv"
+        }
+    ],
+    "fcc_paracrystal": [
+        "FCCrystalModel",
+        {
+            "sld": "sldSph",
+            "sld_solvent": "sldSolv"
+        }
+    ],
+    "flexible_cylinder": [
+        "FlexibleCylinderModel",
+        {
+            "sld": "sldCyl",
+            "sld_solvent": "sldSolv"
+        }
+    ],
+    "flexible_cylinder_elliptical": [
+        "FlexCylEllipXModel",
+        {
+            "sld": "sldCyl",
+            "sld_solvent": "sldSolv"
+        }
+    ],
+    "fractal": [
+        "FractalModel",
+        {
+            "sld_block": "sldBlock",
+            "radius": "radius",
+            "cor_length": "cor_length",
+            "sld_solvent": "sldSolv",
+            "fractal_dim": "fractal_dim"
+        }
+    ],
+    "fractal_core_shell": [
+        "FractalCoreShellModel",
+        {
+            "sld_shell": "shell_sld",
+            "sld_solvent": "solvent_sld",
+            "sld_core": "core_sld"
+        }
+    ],
+    "fuzzy_sphere": [
+        "FuzzySphereModel",
+        {
+            "sld": "sldSph",
+            "fuzziness": "fuzziness",
+            "radius": "radius",
+            "sld_solvent": "sldSolv"
+        }
+    ],
+    "gauss_lorentz_gel": [
+        "GaussLorentzGelModel",
+        {
+            "gauss_scale_factor": "scale_g",
+            "dynamic_cor_length": "dyn_colength",
+            "static_cor_length": "stat_colength",
+            "background": "background",
+            "lorentz_scale_factor": "scale_l"
+        }
+    ],
+    "gaussian_peak": [
+        "PeakGaussModel",
+        {
+            "sigma": "B"
+        }
+    ],
+    "gel_fit": [
+        "GelFitModel",
+        {
+            "gyration_radius": "radius",
+            "lorentzian_scale": "lScale",
+            "fractal_exp": "FractalExp",
+            "cor_length": "zeta",
+            "guinier_scale": "gScale"
+        }
+    ],
+    "guinier": [
+        "GuinierModel",
+        {
+            "rg": "rg"
+        }
+    ],
+    "guinier_porod": [
+        "GuinierPorodModel",
+        {
+            "s": "dim",
+            "rg": "rg",
+            "m": "m",
+            "scale": "scale",
+            "background": "background"
+        }
+    ],
+    "hardsphere": [
+        "HardsphereStructure",
+        {
+            "radius_effective_pd": "effect_radius_pd",
+            "radius_effective": "effect_radius",
+            "radius_effective_pd_n": "effect_radius_pd_n"
+        }
+    ],
+    "hardsphere2": [
+        "HardsphereStructure",
+        {}
+    ],
+    "hardsphere3": [
+        "HardsphereStructure",
+        {}
+    ],
+    "hardsphere4": [
+        "HardsphereStructure",
+        {}
+    ],
+    "hayter_msa": [
+        "HayterMSAStructure",
+        {
+            "salt_concentration": "saltconc",
+            "radius_effective_pd": "effect_radius_pd",
+            "radius_effective": "effect_radius",
+            "radius_effective_pd_n": "effect_radius_pd_n"
+        }
+    ],
+    "hollow_cylinder": [
+        "HollowCylinderModel",
+        {
+            "phi": "axis_phi",
+            "scale": "scale",
+            "core_radius": "core_radius",
+            "sld_solvent": "sldSolv",
+            "length": "length",
+            "radius": "radius",
+            "background": "background",
+            "sld": "sldCyl",
+            "theta": "axis_theta"
+        }
+    ],
+    "hollow_rectangular_prism": [
+        "RectangularHollowPrismModel",
+        {
+            "b2a_ratio": "b2a_ratio",
+            "a_side": "short_side",
+            "sld": "sldPipe",
+            "c_side": "c2a_ratio",
+            "sld_solvent": "sldSolv",
+            "thickness": "thickness"
+        }
+    ],
+    "hollow_rectangular_prism_thin_walls": [
+        "RectangularHollowPrismInfThinWallsModel",
+        {
+            "sld": "sldPipe",
+            "b2a_ratio": "b2a_ratio",
+            "a_side": "short_side",
+            "c_side": "c2a_ratio",
+            "sld_solvent": "sldSolv"
+        }
+    ],
+    "lamellar": [
+        "LamellarModel",
+        {
+            "sld": "sld_bi",
+            "sld_solvent": "sld_sol",
+            "thickness": "bi_thick"
+        }
+    ],
+    "lamellar_hg": [
+        "LamellarFFHGModel",
+        {
+            "sld": "sld_tail",
+            "sld_solvent": "sld_solvent",
+            "sld_head": "sld_head",
+            "tail_length": "t_length",
+            "head_length": "h_thickness"
+        }
+    ],
+    "lamellar_hg_stack_caille": [
+        "LamellarPSHGModel",
+        {
+            "Caille_parameter": "caille",
+            "Nlayers": "n_plates",
+            "sld_head": "sld_head",
+            "tail_length": "deltaT",
+            "head_length": "deltaH",
+            "sld": "sld_tail",
+            "sld_solvent": "sld_solvent"
+        }
+    ],
+    "lamellar_stack_caille": [
+        "LamellarPSModel",
+        {
+            "sld": "sld_bi",
+            "Caille_parameter": "caille",
+            "Nlayers": "N_plates",
+            "sld_solvent": "sld_sol",
+            "thickness": "delta"
+        }
+    ],
+    "lamellar_stack_paracrystal": [
+        "LamellarPCrystalModel",
+        {
+            "sld": "sld_layer",
+            "spacing_polydisp": "pd_spacing",
+            "sld_solvent": "sld_solvent"
+        }
+    ],
+    "line": [
+        "LineModel",
+        {
+            "slope": "B",
+            "scale": None,
+            "background": None,
+            "intercept": "A"
+        }
+    ],
+    "linear_pearls": [
+        "LinearPearlsModel",
+        {
+            "sld": "sld_pearl",
+            "sld_solvent": "sld_solv",
+            "edge_sep": "edge_separation"
+        }
+    ],
+    "lorentz": [
+        "LorentzModel",
+        {
+            "cor_length": "length"
+        }
+    ],
+    "mass_fractal": [
+        "MassFractalModel",
+        {
+            "cutoff_length": "co_length",
+            "radius": "radius",
+            "mass_dim": "mass_dim"
+        }
+    ],
+    "mass_surface_fractal": [
+        "MassSurfaceFractal",
+        {
+            "cluster_rg": "cluster_rg",
+            "mass_dim": "mass_dim",
+            "radius": "radius",
+            "surface_dim": "surface_dim",
+            "primary_rg": "primary_rg"
+        }
+    ],
+    "mono_gauss_coil": [
+        "DebyeModel",
+        {
+            "radius_gyration": "rg",
+            "scale": "scale",
+            "background": "background"
+        }
+    ],
+    "multilayer_vesicle": [
+        "MultiShellModel",
+        {
+            "sld": "shell_sld",
+            "thick_solvent": "w_thickness",
+            "thick_shell": "s_thickness",
+            "radius": "core_radius",
+            "sld_solvent": "core_sld"
+        }
+    ],
+    "onion": [
+        "OnionExpShellModel",
+        {
+            "n_shells": "n_shells",
+            "A": "A_shell",
+            "sld_core": "sld_core0",
+            "core_radius": "rad_core0",
+            "sld_solvent": "sld_solv",
+            "thickness": "thick_shell",
+            "sld_in": "sld_in_shell",
+            "sld_out": "sld_out_shell"
+        }
+    ],
+    "parallelepiped": [
+        "ParallelepipedModel",
+        {
+            "phi": "parallel_phi",
+            "psi": "parallel_psi",
+            "sld_solvent": "sldSolv",
+            "a_side": "short_a",
+            "b_side": "short_b",
+            "sld": "sldPipe",
+            "theta": "parallel_theta",
+            "c_side": "long_c"
+        }
+    ],
+    "peak_lorentz": [
+        "PeakLorentzModel",
+        {
+            "peak_pos": "q0",
+            "peak_hwhm": "B"
+        }
+    ],
+    "pearl_necklace": [
+        "PearlNecklaceModel",
+        {
+            "scale": "scale",
+            "string_thickness": "thick_string",
+            "sld_string": "sld_string",
+            "sld_solvent": "sld_solv",
+            "edge_separation": "edge_separation",
+            "number_of_pearls": "num_pearls",
+            "radius": "radius",
+            "background": "background",
+            "sld": "sld_pearl"
+        }
+    ],
+    "poly_gauss_coil": [
+        "Poly_GaussCoil",
+        {
+            "radius_gyration": "rg",
+            "polydispersity": "poly_m",
+            "scale": "scale",
+            "background": "background"
+        }
+    ],
+    "polymer_excl_volume": [
+        "PolymerExclVolume",
+        {
+            "rg": "rg",
+            "scale": "scale",
+            "background": "background",
+            "porod_exp": "m"
+        }
+    ],
+    "polymer_micelle": [
+        "MicelleSphCoreModel",
+        {
+            "sld_corona": "rho_corona",
+            "sld_solvent": "rho_solv",
+            "sld_core": "rho_core"
+        }
+    ],
+    "porod": [
+        "PorodModel",
+        {
+            "scale": "scale",
+            "background": "background"
+        }
+    ],
+    "power_law": [
+        "PowerLawAbsModel",
+        {
+            "scale": "scale",
+            "background": "background",
+            "power": "m"
+        }
+    ],
+    "pringle": [
+        "PringlesModel",
+        {
+            "scale": "scale",
+            "solvent_sld": "sld_solvent",
+            "thickness": "thickness",
+            "beta": "beta",
+            "radius": "radius",
+            "background": "background",
+            "alpha": "alpha",
+            "pringle_sld": "sld_pringle"
+        }
+    ],
+    "raspberry": [
+        "RaspBerryModel",
+        {
+            "volfraction_lg": "volf_Lsph",
+            "volfraction_sm": "volf_Ssph",
+            "radius_sm": "radius_Ssph",
+            "radius_lg": "radius_Lsph",
+            "sld_lg": "sld_Lsph",
+            "sld_sm": "sld_Ssph",
+            "sld_solvent": "sld_solv",
+            "surface_fraction": "surfrac_Ssph",
+            "penetration": "delta_Ssph"
+        }
+    ],
+    "rectangular_prism": [
+        "RectangularPrismModel",
+        {
+            "sld": "sldPipe",
+            "b2a_ratio": "b2a_ratio",
+            "a_side": "short_side",
+            "c_side": "c2a_ratio",
+            "sld_solvent": "sldSolv"
+        }
+    ],
+    "rpa": [
+        "RPA10Model",
+        {
+            "K12": "Kab", "K13": "Kac", "K14": "Kad",
+            "K23": "Kbc", "K24": "Kbd", "K34": "Kcd",
+            "N1": "Na", "N2": "Nb", "N3": "Nc", "N4": "Nd",
+            "L1": "La", "L2": "Lb", "L3": "Lc", "L4": "Ld",
+            "v1": "va", "v2": "vb", "v3": "vc", "v4": "vd",
+            "b1": "ba", "b2": "bb", "b3": "bc", "b4": "bd",
+            "Phi1": "Phia", "Phi2": "Phib", "Phi3": "Phic", "Phi4": "Phid",
+            "case_num": "lcase_n"
+        }
+    ],
+    "sc_paracrystal": [
+        "SCCrystalModel",
+        {
+            "sld": "sldSph",
+            "sld_solvent": "sldSolv"
+        }
+    ],
+    "sphere": [
+        "SphereModel",
+        {
+            "sld": "sldSph",
+            "radius": "radius",
+            "sld_solvent": "sldSolv",
+            "M0:sld": "M0_sld_sph",
+            "mtheta:sld": "M_theta_sph",
+            "mphi:sld": "M_phi_sph",
+            "M0:sld_solvent": "M0_sld_solv",
+            "mtheta:sld_solvent": "M_theta_solv",
+            "mphi:sld_solvent": "M_phi_solv",
+            "up:frac_i": "Up_frac_i",
+            "up:frac_f": "Up_frac_f",
+            "up:angle": "Up_theta"
+        }
+    ],
+    "magsphere": [
+        "SphereModel",
+        {
+            "sld": "sldSph",
+            "radius": "radius",
+            "sld_solvent": "sldSolv",
+            "sld_M0": "M0_sld_sph",
+            "sphere_theta": "M_theta_sph",
+            "sphere_phi": "M_phi_sph",
+            "sld_solvent_M0": "M0_sld_solv",
+            "solvent_theta": "M_theta_solv",
+            "solvent_phi": "M_phi_solv",
+            "in_spin": "Up_frac_i",
+            "out_spin": "Up_frac_f",
+            "spin_theta": "Up_theta"
+        }
+    ],
+    "_spherepy": [
+        "SphereModel",
+        {
+            "sld": "sldSph",
+            "radius": "radius",
+            "sld_solvent": "sldSolv"
+        }
+    ],
+    "spherical_sld": [
+        "SphericalSLDModel",
+        {
+            "radius_core": "rad_core0",
+            "sld_core": "sld_core0",
+            "sld_solvent": "sld_solv"
+        }
+    ],
+    "squarewell": [
+        "SquareWellStructure",
+        {
+            "radius_effective_pd": "effect_radius_pd",
+            "radius_effective": "effect_radius",
+            "radius_effective_pd_n": "effect_radius_pd_n"
+        }
+    ],
+    "stacked_disks": [
+        "StackedDisksModel",
+        {
+            "phi": "axis_phi",
+            "sld_layer": "layer_sld",
+            "sld_core": "core_sld",
+            "theta": "axis_theta",
+            "sld_solvent": "solvent_sld",
+            "n_stacking": "n_stacking"
+        }
+    ],
+    "star_polymer": [
+        "StarPolymer",
+        {
+            "arms": "arms",
+            "rg_squared": "R2"
+        }
+    ],
+    "stickyhardsphere": [
+        "StickyHSStructure",
+        {
+            "radius_effective_pd": "effect_radius_pd",
+            "radius_effective": "effect_radius",
+            "radius_effective_pd_n": "effect_radius_pd_n"
+        }
+    ],
+    "surface_fractal": [
+        "SurfaceFractalModel",
+        {
+            "cutoff_length": "co_length",
+            "radius": "radius",
+            "surface_dim": "surface_dim"
+        }
+    ],
+    "teubner_strey": [
+        "TeubnerStreyModel",
+        {
+            "a2": "scale"
+        }
+    ],
+    "triaxial_ellipsoid": [
+        "TriaxialEllipsoidModel",
+        {
+            "phi": "axis_phi",
+            "req_minor": "semi_axisA",
+            "rpolar": "semi_axisC",
+            "req_major": "semi_axisB",
+            "solvent_sld": "sldSolv",
+            "psi": "axis_psi",
+            "sld": "sldEll",
+            "theta": "axis_theta"
+        }
+    ],
+    "two_lorentzian": [
+        "TwoLorentzianModel",
+        {
+            "lorentz_scale_1": "scale_1",
+            "lorentz_scale_2": "scale_2",
+            "lorentz_exp_1": "exponent_1",
+            "lorentz_exp_2": "exponent_2",
+            "lorentz_length_2": "length_2",
+            "lorentz_length_1": "length_1",
+            "background": "background"
+        }
+    ],
+    "two_power_law": [
+        "TwoPowerLawModel",
+        {
+            "coefficent_1": "coef_A",
+            "power_2": "power2",
+            "power_1": "power1",
+            "background": "background",
+            "crossover": "qc"
+        }
+    ],
+    "unified_power_Rg": [
+        "UnifiedPowerRgModel",
+        {
+        }
+    ],
+    "vesicle": [
+        "VesicleModel",
+        {
+            "sld": "shell_sld",
+            "sld_solvent": "solv_sld"
+        }
+    ]
+}
Index: smodels/convert.json
===================================================================
--- sasmodels/convert.json	(revision a0494e91f57473a5b1d3ca86eb1ed5fa7d40a3c5)
+++ 	(revision )
@@ -1,740 +1,0 @@
-{
-  "adsorbed_layer": [
-    "Core2ndMomentModel", 
-    {
-      "scale": "scale", 
-      "second_moment": "second_moment", 
-      "density_shell": "density_poly", 
-      "sld_solvent": "sld_solv", 
-      "radius": "radius_core", 
-      "volfraction": "volf_cores", 
-      "background": "background", 
-      "adsorbed_amount": "ads_amount", 
-      "sld_shell": "sld_poly"
-    }
-  ], 
-  "barbell": [
-    "BarBellModel", 
-    {
-      "sld": "sld_barbell", 
-      "length": "len_bar", 
-      "bell_radius": "rad_bell", 
-      "radius": "rad_bar", 
-      "sld_solvent": "sld_solv"
-    }
-  ], 
-  "bcc_paracrystal": [
-    "BCCrystalModel", 
-    {
-      "sld": "sldSph", 
-      "sld_solvent": "sldSolv"
-    }
-  ], 
-  "be_polyelectrolyte": [
-    "BEPolyelectrolyte", 
-    {
-      "ionization_degree": "alpha", 
-      "polymer_concentration": "c", 
-      "salt_concentration": "cs", 
-      "virial_param": "h", 
-      "background": "background", 
-      "contrast_factor": "k", 
-      "bjerrum_length": "lb", 
-      "monomer_length": "b"
-    }
-  ], 
-  "binary_hard_sphere": [
-    "BinaryHSModel", 
-    {
-      "sld_sm": "ss_sld", 
-      "sld_lg": "ls_sld", 
-      "volfraction_sm": "vol_frac_ss", 
-      "radius_lg": "l_radius", 
-      "radius_sm": "s_radius", 
-      "volfraction_lg": "vol_frac_ls", 
-      "sld_solvent": "solvent_sld"
-    }
-  ], 
-  "broad_peak": [
-    "BroadPeakModel", 
-    {
-      "peak_pos": "q_peak", 
-      "scale": null, 
-      "lorentz_length": "length_l", 
-      "porod_scale": "scale_p", 
-      "lorentz_exp": "exponent_l", 
-      "lorentz_scale": "scale_l", 
-      "porod_exp": "exponent_p"
-    }
-  ], 
-  "capped_cylinder": [
-    "CappedCylinderModel", 
-    {
-      "sld": "sld_capcyl", 
-      "length": "len_cyl", 
-      "cap_radius": "rad_cap", 
-      "radius": "rad_cyl", 
-      "sld_solvent": "sld_solv"
-    }
-  ], 
-  "core_multi_shell": [
-    "CoreMultiShellModel",
-    {
-      "thickness": "thick_shell",
-      "sld": "sld_shell",
-      "radius": "rad_core0",
-      "sld_core": "sld_core0",
-      "sld_solvent": "sld_solv",
-      "n": "n_shells"
-    }
-  ], 
-  "core_shell_bicelle": [
-    "CoreShellBicelleModel", 
-    {
-      "phi": "axis_phi", 
-      "sld_core": "core_sld", 
-      "sld_rim": "rim_sld", 
-      "face_thickness": "face_thick", 
-      "sld_solvent": "solvent_sld", 
-      "rim_thickness": "rim_thick", 
-      "sld_face": "face_sld", 
-      "theta": "axis_theta"
-    }
-  ], 
-  "core_shell_cylinder": [
-    "CoreShellCylinderModel", 
-    {
-      "theta": "axis_theta", 
-      "phi": "axis_phi", 
-      "sld_shell": "shell_sld", 
-      "sld_solvent": "solvent_sld", 
-      "sld_core": "core_sld"
-    }
-  ], 
-  "core_shell_ellipsoid": [
-    "CoreShellEllipsoidModel", 
-    {
-      "phi": "axis_phi", 
-      "sld_core": "sld_core", 
-      "polar_shell": "polar_shell", 
-      "sld_solvent": "sld_solvent", 
-      "equat_shell": "equat_shell", 
-      "equat_core": "equat_core", 
-      "theta": "axis_theta", 
-      "polar_core": "polar_core", 
-      "sld_shell": "sld_shell"
-    }
-  ], 
-  "core_shell_ellipsoid_xt": [
-    "CoreShellEllipsoidXTModel", 
-    {
-      "phi": "axis_phi", 
-      "sld_core": "sld_core", 
-      "x_core": "X_core", 
-      "sld_solvent": "sld_solvent", 
-      "t_shell": "T_shell", 
-      "x_polar_shell": "XpolarShell", 
-      "theta": "axis_theta", 
-      "sld_shell": "sld_shell"
-    }
-  ], 
-  "core_shell_parallelepiped": [
-    "CSParallelepipedModel", 
-    {
-      "phi": "parallel_phi", 
-      "psi": "parallel_psi", 
-      "sld_core": "sld_pcore", 
-      "sld_c": "sld_rimC", 
-      "sld_b": "sld_rimB", 
-      "sld_solvent": "sld_solv", 
-      "a_side": "shortA", 
-      "sld_a": "sld_rimA", 
-      "b_side": "midB", 
-      "crim_thickness": "rimC", 
-      "theta": "parallel_theta", 
-      "arim_thickness": "rimA", 
-      "c_side": "longC", 
-      "brim_thickness": "rimB"
-    }
-  ], 
-  "core_shell_sphere": [
-    "CoreShellModel", 
-    {
-      "sld_shell": "shell_sld", 
-      "sld_solvent": "solvent_sld", 
-      "sld_core": "core_sld"
-    }
-  ], 
-  "correlation_length": [
-    "CorrLengthModel", 
-    {
-      "porod_scale": "scale_p", 
-      "lorentz_scale": "scale_l", 
-      "exponent_p": "exponent_p", 
-      "exponent_l": "exponent_l", 
-      "cor_length": "length_l"
-    }
-  ], 
-  "cylinder": [
-    "CylinderModel", 
-    {
-      "sld": "sldCyl", 
-      "theta": "cyl_theta", 
-      "phi": "cyl_phi", 
-      "sld_solvent": "sldSolv"
-    }
-  ], 
-  "dab": [
-    "DABModel", 
-    {
-      "length": "length"
-    }
-  ], 
-  "ellipsoid": [
-    "EllipsoidModel", 
-    {
-      "phi": "axis_phi", 
-      "r_equatorial": "radius_b", 
-      "sld": "sldEll", 
-      "theta": "axis_theta", 
-      "r_polar": "radius_a", 
-      "sld_solvent": "sldSolv"
-    }
-  ], 
-  "elliptical_cylinder": [
-    "EllipticalCylinderModel", 
-    {
-      "phi": "cyl_phi", 
-      "psi": "cyl_psi", 
-      "theta": "cyl_theta", 
-      "sld": "sldCyl", 
-      "axis_ratio": "r_ratio", 
-      "sld_solvent": "sldSolv"
-    }
-  ], 
-  "fcc_paracrystal": [
-    "FCCrystalModel", 
-    {
-      "sld": "sldSph", 
-      "sld_solvent": "sldSolv"
-    }
-  ], 
-  "flexible_cylinder": [
-    "FlexibleCylinderModel", 
-    {
-      "sld": "sldCyl", 
-      "sld_solvent": "sldSolv"
-    }
-  ], 
-  "flexible_cylinder_elliptical": [
-    "FlexCylEllipXModel", 
-    {
-      "sld": "sldCyl", 
-      "sld_solvent": "sldSolv"
-    }
-  ], 
-  "fractal": [
-    "FractalModel", 
-    {
-      "sld_block": "sldBlock", 
-      "radius": "radius", 
-      "cor_length": "cor_length", 
-      "sld_solvent": "sldSolv", 
-      "fractal_dim": "fractal_dim"
-    }
-  ], 
-  "fractal_core_shell": [
-    "FractalCoreShellModel", 
-    {
-      "sld_shell": "shell_sld", 
-      "sld_solvent": "solvent_sld", 
-      "sld_core": "core_sld"
-    }
-  ], 
-  "fuzzy_sphere": [
-    "FuzzySphereModel", 
-    {
-      "sld": "sldSph", 
-      "fuzziness": "fuzziness", 
-      "radius": "radius", 
-      "sld_solvent": "sldSolv"
-    }
-  ], 
-  "gauss_lorentz_gel": [
-    "GaussLorentzGelModel", 
-    {
-      "gauss_scale_factor": "scale_g", 
-      "dynamic_cor_length": "dyn_colength", 
-      "static_cor_length": "stat_colength", 
-      "background": "background", 
-      "lorentz_scale_factor": "scale_l"
-    }
-  ], 
-  "gaussian_peak": [
-    "PeakGaussModel", 
-    {
-      "sigma": "B"
-    }
-  ], 
-  "gel_fit": [
-    "GelFitModel", 
-    {
-      "gyration_radius": "radius", 
-      "lorentzian_scale": "lScale", 
-      "fractal_exp": "FractalExp", 
-      "cor_length": "zeta", 
-      "guinier_scale": "gScale"
-    }
-  ], 
-  "guinier": [
-    "GuinierModel", 
-    {
-      "rg": "rg"
-    }
-  ], 
-  "guinier_porod": [
-    "GuinierPorodModel", 
-    {
-      "s": "dim", 
-      "rg": "rg", 
-      "m": "m", 
-      "scale": "scale", 
-      "background": "background"
-    }
-  ], 
-  "hardsphere": [
-    "HardsphereStructure", 
-    {
-      "radius_effective_pd": "effect_radius_pd", 
-      "radius_effective": "effect_radius", 
-      "radius_effective_pd_n": "effect_radius_pd_n"
-    }
-  ], 
-  "hardsphere2": [
-    "HardsphereStructure", 
-    {}
-  ], 
-  "hardsphere3": [
-    "HardsphereStructure", 
-    {}
-  ], 
-  "hardsphere4": [
-    "HardsphereStructure", 
-    {}
-  ], 
-  "hayter_msa": [
-    "HayterMSAStructure", 
-    {
-      "salt_concentration": "saltconc", 
-      "radius_effective_pd": "effect_radius_pd", 
-      "radius_effective": "effect_radius", 
-      "radius_effective_pd_n": "effect_radius_pd_n"
-    }
-  ], 
-  "hollow_cylinder": [
-    "HollowCylinderModel", 
-    {
-      "phi": "axis_phi", 
-      "scale": "scale", 
-      "core_radius": "core_radius", 
-      "sld_solvent": "sldSolv", 
-      "length": "length", 
-      "radius": "radius", 
-      "background": "background", 
-      "sld": "sldCyl", 
-      "theta": "axis_theta"
-    }
-  ], 
-  "hollow_rectangular_prism": [
-    "RectangularHollowPrismModel", 
-    {
-      "b2a_ratio": "b2a_ratio", 
-      "a_side": "short_side", 
-      "sld": "sldPipe", 
-      "c_side": "c2a_ratio", 
-      "sld_solvent": "sldSolv", 
-      "thickness": "thickness"
-    }
-  ], 
-  "hollow_rectangular_prism_thin_walls": [
-    "RectangularHollowPrismInfThinWallsModel", 
-    {
-      "sld": "sldPipe", 
-      "b2a_ratio": "b2a_ratio", 
-      "a_side": "short_side", 
-      "c_side": "c2a_ratio", 
-      "sld_solvent": "sldSolv"
-    }
-  ], 
-  "lamellar": [
-    "LamellarModel", 
-    {
-      "sld": "sld_bi", 
-      "sld_solvent": "sld_sol", 
-      "thickness": "bi_thick"
-    }
-  ], 
-  "lamellar_hg": [
-    "LamellarFFHGModel", 
-    {
-      "sld": "sld_tail", 
-      "sld_solvent": "sld_solvent", 
-      "sld_head": "sld_head", 
-      "tail_length": "t_length", 
-      "head_length": "h_thickness"
-    }
-  ], 
-  "lamellar_hg_stack_caille": [
-    "LamellarPSHGModel", 
-    {
-      "Caille_parameter": "caille", 
-      "Nlayers": "n_plates", 
-      "sld_head": "sld_head", 
-      "tail_length": "deltaT", 
-      "head_length": "deltaH", 
-      "sld": "sld_tail", 
-      "sld_solvent": "sld_solvent"
-    }
-  ], 
-  "lamellar_stack_caille": [
-    "LamellarPSModel", 
-    {
-      "sld": "sld_bi", 
-      "Caille_parameter": "caille", 
-      "Nlayers": "N_plates", 
-      "sld_solvent": "sld_sol", 
-      "thickness": "delta"
-    }
-  ], 
-  "lamellar_stack_paracrystal": [
-    "LamellarPCrystalModel", 
-    {
-      "sld": "sld_layer", 
-      "spacing_polydisp": "pd_spacing", 
-      "sld_solvent": "sld_solvent"
-    }
-  ], 
-  "line": [
-    "LineModel", 
-    {
-      "slope": "B", 
-      "scale": null, 
-      "background": null, 
-      "intercept": "A"
-    }
-  ], 
-  "linear_pearls": [
-    "LinearPearlsModel", 
-    {
-      "sld": "sld_pearl", 
-      "sld_solvent": "sld_solv", 
-      "edge_sep": "edge_separation"
-    }
-  ], 
-  "lorentz": [
-    "LorentzModel", 
-    {
-      "cor_length": "length"
-    }
-  ], 
-  "mass_fractal": [
-    "MassFractalModel", 
-    {
-      "cutoff_length": "co_length", 
-      "radius": "radius", 
-      "mass_dim": "mass_dim"
-    }
-  ], 
-  "mass_surface_fractal": [
-    "MassSurfaceFractal", 
-    {
-      "cluster_rg": "cluster_rg", 
-      "mass_dim": "mass_dim", 
-      "radius": "radius", 
-      "surface_dim": "surface_dim", 
-      "primary_rg": "primary_rg"
-    }
-  ], 
-  "mono_gauss_coil": [
-    "DebyeModel", 
-    {
-      "radius_gyration": "rg", 
-      "scale": "scale", 
-      "background": "background"
-    }
-  ], 
-  "multilayer_vesicle": [
-    "MultiShellModel", 
-    {
-      "sld": "shell_sld", 
-      "thick_solvent": "w_thickness", 
-      "thick_shell": "s_thickness", 
-      "radius": "core_radius", 
-      "sld_solvent": "core_sld"
-    }
-  ], 
-  "onion": [
-    "OnionExpShellModel",
-    {
-      "n_shells": "n_shells",
-      "A": "A_shell", 
-      "sld_core": "sld_core0",
-      "core_radius": "rad_core0",
-      "sld_solvent": "sld_solv",
-      "thickness": "thick_shell", 
-      "sld_in": "sld_in_shell",
-      "sld_out": "sld_out_shell"
-    }
-  ], 
-  "parallelepiped": [
-    "ParallelepipedModel", 
-    {
-      "phi": "parallel_phi", 
-      "psi": "parallel_psi", 
-      "sld_solvent": "sldSolv", 
-      "a_side": "short_a", 
-      "b_side": "short_b", 
-      "sld": "sldPipe", 
-      "theta": "parallel_theta", 
-      "c_side": "long_c"
-    }
-  ], 
-  "peak_lorentz": [
-    "PeakLorentzModel", 
-    {
-      "peak_pos": "q0", 
-      "peak_hwhm": "B"
-    }
-  ], 
-  "pearl_necklace": [
-    "PearlNecklaceModel", 
-    {
-      "scale": "scale", 
-      "string_thickness": "thick_string", 
-      "sld_string": "sld_string", 
-      "sld_solvent": "sld_solv", 
-      "edge_separation": "edge_separation", 
-      "number_of_pearls": "num_pearls", 
-      "radius": "radius", 
-      "background": "background", 
-      "sld": "sld_pearl"
-    }
-  ], 
-  "poly_gauss_coil": [
-    "Poly_GaussCoil", 
-    {
-      "radius_gyration": "rg", 
-      "polydispersity": "poly_m", 
-      "scale": "scale", 
-      "background": "background"
-    }
-  ], 
-  "polymer_excl_volume": [
-    "PolymerExclVolume", 
-    {
-      "rg": "rg", 
-      "scale": "scale", 
-      "background": "background", 
-      "porod_exp": "m"
-    }
-  ], 
-  "polymer_micelle": [
-    "MicelleSphCoreModel", 
-    {
-      "sld_corona": "rho_corona", 
-      "sld_solvent": "rho_solv", 
-      "sld_core": "rho_core"
-    }
-  ], 
-  "porod": [
-    "PorodModel", 
-    {
-      "scale": "scale", 
-      "background": "background"
-    }
-  ], 
-  "power_law": [
-    "PowerLawAbsModel", 
-    {
-      "scale": "scale", 
-      "background": "background", 
-      "power": "m"
-    }
-  ], 
-  "pringle": [
-    "PringlesModel", 
-    {
-      "scale": "scale", 
-      "solvent_sld": "sld_solvent", 
-      "thickness": "thickness", 
-      "beta": "beta", 
-      "radius": "radius", 
-      "background": "background", 
-      "alpha": "alpha", 
-      "pringle_sld": "sld_pringle"
-    }
-  ],
-  "raspberry": [
-    "RaspBerryModel",
-    {
-    "volfraction_lg": "volf_Lsph",
-    "volfraction_sm": "volf_Ssph",
-    "radius_sm": "radius_Ssph",
-    "radius_lg": "radius_Lsph",
-    "sld_lg": "sld_Lsph",
-    "sld_sm": "sld_Ssph",
-    "sld_solvent": "sld_solv",
-    "surface_fraction": "surfrac_Ssph",
-    "penetration": "delta_Ssph"
-    }
-  ],
-  "rectangular_prism": [
-    "RectangularPrismModel", 
-    {
-      "sld": "sldPipe", 
-      "b2a_ratio": "b2a_ratio", 
-      "a_side": "short_side", 
-      "c_side": "c2a_ratio", 
-      "sld_solvent": "sldSolv"
-    }
-  ], 
-  "rpa": [
-    "RPA10Model",
-    {
-      "K12": "Kab", "K13": "Kac", "K14": "Kad",
-      "K23": "Kbc", "K24": "Kbd", "K34": "Kcd",
-      "N1": "Na", "N2": "Nb", "N3": "Nc", "N4": "Nd",
-      "L1": "La", "L2": "Lb", "L3": "Lc", "L4": "Ld",
-      "v1": "va", "v2": "vb", "v3": "vc", "v4": "vd",
-      "b1": "ba", "b2": "bb", "b3": "bc", "b4": "bd",
-      "Phi1": "Phia", "Phi2": "Phib", "Phi3": "Phic", "Phi4": "Phid",
-      "case_num": "lcase_n"
-    }
-  ], 
-  "sc_paracrystal": [
-    "SCCrystalModel", 
-    {
-      "sld": "sldSph", 
-      "sld_solvent": "sldSolv"
-    }
-  ], 
-  "sphere": [
-    "SphereModel", 
-    {
-      "sld": "sldSph", 
-      "radius": "radius", 
-      "sld_solvent": "sldSolv"
-    }
-  ], 
-  "_spherepy": [
-    "SphereModel",
-    {
-      "sld": "sldSph",
-      "radius": "radius",
-      "sld_solvent": "sldSolv"
-    }
-  ],
-  "spherical_sld": [
-    "SphericalSLDModel",
-    {
-      "radius_core": "rad_core0",
-      "sld_core": "sld_core0",
-      "sld_solvent": "sld_solv"
-    }
-  ], 
-  "squarewell": [
-    "SquareWellStructure", 
-    {
-      "radius_effective_pd": "effect_radius_pd", 
-      "radius_effective": "effect_radius", 
-      "radius_effective_pd_n": "effect_radius_pd_n"
-    }
-  ], 
-  "stacked_disks": [
-    "StackedDisksModel", 
-    {
-      "phi": "axis_phi", 
-      "sld_layer": "layer_sld", 
-      "sld_core": "core_sld", 
-      "theta": "axis_theta", 
-      "sld_solvent": "solvent_sld", 
-      "n_stacking": "n_stacking"
-    }
-  ], 
-  "star_polymer": [
-    "StarPolymer", 
-    {
-      "arms": "arms", 
-      "rg_squared": "R2"
-    }
-  ], 
-  "stickyhardsphere": [
-    "StickyHSStructure", 
-    {
-      "radius_effective_pd": "effect_radius_pd", 
-      "radius_effective": "effect_radius", 
-      "radius_effective_pd_n": "effect_radius_pd_n"
-    }
-  ], 
-  "surface_fractal": [
-    "SurfaceFractalModel", 
-    {
-      "cutoff_length": "co_length", 
-      "radius": "radius", 
-      "surface_dim": "surface_dim"
-    }
-  ], 
-  "teubner_strey": [
-    "TeubnerStreyModel", 
-    {
-      "a2": "scale"
-    }
-  ], 
-  "triaxial_ellipsoid": [
-    "TriaxialEllipsoidModel", 
-    {
-      "phi": "axis_phi", 
-      "req_minor": "semi_axisA", 
-      "rpolar": "semi_axisC", 
-      "req_major": "semi_axisB", 
-      "solvent_sld": "sldSolv", 
-      "psi": "axis_psi", 
-      "sld": "sldEll", 
-      "theta": "axis_theta"
-    }
-  ], 
-  "two_lorentzian": [
-    "TwoLorentzianModel", 
-    {
-      "lorentz_scale_1": "scale_1", 
-      "lorentz_scale_2": "scale_2", 
-      "lorentz_exp_1": "exponent_1", 
-      "lorentz_exp_2": "exponent_2", 
-      "lorentz_length_2": "length_2", 
-      "lorentz_length_1": "length_1", 
-      "background": "background"
-    }
-  ], 
-  "two_power_law": [
-    "TwoPowerLawModel", 
-    {
-      "coefficent_1": "coef_A", 
-      "power_2": "power2", 
-      "power_1": "power1", 
-      "background": "background", 
-      "crossover": "qc"
-    }
-  ],
-  "unified_power_Rg": [
-    "UnifiedPowerRgModel",
-    {
-    }
-  ],
-  "vesicle": [
-    "VesicleModel", 
-    {
-      "sld": "shell_sld", 
-      "sld_solvent": "solv_sld"
-    }
-  ]
-}
Index: sasmodels/convert.py
===================================================================
--- sasmodels/convert.py	(revision a0494e91f57473a5b1d3ca86eb1ed5fa7d40a3c5)
+++ sasmodels/convert.py	(revision 32e3c9bc7952e078b48a3a2ce4bd06b565d7326a)
@@ -7,5 +7,6 @@
 import math
 import warnings
-import json
+
+from .conversion_table import CONVERSION_TABLE
 
 # List of models which SasView versions don't contain the explicit 'scale' argument.
@@ -47,36 +48,4 @@
     ]
 
-CONVERSION_TABLE = None
-
-def _read_conversion_table():
-    global CONVERSION_TABLE
-    if CONVERSION_TABLE is None:
-        path = joinpath(dirname(abspath(__file__)), "convert.json")
-        with open(path) as fid:
-            CONVERSION_TABLE = json_load_byteified(fid)
-
-def json_load_byteified(file_handle):
-    return _byteify(
-        json.load(file_handle, object_hook=_byteify),
-        ignore_dicts=True
-    )
-
-def _byteify(data, ignore_dicts = False):
-    # if this is a unicode string, return its string representation
-    if isinstance(data, unicode):
-        return data.encode('utf-8')
-    # if this is a list of values, return list of byteified values
-    if isinstance(data, list):
-        return [ _byteify(item, ignore_dicts=True) for item in data ]
-    # if this is a dictionary, return dictionary of byteified keys and values
-    # but only if we haven't already byteified it
-    if isinstance(data, dict) and not ignore_dicts:
-        return dict((_byteify(key, ignore_dicts=True),
-                     _byteify(value, ignore_dicts=True))
-                    for key, value in data.items())
-    # if it's anything else, return it in its original form
-    return data
-
-
 def _convert_pars(pars, mapping):
     """
@@ -93,15 +62,4 @@
     return newpars
 
-def _rescale_sld(pars):
-    """
-    rescale all sld parameters in the new model definition by 1e6 so the
-    numbers are nicer.  Relies on the fact that all sld parameters in the
-    new model definition end with sld.
-    """
-    return dict((p, (v*1e6 if p.endswith('sld')
-                     else v*1e-15 if 'ndensity' in p
-                     else v))
-                for p, v in pars.items())
-
 def convert_model(name, pars):
     """
@@ -116,5 +74,20 @@
     return [pk*scale for pk in par] if isinstance(par, list) else par*scale
 
-def _unscale_sld(pars):
+def _is_sld(modelinfo, id):
+    if id.startswith('M0:'):
+        return True
+    if (id.endswith('_pd') or id.endswith('_pd_n') or id.endswith('_pd_nsigma')
+            or id.endswith('_pd_width') or id.endswith('_pd_type')):
+        return False
+    for p in modelinfo.parameters.call_parameters:
+        if p.id == id:
+            return p.type == 'sld'
+    # check through kernel parameters in case it is a named as a vector
+    for p in modelinfo.parameters.kernel_parameters:
+        if p.id == id:
+            return p.type == 'sld'
+    raise ValueError("unknown parameter %r in conversion"%id)
+
+def _unscale_sld(modelinfo, pars):
     """
     rescale all sld parameters in the new model definition by 1e6 so the
@@ -122,8 +95,6 @@
     new model definition end with sld.
     """
-    return dict((p, (_unscale(v,1e-6) if p.startswith('sld') or p.endswith('sld')
-                     else _unscale(v,1e15) if 'ndensity' in p
-                     else v))
-                for p, v in pars.items())
+    return dict((id, (_unscale(v,1e-6) if _is_sld(modelinfo, id) else v))
+                for id, v in pars.items())
 
 def _remove_pd(pars, key, name):
@@ -164,10 +135,8 @@
 
 def revert_name(model_info):
-    _read_conversion_table()
     oldname, oldpars = CONVERSION_TABLE.get(model_info.id, [None, {}])
     return oldname
 
 def _get_translation_table(model_info):
-    _read_conversion_table()
     _, translation = CONVERSION_TABLE.get(model_info.id, [None, {}])
     translation = translation.copy()
@@ -186,5 +155,4 @@
 
 def _trim_vectors(model_info, pars, oldpars):
-    _read_conversion_table()
     _, translation = CONVERSION_TABLE.get(model_info.id, [None, {}])
     for p in model_info.parameters.kernel_parameters:
@@ -212,5 +180,5 @@
     else:
         translation = _get_translation_table(model_info)
-        oldpars = _revert_pars(_unscale_sld(pars), translation)
+        oldpars = _revert_pars(_unscale_sld(model_info, pars), translation)
         oldpars = _trim_vectors(model_info, pars, oldpars)
 
@@ -243,4 +211,7 @@
             _remove_pd(oldpars, 'rimB', name)
             _remove_pd(oldpars, 'rimC', name)
+        elif name == 'polymer_micelle':
+            if 'ndensity' in oldpars:
+                oldpars['ndensity'] *= 1e15
         elif name == 'spherical_sld':
             for k in range(1, int(pars['n_shells'])+1):
Index: sasmodels/details.py
===================================================================
--- sasmodels/details.py	(revision a738209896d6b95cdec6fe71509f3a6ca558bef3)
+++ sasmodels/details.py	(revision 32e3c9bc7952e078b48a3a2ce4bd06b565d7326a)
@@ -96,4 +96,7 @@
 
     pd_offset = np.cumsum(np.hstack((0, pd_length)))
+    #print(", ".join(str(i)+"-"+p.id for i,p in enumerate(model_info.parameters.call_parameters)))
+    #print("len:",pd_length)
+    #print("off:",pd_offset)
     # Note: the reversing view, x[::-1], does not require a copy
     idx = np.argsort(pd_length)[::-1][:num_active]
Index: sasmodels/direct_model.py
===================================================================
--- sasmodels/direct_model.py	(revision a738209896d6b95cdec6fe71509f3a6ca558bef3)
+++ sasmodels/direct_model.py	(revision 32e3c9bc7952e078b48a3a2ce4bd06b565d7326a)
@@ -70,5 +70,7 @@
 
     call_details, values = kernel.build_details(calculator, vw_pairs)
-    return calculator(call_details, values, cutoff)
+    magnetic = any(values[k]!=0 for k in parameters.magnetism_index)
+    #print("values:", values)
+    return calculator(call_details, values, cutoff, magnetic)
 
 def get_weights(parameter, values):
Index: sasmodels/generate.py
===================================================================
--- sasmodels/generate.py	(revision a738209896d6b95cdec6fe71509f3a6ca558bef3)
+++ sasmodels/generate.py	(revision 32e3c9bc7952e078b48a3a2ce4bd06b565d7326a)
@@ -387,10 +387,12 @@
 
 
-def kernel_name(model_info, is_2d):
-    # type: (ModelInfo, bool) -> str
+def kernel_name(model_info, variant):
+    # type: (ModelInfo, str) -> str
     """
     Name of the exported kernel symbol.
-    """
-    return model_info.name + "_" + ("Iqxy" if is_2d else "Iq")
+
+    *variant* is "Iq", "Iqxy" or "Imagnetic".
+    """
+    return model_info.name + "_" + variant
 
 
@@ -555,7 +557,7 @@
     refs = ["_q[_i]"] + _call_pars("_v.", partable.iq_parameters)
     call_iq = "#define CALL_IQ(_q,_i,_v) Iq(%s)" % (",".join(refs))
-    if _have_Iqxy(user_code):
+    if _have_Iqxy(user_code) or isinstance(model_info.Iqxy, str):
         # Call 2D model
-        refs = ["q[2*_i]", "q[2*_i+1]"] + _call_pars("_v.", partable.iqxy_parameters)
+        refs = ["_q[2*_i]", "_q[2*_i+1]"] + _call_pars("_v.", partable.iqxy_parameters)
         call_iqxy = "#define CALL_IQ(_q,_i,_v) Iqxy(%s)" % (",".join(refs))
     else:
@@ -566,7 +568,12 @@
         call_iqxy = "#define CALL_IQ(_q,_i,_v) Iq(%s)" % (",".join(pars_sqrt))
 
+    magpars = [k-2 for k,p in enumerate(partable.call_parameters)
+               if p.type == 'sld']
+
     # Fill in definitions for numbers of parameters
     source.append("#define MAX_PD %s"%partable.max_pd)
     source.append("#define NPARS %d"%partable.npars)
+    source.append("#define NUM_MAGNETIC %d" % len(magpars))
+    source.append("#define MAGNETIC_PARS %s"%",".join(str(k) for k in magpars))
 
     # TODO: allow mixed python/opencl kernels?
@@ -584,5 +591,5 @@
     source = [
         # define the Iq kernel
-        "#define KERNEL_NAME %s_Iq"%name,
+        "#define KERNEL_NAME %s_Iq" % name,
         call_iq,
         kernel_code,
@@ -591,7 +598,16 @@
 
         # define the Iqxy kernel from the same source with different #defines
-        "#define KERNEL_NAME %s_Iqxy"%name,
+        "#define KERNEL_NAME %s_Iqxy" % name,
         call_iqxy,
         kernel_code,
+        "#undef CALL_IQ",
+        "#undef KERNEL_NAME",
+
+        # define the Imagnetic kernel
+        "#define KERNEL_NAME %s_Imagnetic" % name,
+        "#define MAGNETIC 1",
+        call_iqxy,
+        kernel_code,
+        "#undef MAGNETIC",
         "#undef CALL_IQ",
         "#undef KERNEL_NAME",
Index: sasmodels/kernel.py
===================================================================
--- sasmodels/kernel.py	(revision def2c1b8807cdb5947a1d92fcd67d3804a46710f)
+++ sasmodels/kernel.py	(revision 32e3c9bc7952e078b48a3a2ce4bd06b565d7326a)
@@ -41,6 +41,6 @@
     results = None # type: List[np.ndarray]
 
-    def __call__(self, call_details, values, cutoff):
-        # type: (CallDetails, np.ndarray, np.ndarray, float) -> np.ndarray
+    def __call__(self, call_details, values, cutoff, magnetic):
+        # type: (CallDetails, np.ndarray, np.ndarray, float, bool) -> np.ndarray
         raise NotImplementedError("need to implement __call__")
 
Index: sasmodels/kernel_iq.c
===================================================================
--- sasmodels/kernel_iq.c	(revision a738209896d6b95cdec6fe71509f3a6ca558bef3)
+++ sasmodels/kernel_iq.c	(revision 32e3c9bc7952e078b48a3a2ce4bd06b565d7326a)
@@ -33,4 +33,44 @@
 #endif
 
+#ifdef MAGNETIC
+const int32_t magnetic[] = { MAGNETIC_PARS };
+#endif
+
+#ifdef MAGNETIC
+// Return value restricted between low and high
+static double clip(double value, double low, double high)
+{
+    return (value < low ? low : (value > high ? high : value));
+}
+
+// Compute spin cross sections given in_spin and out_spin
+// To convert spin cross sections to sld b:
+//     uu * (sld - m_sigma_x);
+//     dd * (sld + m_sigma_x);
+//     ud * (m_sigma_y + 1j*m_sigma_z);
+//     du * (m_sigma_y - 1j*m_sigma_z);
+static void spins(double in_spin, double out_spin,
+    double *uu, double *dd, double *ud, double *du)
+{
+    in_spin = clip(in_spin, 0.0, 1.0);
+    out_spin = clip(out_spin, 0.0, 1.0);
+	*uu = sqrt(sqrt(in_spin * out_spin));
+	*dd = sqrt(sqrt((1.0-in_spin) * (1.0-out_spin)));
+	*ud = sqrt(sqrt(in_spin * (1.0-out_spin)));
+	*du = sqrt(sqrt((1.0-in_spin) * out_spin));
+}
+
+// Convert polar to rectangular coordinates.
+static void polrec(double r, double theta, double phi,
+    double *x, double *y, double *z)
+{
+    double cos_theta, sin_theta, cos_phi, sin_phi;
+    SINCOS(theta*M_PI_180, sin_theta, cos_theta);
+    SINCOS(phi*M_PI_180, sin_phi, cos_phi);
+    *x = r * cos_theta * cos_phi;
+    *y = r * sin_theta;
+    *z = -r * cos_theta * sin_phi;
+}
+#endif
 
 kernel
@@ -40,5 +80,6 @@
     const int32_t pd_stop,      // where we are stopping in the polydispersity loop
     global const ProblemDetails *details,
-    global const double *values,
+   // global const  // TODO: make it const again!
+    double *values,
     global const double *q, // nq q values, with padding to boundary
     global double *result,  // nq+3 return values, again with padding
@@ -52,4 +93,6 @@
 
   // Fill in the initial variables
+  //   values[0] is scale
+  //   values[1] is background
   #ifdef USE_OPENMP
   #pragma omp parallel for
@@ -58,4 +101,28 @@
     pvec[k] = values[k+2];
   }
+#ifdef MAGNETIC
+  const double up_frac_i = values[NPARS+2];
+  const double up_frac_f = values[NPARS+3];
+  const double up_angle = values[NPARS+4];
+  #define MX(_k) (values[NPARS+5+3*_k])
+  #define MY(_k) (values[NPARS+6+3*_k])
+  #define MZ(_k) (values[NPARS+7+3*_k])
+
+  // TODO: precompute this on the python side
+  // Convert polar to rectangular coordinates in place.
+  if (pd_start == 0) {  // Update in place; only do this for the first hunk!
+//printf("spin: %g %g %g\n", up_frac_i, up_frac_f, up_angle);
+    for (int mag=0; mag < NUM_MAGNETIC; mag++) {
+//printf("mag %d: %g %g %g\n", mag, MX(mag), MY(mag), MZ(mag));
+        polrec(MX(mag), MY(mag), MZ(mag), &MX(mag), &MY(mag), &MZ(mag));
+//printf("   ==>: %g %g %g\n", MX(mag), MY(mag), MZ(mag));
+    }
+  }
+  // Interpret polarization cross section.
+  double uu, dd, ud, du;
+  double cos_mspin, sin_mspin;
+  spins(up_frac_i, up_frac_f, &uu, &dd, &ud, &du);
+  SINCOS(-up_angle*M_PI_180, sin_mspin, cos_mspin);
+#endif
 
   // Monodisperse computation
@@ -74,5 +141,59 @@
     #endif
     for (int q_index=0; q_index < nq; q_index++) {
+#ifdef MAGNETIC
+      const double qx = q[2*q_index];
+      const double qy = q[2*q_index+1];
+      const double qsq = qx*qx + qy*qy;
+
+      // Constant across orientation, polydispersity for given qx, qy
+      double px, py, pz;
+      if (qsq > 1e-16) {
+        px = (qy*cos_mspin + qx*sin_mspin)/qsq;
+        py = (qy*sin_mspin - qx*cos_mspin)/qsq;
+        pz = 1.0;
+      } else {
+        px = py = pz = 0.0;
+      }
+
+      double scattering = 0.0;
+      if (uu > 1e-8) {
+        for (int mag=0; mag<NUM_MAGNETIC; mag++) {
+            const double perp = (qy*MX(mag) - qx*MY(mag));
+            pvec[magnetic[mag]] = (values[magnetic[mag]+2] - perp*px)*uu;
+        }
+        scattering += CALL_IQ(q, q_index, local_values);
+      }
+      if (dd > 1e-8){
+        for (int mag=0; mag<NUM_MAGNETIC; mag++) {
+            const double perp = (qy*MX(mag) - qx*MY(mag));
+            pvec[magnetic[mag]] = (values[magnetic[mag]+2] + perp*px)*dd;
+        }
+        scattering += CALL_IQ(q, q_index, local_values);
+      }
+      if (ud > 1e-8){
+        for (int mag=0; mag<NUM_MAGNETIC; mag++) {
+            const double perp = (qy*MX(mag) - qx*MY(mag));
+            pvec[magnetic[mag]] = perp*py*ud;
+        }
+        scattering += CALL_IQ(q, q_index, local_values);
+        for (int mag=0; mag<NUM_MAGNETIC; mag++) {
+            pvec[magnetic[mag]] = MZ(mag)*pz*ud;
+        }
+        scattering += CALL_IQ(q, q_index, local_values);
+      }
+      if (du > 1e-8) {
+        for (int mag=0; mag<NUM_MAGNETIC; mag++) {
+            const double perp = (qy*MX(mag) - qx*MY(mag));
+            pvec[magnetic[mag]] = perp*py*du;
+        }
+        scattering += CALL_IQ(q, q_index, local_values);
+        for (int mag=0; mag<NUM_MAGNETIC; mag++) {
+            pvec[magnetic[mag]] = -MZ(mag)*pz*du;
+        }
+        scattering += CALL_IQ(q, q_index, local_values);
+      }
+#else
       double scattering = CALL_IQ(q, q_index, local_values);
+#endif
       result[q_index] = (norm>0. ? scale*scattering/norm + background : background);
     }
@@ -82,5 +203,9 @@
 #if MAX_PD > 0
 
+#if MAGNETIC
+  const double *pd_value = values+2+NPARS+3+3*NUM_MAGNETIC;
+#else
   const double *pd_value = values+2+NPARS;
+#endif
   const double *pd_weight = pd_value+details->pd_sum;
 
@@ -164,5 +289,59 @@
       #endif
       for (int q_index=0; q_index < nq; q_index++) {
-        const double scattering = CALL_IQ(q, q_index, local_values);
+#ifdef MAGNETIC
+        const double qx = q[2*q_index];
+        const double qy = q[2*q_index+1];
+        const double qsq = qx*qx + qy*qy;
+
+        // Constant across orientation, polydispersity for given qx, qy
+        double px, py, pz;
+        if (qsq > 1e-16) {
+          px = (qy*cos_mspin + qx*sin_mspin)/qsq;
+          py = (qy*sin_mspin - qx*cos_mspin)/qsq;
+          pz = 1.0;
+        } else {
+          px = py = pz = 0.0;
+        }
+
+        double scattering = 0.0;
+        if (uu > 1e-8) {
+          for (int mag=0; mag<NUM_MAGNETIC; mag++) {
+              const double perp = (qy*MX(mag) - qx*MY(mag));
+              pvec[magnetic[mag]] = (values[magnetic[mag]+2] - perp*px)*uu;
+          }
+          scattering += CALL_IQ(q, q_index, local_values);
+        }
+        if (dd > 1e-8){
+          for (int mag=0; mag<NUM_MAGNETIC; mag++) {
+              const double perp = (qy*MX(mag) - qx*MY(mag));
+              pvec[magnetic[mag]] = (values[magnetic[mag]+2] + perp*px)*dd;
+          }
+          scattering += CALL_IQ(q, q_index, local_values);
+        }
+        if (ud > 1e-8){
+          for (int mag=0; mag<NUM_MAGNETIC; mag++) {
+              const double perp = (qy*MX(mag) - qx*MY(mag));
+              pvec[magnetic[mag]] = perp*py*ud;
+          }
+          scattering += CALL_IQ(q, q_index, local_values);
+          for (int mag=0; mag<NUM_MAGNETIC; mag++) {
+              pvec[magnetic[mag]] = MZ(mag)*pz*ud;
+          }
+          scattering += CALL_IQ(q, q_index, local_values);
+        }
+        if (du > 1e-8) {
+          for (int mag=0; mag<NUM_MAGNETIC; mag++) {
+              const double perp = (qy*MX(mag) - qx*MY(mag));
+              pvec[magnetic[mag]] = perp*py*du;
+          }
+          scattering += CALL_IQ(q, q_index, local_values);
+          for (int mag=0; mag<NUM_MAGNETIC; mag++) {
+              pvec[magnetic[mag]] = -MZ(mag)*pz*du;
+          }
+          scattering += CALL_IQ(q, q_index, local_values);
+        }
+#else
+        double scattering = CALL_IQ(q, q_index, local_values);
+#endif
         result[q_index] += weight*scattering;
       }
Index: sasmodels/kernelcl.py
===================================================================
--- sasmodels/kernelcl.py	(revision def2c1b8807cdb5947a1d92fcd67d3804a46710f)
+++ sasmodels/kernelcl.py	(revision 32e3c9bc7952e078b48a3a2ce4bd06b565d7326a)
@@ -385,5 +385,5 @@
         self.program = None
 
-    def make_kernel(self, q_vectors):
+    def make_kernel(self, q_vectors, magnetic=False):
         # type: (List[np.ndarray]) -> "GpuKernel"
         if self.program is None:
@@ -392,5 +392,6 @@
                                     self.dtype, self.fast)
         is_2d = len(q_vectors) == 2
-        kernel_name = generate.kernel_name(self.info, is_2d)
+        variant = "Imagnetic" if magnetic else "Iqxy" if is_2d else "Iq"
+        kernel_name = generate.kernel_name(self.info, variant)
         kernel = getattr(self.program, kernel_name)
         return GpuKernel(kernel, self.dtype, self.info, q_vectors)
@@ -519,6 +520,6 @@
                      else np.float32)  # will never get here, so use np.float32
 
-    def __call__(self, call_details, values, cutoff):
-        # type: (CallDetails, np.ndarray, np.ndarray, float) -> np.ndarray
+    def __call__(self, call_details, values, cutoff, magnetic):
+        # type: (CallDetails, np.ndarray, np.ndarray, float, bool) -> np.ndarray
         context = self.queue.context
         # Arrange data transfer to card
Index: sasmodels/kerneldll.py
===================================================================
--- sasmodels/kerneldll.py	(revision def2c1b8807cdb5947a1d92fcd67d3804a46710f)
+++ sasmodels/kerneldll.py	(revision 32e3c9bc7952e078b48a3a2ce4bd06b565d7326a)
@@ -270,8 +270,10 @@
         # int, int, int, int*, double*, double*, double*, double*, double
         argtypes = [c_int32]*3 + [c_void_p]*4 + [fp]
-        self._Iq = self._dll[generate.kernel_name(self.info, is_2d=False)]
-        self._Iqxy = self._dll[generate.kernel_name(self.info, is_2d=True)]
+        self._Iq = self._dll[generate.kernel_name(self.info, "Iq")]
+        self._Iqxy = self._dll[generate.kernel_name(self.info, "Iqxy")]
+        self._Imagnetic = self._dll[generate.kernel_name(self.info, "Imagnetic")]
         self._Iq.argtypes = argtypes
         self._Iqxy.argtypes = argtypes
+        self._Imagnetic.argtypes = argtypes
 
     def __getstate__(self):
@@ -284,5 +286,5 @@
         self._dll = None
 
-    def make_kernel(self, q_vectors):
+    def make_kernel(self, q_vectors, magnetic=False):
         # type: (List[np.ndarray]) -> DllKernel
         q_input = PyInput(q_vectors, self.dtype)
@@ -290,5 +292,5 @@
         if self._dll is None:
             self._load_dll()
-        kernel = self._Iqxy if q_input.is_2d else self._Iq
+        kernel = [self._Iqxy, self._Imagnetic] if q_input.is_2d else self._Iq
         return DllKernel(kernel, self.info, q_input)
 
@@ -341,6 +343,6 @@
                      else np.float128)
 
-    def __call__(self, call_details, values, cutoff):
-        # type: (CallDetails, np.ndarray, np.ndarray, float) -> np.ndarray
+    def __call__(self, call_details, values, cutoff, magnetic):
+        # type: (CallDetails, np.ndarray, np.ndarray, float, bool) -> np.ndarray
 
         #print("in kerneldll")
@@ -358,5 +360,5 @@
             ]
         #print("calling DLL")
-        self.kernel(*args) # type: ignore
+        self.kernel[1 if magnetic else 0](*args) # type: ignore
         return self.result[:-1]
 
Index: sasmodels/kernelpy.py
===================================================================
--- sasmodels/kernelpy.py	(revision a738209896d6b95cdec6fe71509f3a6ca558bef3)
+++ sasmodels/kernelpy.py	(revision 32e3c9bc7952e078b48a3a2ce4bd06b565d7326a)
@@ -155,5 +155,5 @@
                         else (lambda: 1.0))
 
-    def __call__(self, call_details, values, cutoff):
+    def __call__(self, call_details, values, cutoff, magnetic):
         assert isinstance(call_details, details.CallDetails)
         res = _loops(self._parameter_vector, self._form, self._volume,
Index: sasmodels/modelinfo.py
===================================================================
--- sasmodels/modelinfo.py	(revision ce176caba4802eee1a0c785304905c3c225d3c93)
+++ sasmodels/modelinfo.py	(revision 32e3c9bc7952e078b48a3a2ce4bd06b565d7326a)
@@ -414,4 +414,9 @@
         self.kernel_parameters = parameters
         self._set_vector_lengths()
+
+        self.npars = sum(p.length for p in self.kernel_parameters)
+        self.num_magnetic = sum(p.length for p in self.kernel_parameters
+                                if p.type=='sld')
+
         self.call_parameters = self._get_call_parameters()
         self.defaults = self._get_defaults()
@@ -441,19 +446,15 @@
         num_pd = sum(p.length for p in self.kernel_parameters if p.polydisperse)
         # Don't use more polydisperse parameters than are available in the model
-        # Note: we can do polydispersity on arbitrary parameters, so it is not
-        # clear that this is a good idea; it does however make the poly_details
-        # code easier to write, so we will leave it in for now.
         self.max_pd = min(num_pd, MAX_PD)
-
-        self.npars = sum(p.length for p in self.kernel_parameters)
 
         # true if has 2D parameters
         self.has_2d = any(p.type in ('orientation', 'magnetic')
                           for p in self.kernel_parameters)
+        self.magnetism_index = [k for k,p in enumerate(self.call_parameters)
+                                if p.id.startswith('M0:')]
 
         self.pd_1d = set(p.name for p in self.call_parameters
                          if p.polydisperse and p.type not in ('orientation', 'magnetic'))
-        self.pd_2d = set(p.name for p in self.call_parameters
-                         if p.polydisperse and p.type != 'magnetic')
+        self.pd_2d = set(p.name for p in self.call_parameters if p.polydisperse)
 
     def _set_vector_lengths(self):
@@ -519,4 +520,26 @@
                     pk.relative_pd = p.relative_pd
                     full_list.append(pk)
+
+        # Add the magnetic parameters to the end of the call parameter list.
+        if self.num_magnetic > 0:
+            full_list.extend([
+                Parameter('up:frac_i', '', 0., [0., 1.],
+                          'magnetic', 'fraction of spin up incident'),
+                Parameter('up:frac_f', '', 0., [0., 1.],
+                          'magnetic', 'fraction of spin up final'),
+                Parameter('up:angle', 'degress', 0., [0., 360.],
+                          'magnetic', 'spin up angle'),
+            ])
+            slds = [p for p in full_list if p.type == 'sld']
+            for p in slds:
+                full_list.extend([
+                    Parameter('M0:'+p.id, '1e-6/Ang^2', 0., [-np.inf, np.inf],
+                              'magnetic', 'magnetic amplitude for '+p.description),
+                    Parameter('mtheta:'+p.id, 'degrees', 0., [-90., 90.],
+                               'magnetic', 'magnetic latitude for '+p.description),
+                    Parameter('mphi:'+p.id, 'degrees', 0., [-180., 180.],
+                               'magnetic', 'magnetic longitude for '+p.description),
+                ])
+        #print("call parameters", full_list)
         return full_list
 
@@ -553,4 +576,8 @@
         parameter is always returned first since the GUI will want to set it
         early, and rerender the table when it is changed.
+
+        Parameters marked as sld will automatically have a set of associated
+        magnetic parameters (m0:p, mtheta:p, mphi:p), as well as polarization
+        information (up:theta, up:frac_i, up:frac_f).
         """
         # control parameters go first
@@ -565,12 +592,20 @@
 
         # Gather entries such as name[4] into groups of the same length
-        fixed = {}  # type: Dict[int, List[Parameter]]
+        fixed_length = {}  # type: Dict[int, List[Parameter]]
         for p in self.kernel_parameters:
             if p.length > 1 and p.length_control is None:
-                fixed.setdefault(p.length, []).append(p)
+                fixed_length.setdefault(p.length, []).append(p)
 
         # Using the call_parameters table, we already have expanded forms
         # for each of the vector parameters; put them in a lookup table
         expanded_pars = dict((p.name, p) for p in self.call_parameters)
+
+        def append_group(name):
+            """add the named parameter, and related magnetic parameters if any"""
+            result.append(expanded_pars[name])
+            if is2d:
+                for tag in 'M0:', 'mtheta:', 'mphi:':
+                    if tag+name in expanded_pars:
+                        result.append(expanded_pars[tag+name])
 
         # Gather the user parameters in order
@@ -589,19 +624,26 @@
                     for k in range(1, table_length+1):
                         for entry in table:
-                            result.append(expanded_pars[entry.id+str(k)])
+                            append_group(entry.id+str(k))
                 else:
                     pass # already processed all entries
             elif p.length > 1:
-                table = fixed.get(p.length, [])
+                table = fixed_length.get(p.length, [])
                 if table:
                     table_length = p.length
-                    del fixed[p.length]
+                    del fixed_length[p.length]
                     for k in range(1, table_length+1):
                         for entry in table:
-                            result.append(expanded_pars[entry.id+str(k)])
+                            append_group(entry.id+str(k))
                 else:
                     pass # already processed all entries
             else:
-                result.append(p)
+                append_group(p.id)
+
+        if is2d and 'up:angle' in expanded_pars:
+            result.extend([
+                expanded_pars['up:frac_i'],
+                expanded_pars['up:frac_f'],
+                expanded_pars['up:angle'],
+            ])
 
         return result
@@ -634,4 +676,5 @@
     if (model_info.Iq is None
         and model_info.Iqxy is None
+        and model_info.Imagnetic is None
         and model_info.form_volume is None):
         return
@@ -643,5 +686,7 @@
         return
     for k, v in enumerate(source.split('\n')):
-        if v.startswith('Iqxy'):
+        if v.startswith('Imagnetic'):
+            model_info._Imagnetic_line = k+1
+        elif v.startswith('Iqxy'):
             model_info._Iqxy_line = k+1
         elif v.startswith('Iq'):
@@ -692,4 +737,5 @@
     info.Iq = getattr(kernel_module, 'Iq', None) # type: ignore
     info.Iqxy = getattr(kernel_module, 'Iqxy', None) # type: ignore
+    info.Imagnetic = getattr(kernel_module, 'Imagnetic', None) # type: ignore
     info.profile = getattr(kernel_module, 'profile', None) # type: ignore
     info.sesans = getattr(kernel_module, 'sesans', None) # type: ignore
@@ -843,4 +889,6 @@
     #: Returns *I(qx, qy, a, b, ...)*.  The interface follows :attr:`Iq`.
     Iqxy = None             # type: Union[None, str, Callable[[np.ndarray], np.ndarray]]
+    #: Returns *I(qx, qy, a, b, ...)*.  The interface follows :attr:`Iq`.
+    Imagnetic = None        # type: Union[None, str, Callable[[np.ndarray], np.ndarray]]
     #: Returns a model profile curve *x, y*.  If *profile* is defined, this
     #: curve will appear in response to the *Show* button in SasView.  Use
@@ -857,4 +905,5 @@
     # line numbers within the python file for bits of C source, if defined
     # NB: some compilers fail with a "#line 0" directive, so default to 1.
+    _Imagnetic_line = 1
     _Iqxy_line = 1
     _Iq_line = 1
Index: sasmodels/sasview_model.py
===================================================================
--- sasmodels/sasview_model.py	(revision ce176caba4802eee1a0c785304905c3c225d3c93)
+++ sasmodels/sasview_model.py	(revision 32e3c9bc7952e078b48a3a2ce4bd06b565d7326a)
@@ -152,8 +152,9 @@
             orientation_params.append(p.name+".width")
             fixed.append(p.name+".width")
-        if p.type == 'magnetic':
+        elif p.type == 'magnetic':
             orientation_params.append(p.name)
             magnetic_params.append(p.name)
             fixed.append(p.name+".width")
+
 
     # Build class dictionary
@@ -512,5 +513,5 @@
                  for p in self._model_info.parameters.call_parameters]
         call_details, value = kernel.build_details(calculator, pairs)
-        result = calculator(call_details, value, cutoff=self.cutoff)
+        result = calculator(call_details, value, cutoff=self.cutoff, magnetic=False)
         calculator.release()
         return result
Index: setup.py
===================================================================
--- setup.py	(revision 3a161d0fa299434317dc0bc6a753a5ad6f50b4aa)
+++ setup.py	(revision 32e3c9bc7952e078b48a3a2ce4bd06b565d7326a)
@@ -46,5 +46,5 @@
     package_data={
         'sasmodels.models': ['*.c', 'lib/*.c'],
-        'sasmodels': ['*.c', '*.cl', 'convert.json'],
+        'sasmodels': ['*.c', '*.cl'],
     },
     install_requires = [
