Changeset 47fafe9 in sasmodels


Ignore:
Timestamp:
Nov 16, 2016 1:41:33 PM (7 years ago)
Author:
krzywon
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
f8f5a37
Parents:
8d06779
Message:

#795: Old style structure factors are now loaded in properly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/convert.py

    r8d06779 r47fafe9  
    44from __future__ import print_function, division 
    55 
     6import re 
    67import math 
    78import warnings 
     
    7273    if id.startswith('M0:'): 
    7374        return True 
     75    if id.startswith('volfraction') or id.startswith('radius_effective'): 
     76        return False 
    7477    if '_pd' in id or '.' in id: 
    7578        return False 
     
    133136    :return: 
    134137    """ 
    135     import re 
    136138    new_pars = {} 
     139    i = 0 
     140    j = 0 
    137141    for key_par, value_par in pars.iteritems(): 
     142        j += 1 
    138143        for key_conv, value_conv in conv_dict.iteritems(): 
    139144            if re.search(value_conv, key_par): 
    140145                new_pars[key_par.replace(value_conv, key_conv)] = value_par 
     146                i += 1 
    141147                break 
    142148            elif re.search("background", key_par) or re.search("scale", key_par): 
    143149                new_pars[key_par] = value_par 
     150                i += 1 
    144151                break 
     152        if i != j: 
     153            new_pars[key_par] = value_par 
     154            i += 1 
    145155    return new_pars 
    146156 
     
    295305    newpars = _hand_convert(newname, newpars) 
    296306    newpars = _convert_pars(newpars, translation) 
    297     newpars = _rescale_sld(model_info, newpars, 1e6) 
     307    if not model_info.structure_factor: 
     308        newpars = _rescale_sld(model_info, newpars, 1e6) 
    298309    newpars.setdefault('scale', 1.0) 
    299310    newpars.setdefault('background', 0.0) 
Note: See TracChangeset for help on using the changeset viewer.