예제 #1
0
 def from_tree_transform(cls, node, ctx):
     if cls.version < AsdfVersion('1.4.0'):
         # The 'dimensions' property was added in 1.4.0,
         # previously all values were 1D.
         return functional_models.Const1D(node['value'])
     elif node['dimensions'] == 1:
         return functional_models.Const1D(node['value'])
     elif node['dimensions'] == 2:
         return functional_models.Const2D(node['value'])
예제 #2
0
파일: basic.py 프로젝트: lpsinger/astropy
 def from_tree_transform(cls, node, ctx):
     if cls.version < AsdfVersion('1.4.0'):
         # The 'dimensions' property was added in 1.4.0,
         # previously all values were 1D.
         return functional_models.Const1D(node['value'])
     elif node['dimensions'] == 1:
         return functional_models.Const1D(node['value'])
     elif node['dimensions'] == 2:
         return functional_models.Const2D(node['value'])
     else:
         raise TypeError('Only 1D and 2D constant models are supported.')
예제 #3
0
파일: basic.py 프로젝트: sashank27/astropy
 def from_tree_transform(cls, node, ctx):
     if node['dimensions'] == 1:
         return functional_models.Const1D(node['value'])
     elif node['dimensions'] == 2:
         return functional_models.Const2D(node['value'])