Commit 9f636149 authored by Florian Ziemen's avatar Florian Ziemen
Browse files

added features for dealing with missing pressure field to day-night

parent 88cd72eb
......@@ -95,21 +95,36 @@ SetActiveView(renderView1)
# setup the data processing pipelines
# ----------------------------------------------------------------
# create a new 'CDIReader'
cloud_psl = CDIReader(registrationName='cloud_psl', FileNames=[options["clouds"]])
cloud_psl.Dimensions = '(clon, clat, sfc)'
cloud_psl.CellArrayStatus = ['rsdt', 'cloud']
cloud_psl.SetProjection = 'Spherical Projection'
cloud_psl.LayerThickness = 50
cloud_psl.MaskingValueVar = 'rsdt'
psl = CDIReader(registrationName='psl', FileNames=[options["psl"]])
psl.Dimensions = '(clon, clat, sfc)'
psl.CellArrayStatus = ['psl']
psl.SetProjection = 'Spherical Projection'
psl.LayerThickness = 50
psl.MaskingValueVar = 'psl'
if "UM" in options["clouds"]:
cloud_psl = NetCDFReader(registrationName='cloud_psl', FileName=[options["clouds"]])
cloud_psl.Dimensions = '(latitude, longitude)'
cloud_psl.VerticalScale = 200.0
else:
# create a new 'CDIReader'
cloud_psl = CDIReader(registrationName='cloud_psl', FileNames=[options["clouds"]])
cloud_psl.Dimensions = '(clon, clat, sfc)'
cloud_psl.CellArrayStatus = ['cloud']
cloud_psl.SetProjection = 'Spherical Projection'
cloud_psl.LayerThickness = 50
cloud_psl.MaskingValueVar = 'cloud'
if options.get("psl", False):
psl = CDIReader(registrationName='psl', FileNames=[options["psl"]])
psl.Dimensions = '(clon, clat, sfc)'
psl.CellArrayStatus = ['psl']
psl.SetProjection = 'Spherical Projection'
psl.LayerThickness = 50
psl.MaskingValueVar = 'psl'
# create a new 'Cell Data to Point Data'
psl_to_point = CellDatatoPointData(registrationName='psl_to_point', Input=psl)
psl_to_point.ProcessAllArrays = 0
psl_to_point.CellDataArraytoprocess = ['psl']
# create a new 'Contour'
psl_contour = Contour(registrationName='psl_contour', Input=psl_to_point)
psl_contour.ContourBy = ['POINTS', 'psl']
psl_contour.Isosurfaces = [99000.0, 100500.0, 102000.0, 103500.0]
psl_contour.PointMergeMethod = 'Uniform Binning'
# create a new 'NetCDF Time Annotation'
netCDFTimeAnnotation1 = NetCDFTimeAnnotation(registrationName='NetCDFTimeAnnotation1', Input=cloud_psl)
......@@ -121,16 +136,6 @@ alpha.AttributeType = 'Cell Data'
alpha.ResultArrayName = 'alpha'
alpha.Function = ' (3/2 * cloud *100)/ (3/2 * cloud *100+7)'
# create a new 'Cell Data to Point Data'
psl_to_point = CellDatatoPointData(registrationName='psl_to_point', Input=psl)
psl_to_point.ProcessAllArrays = 0
psl_to_point.CellDataArraytoprocess = ['psl']
# create a new 'Contour'
psl_contour = Contour(registrationName='psl_contour', Input=psl_to_point)
psl_contour.ContourBy = ['POINTS', 'psl']
psl_contour.Isosurfaces = [99000.0, 100500.0, 102000.0, 103500.0]
psl_contour.PointMergeMethod = 'Uniform Binning'
# create a new 'CDIReader'
rsdt_file = options["light"]
......@@ -372,65 +377,66 @@ nightDisplay.ExtrusionInputDataArray = ['CELLS', 'alpha']
nightDisplay.SelectInputVectors = ['POINTS', 'Texture Coordinates']
nightDisplay.WriteLog = ''
# show data from psl_contour
psl_contourDisplay = Show(psl_contour, renderView1, 'GeometryRepresentation')
# get color transfer function/color map for 'psl'
pslLUT = GetColorTransferFunction('psl')
pslLUT.AutomaticRescaleRangeMode = 'Never'
pslLUT.RGBPoints = [100000.0, 0.23137254902, 0.298039215686, 0.752941176471, 101250.0, 0.865, 0.865, 0.865, 102500.0, 0.705882352941, 0.0156862745098, 0.149019607843]
pslLUT.ScalarRangeInitialized = 1.0
# trace defaults for the display properties.
psl_contourDisplay.Representation = 'Surface'
psl_contourDisplay.ColorArrayName = ['POINTS', 'psl']
psl_contourDisplay.LookupTable = pslLUT
psl_contourDisplay.LineWidth = 4.0
psl_contourDisplay.SelectTCoordArray = 'None'
psl_contourDisplay.SelectNormalArray = 'None'
psl_contourDisplay.SelectTangentArray = 'None'
psl_contourDisplay.Scale = [1.001, 1.001, 1.001]
psl_contourDisplay.OSPRayScaleArray = 'psl'
psl_contourDisplay.OSPRayScaleFunction = 'PiecewiseFunction'
psl_contourDisplay.SelectOrientationVectors = 'None'
psl_contourDisplay.ScaleFactor = 39.99499206542969
psl_contourDisplay.SelectScaleArray = 'psl'
psl_contourDisplay.GlyphType = 'Arrow'
psl_contourDisplay.GlyphTableIndexArray = 'psl'
psl_contourDisplay.GaussianRadius = 1.9997496032714843
psl_contourDisplay.SetScaleArray = ['POINTS', 'psl']
psl_contourDisplay.ScaleTransferFunction = 'PiecewiseFunction'
psl_contourDisplay.OpacityArray = ['POINTS', 'psl']
psl_contourDisplay.OpacityTransferFunction = 'PiecewiseFunction'
psl_contourDisplay.DataAxesGrid = 'GridAxesRepresentation'
psl_contourDisplay.PolarAxes = 'PolarAxesRepresentation'
psl_contourDisplay.BumpMapInputDataArray = ['POINTS', 'psl']
psl_contourDisplay.ExtrusionInputDataArray = ['POINTS', 'psl']
psl_contourDisplay.SelectInputVectors = ['POINTS', 'psl']
psl_contourDisplay.WriteLog = ''
# init the 'PiecewiseFunction' selected for 'ScaleTransferFunction'
psl_contourDisplay.ScaleTransferFunction.Points = [99000.0, 0.0, 0.5, 0.0, 103500.0, 1.0, 0.5, 0.0]
# init the 'PiecewiseFunction' selected for 'OpacityTransferFunction'
psl_contourDisplay.OpacityTransferFunction.Points = [99000.0, 0.0, 0.5, 0.0, 103500.0, 1.0, 0.5, 0.0]
# init the 'PolarAxesRepresentation' selected for 'PolarAxes'
psl_contourDisplay.PolarAxes.Scale = [1.001, 1.001, 1.001]
# ----------------------------------------------------------------
# setup color maps and opacity mapes used in the visualization
# note: the Get..() functions create a new object, if needed
# ----------------------------------------------------------------
# get opacity transfer function/opacity map for 'psl'
pslPWF = GetOpacityTransferFunction('psl')
pslPWF.Points = [100000.0, 0.0, 0.5, 0.0, 102500.0, 1.0, 0.5, 0.0]
pslPWF.ScalarRangeInitialized = 1
if options.get("psl", False):
# show data from psl_contour
psl_contourDisplay = Show(psl_contour, renderView1, 'GeometryRepresentation')
# get color transfer function/color map for 'psl'
pslLUT = GetColorTransferFunction('psl')
pslLUT.AutomaticRescaleRangeMode = 'Never'
pslLUT.RGBPoints = [100000.0, 0.23137254902, 0.298039215686, 0.752941176471, 101250.0, 0.865, 0.865, 0.865, 102500.0, 0.705882352941, 0.0156862745098, 0.149019607843]
pslLUT.ScalarRangeInitialized = 1.0
# trace defaults for the display properties.
psl_contourDisplay.Representation = 'Surface'
psl_contourDisplay.ColorArrayName = ['POINTS', 'psl']
psl_contourDisplay.LookupTable = pslLUT
psl_contourDisplay.LineWidth = 4.0
psl_contourDisplay.SelectTCoordArray = 'None'
psl_contourDisplay.SelectNormalArray = 'None'
psl_contourDisplay.SelectTangentArray = 'None'
psl_contourDisplay.Scale = [1.001, 1.001, 1.001]
psl_contourDisplay.OSPRayScaleArray = 'psl'
psl_contourDisplay.OSPRayScaleFunction = 'PiecewiseFunction'
psl_contourDisplay.SelectOrientationVectors = 'None'
psl_contourDisplay.ScaleFactor = 39.99499206542969
psl_contourDisplay.SelectScaleArray = 'psl'
psl_contourDisplay.GlyphType = 'Arrow'
psl_contourDisplay.GlyphTableIndexArray = 'psl'
psl_contourDisplay.GaussianRadius = 1.9997496032714843
psl_contourDisplay.SetScaleArray = ['POINTS', 'psl']
psl_contourDisplay.ScaleTransferFunction = 'PiecewiseFunction'
psl_contourDisplay.OpacityArray = ['POINTS', 'psl']
psl_contourDisplay.OpacityTransferFunction = 'PiecewiseFunction'
psl_contourDisplay.DataAxesGrid = 'GridAxesRepresentation'
psl_contourDisplay.PolarAxes = 'PolarAxesRepresentation'
psl_contourDisplay.BumpMapInputDataArray = ['POINTS', 'psl']
psl_contourDisplay.ExtrusionInputDataArray = ['POINTS', 'psl']
psl_contourDisplay.SelectInputVectors = ['POINTS', 'psl']
psl_contourDisplay.WriteLog = ''
# init the 'PiecewiseFunction' selected for 'ScaleTransferFunction'
psl_contourDisplay.ScaleTransferFunction.Points = [99000.0, 0.0, 0.5, 0.0, 103500.0, 1.0, 0.5, 0.0]
# init the 'PiecewiseFunction' selected for 'OpacityTransferFunction'
psl_contourDisplay.OpacityTransferFunction.Points = [99000.0, 0.0, 0.5, 0.0, 103500.0, 1.0, 0.5, 0.0]
# init the 'PolarAxesRepresentation' selected for 'PolarAxes'
psl_contourDisplay.PolarAxes.Scale = [1.001, 1.001, 1.001]
# ----------------------------------------------------------------
# setup color maps and opacity mapes used in the visualization
# note: the Get..() functions create a new object, if needed
# ----------------------------------------------------------------
# get opacity transfer function/opacity map for 'psl'
pslPWF = GetOpacityTransferFunction('psl')
pslPWF.Points = [100000.0, 0.0, 0.5, 0.0, 102500.0, 1.0, 0.5, 0.0]
pslPWF.ScalarRangeInitialized = 1
# ----------------------------------------------------------------
# restore active source
SetActiveSource(psl_contour)
SetActiveSource(alpha)
# ----------------------------------------------------------------
......@@ -441,7 +447,7 @@ if "SHiELD" in options["clouds"] :
if __name__ == '__main__':
# generate extracts
renderView1.Background = [1.0, 1.0, 1.0]
SaveScreenshot(options["clouds"][:-3]+'_white-dark.png', renderView1, ImageResolution=[1920, 1080])
SaveScreenshot(options["clouds"][:-3]+'_white.png', renderView1, ImageResolution=[1920, 1080])
SaveScreenshot(options["clouds"][:-3]+'_white4k.png', renderView1, ImageResolution=[3840, 2160]) # TransparentBackground=1
renderView1.Background = [0., 0., 0.]
SaveScreenshot(options["clouds"][:-3]+'_black.png', renderView1, ImageResolution=[1920, 1080])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment