Commit e44ef7ef authored by Florian Ziemen's avatar Florian Ziemen
Browse files

backup

parent b41ede56
......@@ -2,7 +2,7 @@
#SBATCH --job-name=clouds # Specify job name
#SBATCH --partition=compute2 # Specify partition name
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=36
#SBATCH --ntasks-per-node=24
#SBATCH --time=02:00:00 # Set a limit on the total run time
#SBATCH --mail-type=FAIL # Notify user by email in case of job failure
#SBATCH --account=bb1153 # Charge resources on this project account
......@@ -14,18 +14,19 @@
set -vx
module load paraview/5.7-insitu
#module load paraview
which pvbatch
md5sum $(which pvbatch)
scriptdir=$(pwd)n
if [ "$1" == MOLL ] ; then moll="MOLL world" ; fi
if [ "$1" == MOLL ] ; then moll="MOLL world_no-legend" ; fi
if [ "$1" == SPHERE ] ; then moll=SPHERE ; fi
for x in $@ ; do
if [ "$x" == MOLL -o "$x" == SPHERE ] ; then
continue
fi
pr=${x/ts/pr}
pr=${x/ts/clivi_cllvi}
pvbatch clouds.py $moll $x $pr
done
# srun -l --propagate=STACK,CORE --cpu_bind=cores \
......
......@@ -6,7 +6,7 @@
# trace generated using paraview version 5.7.0-RC3-442-g1b4ad14
#
# To ensure correct image size when batch processing, please search
# To ensure correct image size when batch processing, please search
# for and uncomment the line `# renderView*.ViewSize = [*,*]`
#### import the simple module from the paraview
......@@ -63,7 +63,7 @@ regions = {"barbados": {"latlon" : (14,-56),
"ts_range":(20, 45),
"timestamp_location" : [0.025, 0.94],
"colorbar_font_color" : (1, 1, 1)},
"europe": {"latlon" : (50,0),
"scale": 70,
"ts_range":(-25, 20),
......@@ -81,7 +81,12 @@ regions = {"barbados": {"latlon" : (14,-56),
"colorbar_font_color" : (0, 0, 0)},
"world" : {"latlon" : (0,10),
"scale": 210,
"ts_range":(-50, 45),
"ts_range":(-50, 60),
"timestamp_location" : [0.025, 0.94],
"colorbar_font_color" : (1, 1, 1)},
"world_no-legend" : {"latlon" : (0,0),
"scale": 200,
"ts_range":(-50, 60),
"timestamp_location" : [0.025, 0.94],
"colorbar_font_color" : (1, 1, 1)}}
......@@ -89,14 +94,14 @@ regions = {"barbados": {"latlon" : (14,-56),
if (mollweide):
for key in regions.keys():
lat, lon = regions[key]['latlon']
x , y = mollweide_proj (lat ,lon )
x , y = mollweide_proj (lat ,lon )
regions[key]["position"] = (x,y,1000)
regions[key]["focus"] = (x,y,0)
if (sphere):
for key in regions.keys():
lat, lon = regions[key]['latlon']
x , y , z = sphere_proj (lat ,lon )
x , y , z = sphere_proj (lat ,lon )
regions[key]["position"] = (x,y,z)
regions[key]["focus"] = (0,0,0)
......@@ -111,17 +116,21 @@ def sort_location(obj, loc):
obj.WindowLocation = "AnyLocation"
obj.Position = loc
region = False
if regions.get(files[0], region):
r = regions.get(files[0], region)
regions = { files[0] : r}
region = files[0]
files = files[1:]
else:
if sphere:
regions.pop("world", True)
for r in regions.keys():
if world in r:
regions.pop(r, True)
print (regions)
print (region)
if "nwp" in files[1]:
scale = 4
......@@ -130,7 +139,7 @@ else:
print ("scaling precipitation by ", scale)
import numpy as np
#import numpy as np
from paraview.simple import *
# LoadPlugin('/sw/rhel6-x64/paraview/paraview-5.7.0-gcc71-osmesa/lib64/paraview-5.7/plugins/CDIReader/CDIReader.so', remote=False, ns=globals())
......@@ -178,6 +187,121 @@ SetActiveView(renderView1)
# setup the data processing pipelines
# ----------------------------------------------------------------
# create a new 'Legacy VTK Reader'
planar_coastlines_intermedres_riversvtk = LegacyVTKReader(FileNames=['/work/kv0653/Coastlines/Planar-Coastlines-0...360-for-ParaView/Planar_coastlines_intermedres_norivers.vtk'])
# show data in view
planar_coastlines_intermedres_riversvtkDisplay = Show(planar_coastlines_intermedres_riversvtk, renderView1)
# trace defaults for the display properties.
planar_coastlines_intermedres_riversvtkDisplay.Representation = 'Surface'
planar_coastlines_intermedres_riversvtkDisplay.ColorArrayName = [None, '']
planar_coastlines_intermedres_riversvtkDisplay.OSPRayScaleFunction = 'PiecewiseFunction'
planar_coastlines_intermedres_riversvtkDisplay.SelectOrientationVectors = 'None'
planar_coastlines_intermedres_riversvtkDisplay.ScaleFactor = 36.0
planar_coastlines_intermedres_riversvtkDisplay.SelectScaleArray = 'None'
planar_coastlines_intermedres_riversvtkDisplay.GlyphType = 'Arrow'
planar_coastlines_intermedres_riversvtkDisplay.GlyphTableIndexArray = 'None'
planar_coastlines_intermedres_riversvtkDisplay.GaussianRadius = 1.8
planar_coastlines_intermedres_riversvtkDisplay.SetScaleArray = [None, '']
planar_coastlines_intermedres_riversvtkDisplay.ScaleTransferFunction = 'PiecewiseFunction'
planar_coastlines_intermedres_riversvtkDisplay.OpacityArray = [None, '']
planar_coastlines_intermedres_riversvtkDisplay.OpacityTransferFunction = 'PiecewiseFunction'
planar_coastlines_intermedres_riversvtkDisplay.DataAxesGrid = 'GridAxesRepresentation'
planar_coastlines_intermedres_riversvtkDisplay.PolarAxes = 'PolarAxesRepresentation'
# update the view to ensure updated data information
renderView1.Update()
# create a new 'Programmable Filter'
programmableFilter1 = ProgrammableFilter(Input=planar_coastlines_intermedres_riversvtk)
programmableFilter1.Script = ''
programmableFilter1.RequestInformationScript = ''
programmableFilter1.RequestUpdateExtentScript = ''
programmableFilter1.PythonPath = ''
# Properties modified on programmableFilter1
programmableFilter1.Script = """
from math import pi, sin, cos, sqrt
pdi = self.GetPolyDataInput()
pdo = self.GetPolyDataOutput()
newPoints = vtk.vtkPoints()
numPoints = pdi.GetNumberOfPoints()
print("PolydataMollweide: found %d points to transform."%numPoints)
def real_mollweide (lon, lat):
lon = lon * pi / 180.
lat = lat * pi / 180.
lon_center = 0 * pi / 180.
scale_by = 120.
if lat == pi/2.:
theta = pi/2
elif lat == -pi/2.:
theta = -pi/2
else:
theta = get_theta (lon, lat, lat)
for i in range(0): ## should be 4-5 , but this way, we match the icon reader.
theta = get_theta (lon, lat, theta)
x = scale_by * 2 * sqrt(2) / pi * (lon - lon_center) * cos (theta)
y = scale_by * sqrt(2) * sin (theta)
return (x, y)
print('correct file')
def get_theta(lon, lat, theta):
theta_new = theta - ( 2 * theta + sin (2* theta) - pi * sin ( lat)) / ( 2+ 2* cos (theta)) # needs to be cos (2*theta), but it's wrong in the icon reader, so we match.
return (theta_new)
for i in range(0, numPoints):
coord = pdi.GetPoint(i)
x, y, z = coord[:3]
x,y = real_mollweide(x,y)
z = z
newPoints.InsertPoint(i, x, y, z)
pdo.SetPoints(newPoints)"""
programmableFilter1.RequestInformationScript = ''
programmableFilter1.RequestUpdateExtentScript = ''
programmableFilter1.PythonPath = ''
# show data in view
programmableFilter1Display = Show(programmableFilter1, renderView1)
# trace defaults for the display properties.
programmableFilter1Display.Representation = 'Surface'
programmableFilter1Display.ColorArrayName = [None, '']
programmableFilter1Display.OSPRayScaleFunction = 'PiecewiseFunction'
programmableFilter1Display.SelectOrientationVectors = 'None'
programmableFilter1Display.ScaleFactor = 66.94908752441407
programmableFilter1Display.SelectScaleArray = 'None'
programmableFilter1Display.GlyphType = 'Arrow'
programmableFilter1Display.GlyphTableIndexArray = 'None'
programmableFilter1Display.GaussianRadius = 3.3474543762207034
programmableFilter1Display.SetScaleArray = [None, '']
programmableFilter1Display.ScaleTransferFunction = 'PiecewiseFunction'
programmableFilter1Display.OpacityArray = [None, '']
programmableFilter1Display.OpacityTransferFunction = 'PiecewiseFunction'
programmableFilter1Display.DataAxesGrid = 'GridAxesRepresentation'
programmableFilter1Display.PolarAxes = 'PolarAxesRepresentation'
# change solid color
programmableFilter1Display.AmbientColor = [0.0, 0.0, 0.0]
programmableFilter1Display.DiffuseColor = [0.0, 0.0, 0.0]
# Properties modified on programmableFilter1Display
programmableFilter1Display.Opacity = 0.4
# hide data in view
Hide(planar_coastlines_intermedres_riversvtk, renderView1)
# update the view to ensure updated data information
# create a new 'CDIReader'
print(files[0])
icon_reader = CDIReader(FileNames=[files[0]])
......@@ -199,7 +323,7 @@ if (mollweide):
icon_reader2.SetProjection = 'Mollweide Projection'
elif sphere :
icon_reader2.SetProjection = 'Spherical Projection'
icon_reader2.LayerThickness = 50
calculator1 = Calculator(Input=icon_reader2)
......@@ -209,7 +333,7 @@ calculator1.Function = 'cllvi+5*clivi'
# create a new 'NetCDF Time Annotation'
netCDFTimeAnnotation1 = NetCDFTimeAnnotation(Input=icon_reader)
netCDFTimeAnnotation1.Expression = '"%02i-%02i-%02i %02i:%02i UTC" % (Date[0], Date[1], Date[2], Date[3], Date[4])' #
netCDFTimeAnnotation1.Expression = '"%02i-%02i-%02i %02i:%02i UTC" % (Date[0], Date[1], Date[2], Date[3], Date[4])' #
# ----------------------------------------------------------------
# setup the visualization in view 'renderView1'
# ----------------------------------------------------------------
......@@ -252,11 +376,11 @@ icon_readerDisplay.DataAxesGrid = 'GridAxesRepresentation'
icon_readerDisplay.PolarAxes = 'PolarAxesRepresentation'
icon_readerDisplay.ScalarOpacityFunction = tsPWF
icon_readerDisplay.ScalarOpacityUnitDistance = 2.432556203035958
icon_readerDisplay.BumpMapInputDataArray = [None, '']
icon_readerDisplay.ExtrusionInputDataArray = ['CELLS', 'clivi']
icon_readerDisplay.InputVectors = [None, '']
icon_readerDisplay.SelectInputVectors = [None, '']
icon_readerDisplay.WriteLog = ''
#icon_readerDisplay.BumpMapInputDataArray = [None, '']
#icon_readerDisplay.ExtrusionInputDataArray = ['CELLS', 'clivi']
#icon_readerDisplay.InputVectors = [None, '']
#icon_readerDisplay.SelectInputVectors = [None, '']
#icon_readerDisplay.WriteLog = ''
# show data from netCDFTimeAnnotation1
netCDFTimeAnnotation1Display = Show(netCDFTimeAnnotation1, renderView1)
......@@ -299,11 +423,6 @@ icon_reader2Display.DataAxesGrid = 'GridAxesRepresentation'
icon_reader2Display.PolarAxes = 'PolarAxesRepresentation'
icon_reader2Display.ScalarOpacityFunction = prPWF
icon_reader2Display.ScalarOpacityUnitDistance = 2.751897456869179
icon_reader2Display.BumpMapInputDataArray = [None, '']
icon_reader2Display.ExtrusionInputDataArray = ['CELLS', 'clivi']
icon_reader2Display.InputVectors = [None, '']
icon_reader2Display.SelectInputVectors = [None, '']
icon_reader2Display.WriteLog = ''
# setup the color legend parameters for each legend in this view
......@@ -319,18 +438,42 @@ tsLUTColorBar.Visibility = 1
# get color legend/bar for prLUT in view renderView1
prLUTColorBar = GetScalarBar(prLUT, renderView1)
prLUTColorBar.Title = u'clouds (liquid + 5*ice) in kg / m²'
prLUTColorBar.Title = u'cloud water (liquid + 5*ice) in kg / m²'
prLUTColorBar.ComponentTitle = ''
prLUTColorBar.RangeLabelFormat = '%.0f'
prLUTColorBar.RangeLabelFormat = '%.3f'
log_clouds=True
if (log_clouds):
# Rescale transfer function
prPWF.RescaleTransferFunction(0.001, 5.0)
prLUT.RescaleTransferFunction(0.001, 5.0)
# convert to log space
prPWF.MapControlPointsToLogSpace()
# Properties modified on prPWF
prPWF.UseLogScale = 1
# convert to log space
prLUT.MapControlPointsToLogSpace()
# Properties modified on prLUT
prLUT.UseLogScale = 1
# set color bar visibility
prLUTColorBar.Visibility = 1
# show color legend
icon_readerDisplay.SetScalarBarVisibility(renderView1, True)
# show color legend
icon_readerDisplay.SetScalarBarVisibility(renderView1, True)
icon_reader2Display.SetScalarBarVisibility(renderView1, True)
print (region)
def disable_colorbars_if_requested():
if region and "no-legend" in region:
print("de-activating colorbars")
icon_readerDisplay.SetScalarBarVisibility(renderView1, False)
icon_reader2Display.SetScalarBarVisibility(renderView1, False)
disable_colorbars_if_requested()
# ----------------------------------------------------------------
# setup color maps and opacity mapes used in the visualization
......@@ -351,7 +494,8 @@ view.Background = [0.2, 0.2, 0.2] # bottom
var="ts-pr_"
basepath = '/work/bk1040/k202134/DYAMOND_WINTER/Images'
basepath = '/work/bk1040/k202134/DYAMOND_WINTER/Images/'+os.path.basename(os.getcwd())
renderView1.UseLight = 0 # NO 3D, so we don't need fancy light, and can have full colors
my_id = os.path.basename(os.getcwd())+"_"+var
......@@ -417,4 +561,3 @@ for n,t in enumerate (tsteps):
SaveScreenshot(basepath + '/%s_%s_4k_%06d.png'%(my_id, region, n), ImageResolution=(3840,2160))
SaveScreenshot(basepath + '/%s_%s_hd_%06d.png'%(my_id, region, n), ImageResolution=(1920,1080))
#!/bin/bash
#SBATCH --job-name=clouds # Specify job name
#SBATCH --partition=compute2 # Specify partition name
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=24
#SBATCH --time=02:00:00 # Set a limit on the total run time
#SBATCH --mail-type=FAIL # Notify user by email in case of job failure
#SBATCH --account=bb1153 # Charge resources on this project account
#SBATCH --output=clouds.eo%j # File name for standard output
#SBATCH --error=clouds.eo%j # File name for standard error output
#SBATCH --constraint=256G
set -vx
module load paraview/5.7-insitu
#module load paraview
which pvbatch
md5sum $(which pvbatch)
scriptdir=$(pwd)
if [ "$1" == MOLL ] ; then moll="MOLL world_no-legend" ; fi
if [ "$1" == SPHERE ] ; then moll=SPHERE ; fi
for x in $@ ; do
if [ "$x" == MOLL -o "$x" == SPHERE ] ; then
continue
fi
pr=${x/ts/clivi_cllvi}
pvbatch /home/dkrz/k202134/Paraview/DYAMOND_WINTER/clouds_babylon.py $moll $x $pr
done
# srun -l --propagate=STACK,CORE --cpu_bind=cores \
# --distribution=block:cyclic
This diff is collapsed.
#!/bin/bash
#SBATCH --job-name=clouds # Specify job name
#SBATCH --partition=compute2 # Specify partition name
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=24
#SBATCH --time=02:00:00 # Set a limit on the total run time
#SBATCH --mail-type=FAIL # Notify user by email in case of job failure
#SBATCH --account=bk1040 # Charge resources on this project account
#SBATCH --output=clouds.eo%j # File name for standard output
#SBATCH --error=clouds.eo%j # File name for standard error output
mkdir -p animations
set -vx
module load paraview/5.7-insitu
#module load paraview
which pvbatch
md5sum $(which pvbatch)
scriptdir=$(pwd)n
if [ "$1" == MOLL ] ; then moll="MOLL world_no-legend" ; fi
if [ "$1" == SPHERE ] ; then moll=SPHERE ; fi
for x in $@ ; do
if [ "$x" == MOLL -o "$x" == SPHERE ] ; then
continue
fi
pvbatch /home/dkrz/k202134/Paraview/DYAMOND_WINTER/clouds_dpp0016.py $moll $x
done
# srun -l --propagate=STACK,CORE --cpu_bind=cores \
# --distribution=block:cyclic
This diff is collapsed.
#!/bin/bash
#SBATCH --job-name=clouds # Specify job name
#SBATCH --partition=compute2 # Specify partition name
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=24
#SBATCH --time=02:00:00 # Set a limit on the total run time
#SBATCH --mail-type=FAIL # Notify user by email in case of job failure
#SBATCH --account=bk1040 # Charge resources on this project account
#SBATCH --output=clouds.eo%j # File name for standard output
#SBATCH --error=clouds.eo%j # File name for standard error output
mkdir -p animations
set -vx
module load paraview/5.7-insitu
#module load paraview
which pvbatch
md5sum $(which pvbatch)
scriptdir=$(pwd)n
if [ "$1" == MOLL ] ; then moll="MOLL world_no-legend" ; fi
if [ "$1" == SPHERE ] ; then moll=SPHERE ; fi
for x in $@ ; do
if [ "$x" == MOLL -o "$x" == SPHERE ] ; then
continue
fi
pvbatch /home/dkrz/k202134/Paraview/DYAMOND_WINTER/clouds_dpp0016_babylon.py $moll $x
done
# srun -l --propagate=STACK,CORE --cpu_bind=cores \
# --distribution=block:cyclic
This diff is collapsed.
#!/bin/bash
#SBATCH --job-name=clouds # Specify job name
#SBATCH --partition=gpu # Specify partition name
#SBATCH --nodes=1
#SBATCH --time=04:00:00 # Set a limit on the total run time
#SBATCH --mail-type=FAIL # Notify user by email in case of job failure
#SBATCH --account=bb1153 # Charge resources on this project account
#SBATCH --output=clouds.eo%j # File name for standard output
#SBATCH --error=clouds.eo%j # File name for standard error output
#SBATCH --constraint=1024G
#SBATCH --exclusive
set -evx
module load paraview/5.7-insitu
#module load paraview
which pvbatch
md5sum $(which pvbatch)
unset DISPLAY
scriptdir=$(pwd)
if [ "$1" == MOLL ] ; then moll="MOLL world_no-legend" ; fi
if [ "$1" == SPHERE ] ; then moll=SPHERE ; fi
/opt/TurboVNC/bin/vncserver -geometry 5000x3000
export DISPLAY=localhost:$(/opt/TurboVNC/bin/vncserver -list |tail -n 1 |cut -b2-2)
for x in $@ ; do
if [ "$x" == MOLL -o "$x" == SPHERE ] ; then
continue
fi
pr=${x/ts/clivi_cllvi}
pvbatch clouds.py $moll $x $pr
done
# srun -l --propagate=STACK,CORE --cpu_bind=cores \
# --distribution=block:cyclic
#!/bin/bash
#SBATCH --job-name=clouds # Specify job name
#SBATCH --partition=compute2 # Specify partition name
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=24
#SBATCH --time=02:00:00 # Set a limit on the total run time
#SBATCH --mail-type=FAIL # Notify user by email in case of job failure
#SBATCH --account=bk1040 # Charge resources on this project account
#SBATCH --output=clouds.eo%j # File name for standard output
#SBATCH --error=clouds.eo%j # File name for standard error output
mkdir -p animations
set -vx
module load paraview/5.7-insitu
#module load paraview
which pvbatch
md5sum $(which pvbatch)
scriptdir=$(pwd)n
if [ "$1" == MOLL ] ; then moll="MOLL world_no-legend" ; fi
if [ "$1" == SPHERE ] ; then moll=SPHERE ; fi
for x in $@ ; do
if [ "$x" == MOLL -o "$x" == SPHERE ] ; then
continue
fi
pvbatch /home/dkrz/k202134/Paraview/DYAMOND_WINTER/clouds_nwp0005.py $moll $x
done
# srun -l --propagate=STACK,CORE --cpu_bind=cores \
# --distribution=block:cyclic
This diff is collapsed.
#!/bin/bash
#SBATCH --job-name=clouds # Specify job name
#SBATCH --partition=compute2 # Specify partition name
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=24
#SBATCH --time=02:00:00 # Set a limit on the total run time
#SBATCH --mail-type=FAIL # Notify user by email in case of job failure
#SBATCH --account=bk1040 # Charge resources on this project account
#SBATCH --output=clouds.eo%j # File name for standard output
#SBATCH --error=clouds.eo%j # File name for standard error output
mkdir -p animations
set -vx
module load paraview/5.7-insitu
#module load paraview
which pvbatch
md5sum $(which pvbatch)
scriptdir=$(pwd)n
if [ "$1" == MOLL ] ; then moll="MOLL world_no-legend" ; fi
if [ "$1" == SPHERE ] ; then moll=SPHERE ; fi
for x in $@ ; do
if [ "$x" == MOLL -o "$x" == SPHERE ] ; then
continue
fi
pvbatch /home/dkrz/k202134/Paraview/DYAMOND_WINTER/clouds_nwp0005_babylon.py $moll $x
done
# srun -l --propagate=STACK,CORE --cpu_bind=cores \
# --distribution=block:cyclic
This diff is collapsed.
#!/bin/bash
#SBATCH --job-name=clouds # Specify job name
#SBATCH --partition=compute2 # Specify partition name
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=24
#SBATCH --time=02:00:00 # Set a limit on the total run time
#SBATCH --mail-type=FAIL # Notify user by email in case of job failure
#SBATCH --account=bk1040 # Charge resources on this project account
#SBATCH --output=clouds.eo%j # File name for standard output
#SBATCH --error=clouds.eo%j # File name for standard error output
set -vx
module load paraview/5.7-insitu
#module load paraview
which pvbatch
md5sum $(which pvbatch)
scriptdir=$(pwd)n
if [ "$1" == MOLL ] ; then moll="MOLL world_no-legend" ; fi
if [ "$1" == SPHERE ] ; then moll=SPHERE ; fi
for x in $@ ; do
if [ "$x" == MOLL -o "$x" == SPHERE ] ; then
continue
fi
pr=${x/atm2/atm1}
pvbatch clouds_raw.py $moll $x $pr
done
# srun -l --propagate=STACK,CORE --cpu_bind=cores \
# --distribution=block:cyclic
This diff is collapsed.
#!/bin/bash
#SBATCH --job-name=clouds # Specify job name
#SBATCH --partition=compute2 # Specify partition name
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=24
#SBATCH --time=02:00:00 # Set a limit on the total run time
#SBATCH --mail-type=FAIL # Notify user by email in case of job failure
#SBATCH --account=bk1040 # Charge resources on this project account
#SBATCH --output=clouds.eo%j # File name for standard output
#SBATCH --error=clouds.eo%j # File name for standard error output