added output of perceptual unfiform colormaps to GOM (DIC Aramis) format, deleted some old files in the documentation folder
This commit is contained in:
parent
8fd521443c
commit
43ec1d2051
|
@ -336,8 +336,13 @@ class Colormap():
|
|||
def write_raw(RGB_vector):
|
||||
return 'ColorMap name = '+str(name)+'\n' \
|
||||
+ '\n'.join(['%s'%('\t'.join(map(lambda x:str(x),v))) for v in RGB_vector])
|
||||
|
||||
|
||||
|
||||
def write_GOM(RGB_vector):
|
||||
return '1 1 '+str(name)+' 9 '+str(name)+' 0 1 0 3 0 0 -1 9 \ 0 0 0 255 255 255 0 0 255 '\
|
||||
+ '30 NO_UNIT 1 1 64 64 64 255 1 0 0 0 0 0 0 3 0 ' + str(len(RGB_vector))+' '\
|
||||
.join([' 0 %s 255 1'%(' '.join(map(lambda x:str(int(x*255.0)),v))) for v in reversed(RGB_vector)])+' '
|
||||
|
||||
|
||||
colors = []
|
||||
totalSteps = int(2.0*steps/(crop[1] - crop[0]))
|
||||
|
||||
|
@ -350,6 +355,7 @@ class Colormap():
|
|||
return {\
|
||||
'paraview': write_paraview,
|
||||
'gmsh': write_gmsh,
|
||||
'gom': write_GOM,
|
||||
'raw': write_raw,
|
||||
'list': lambda x: x,
|
||||
}[format.lower()](colors[max(leftIndex,0):min(rightIndex,totalSteps)])
|
||||
|
|
|
@ -36,17 +36,17 @@ deformation gradient and first Piola--Kirchhoff stress.
|
|||
)
|
||||
|
||||
parser.add_option('-l','--left', dest='left', type='float', nargs=3, \
|
||||
help='left color [%default]')
|
||||
help='left color %default')
|
||||
parser.add_option('-r','--right', dest='right', type='float', nargs=3, \
|
||||
help='right color [%default]')
|
||||
help='right color %default')
|
||||
parser.add_option('-c','--colormodel', dest='colormodel', \
|
||||
help='colormodel of left and right "RGB","HSL","XYZ","CIELAB","MSH" [%default]')
|
||||
parser.add_option('-f','--format', dest='format', action='extend', \
|
||||
help='output file format "paraview","gmsh","raw" [%default]')
|
||||
help='output file format "paraview","gmsh","raw","GOM",[paraview, autodetect if output file extension is given]')
|
||||
parser.add_option('-s','--steps', dest='steps', type='int', nargs = 1, \
|
||||
help='no of interpolation steps [%default]')
|
||||
parser.add_option('-t','--trim', dest='trim', type='float', nargs = 2, \
|
||||
help='trim the colormap w.r.t the given values [%default]')
|
||||
help='trim the colormap w.r.t the given values %default')
|
||||
|
||||
parser.set_defaults(colormodel = 'RGB')
|
||||
parser.set_defaults(format = [''])
|
||||
|
@ -56,8 +56,8 @@ parser.set_defaults(left = [1.0,1.0,1.0])
|
|||
parser.set_defaults(right = [0.0,0.0,0.0])
|
||||
(options,filenames) = parser.parse_args()
|
||||
|
||||
outtypes = ['paraview','gmsh','raw']
|
||||
extensions = ['.xml','.msh','.txt']
|
||||
outtypes = ['paraview','gmsh','raw','GOM']
|
||||
extensions = ['.xml','.msh','.txt','.legend']
|
||||
if options.trim[0]< -1.0 or \
|
||||
options.trim[1] > 1.0 or \
|
||||
options.trim[0]>= options.trim[1]:
|
||||
|
|
Loading…
Reference in New Issue