Commit 45ec56fb authored by Florian Ziemen's avatar Florian Ziemen
Browse files

misc plots

parent 9cebb2d3
......@@ -8000,7 +8000,7 @@
<Domain name="bool" id="27514.SelectionVisibility.bool"/>
</Property>
<Property name="Visibility" id="27514.Visibility" number_of_elements="1">
<Element index="0" value="0"/>
<Element index="0" value="1"/>
<Domain name="bool" id="27514.Visibility.bool"/>
</Property>
<Property name="Ambient" id="27514.Ambient" number_of_elements="1">
......@@ -10141,7 +10141,7 @@
<Domain name="bool" id="26325.SelectionVisibility.bool"/>
</Property>
<Property name="Visibility" id="26325.Visibility" number_of_elements="1">
<Element index="0" value="1"/>
<Element index="0" value="0"/>
<Domain name="bool" id="26325.Visibility.bool"/>
</Property>
<Property name="Ambient" id="26325.Ambient" number_of_elements="1">
......
......@@ -13,7 +13,8 @@ mkdir -p animations
set -vx
module load paraview/5.7-insitu
PATH=/work/kv0653/k202134/Paraview/master/osmesa/install/bin:${PATH}
# module load paraview/5.7-insitu
#module load paraview
which pvbatch
md5sum $(which pvbatch)
......
......@@ -3,9 +3,9 @@
#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 --time=00:20: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 --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
......@@ -13,20 +13,24 @@ mkdir -p animations
set -vx
module load paraview/5.7-insitu
#module load paraview/5.8-insitu
PATH=/work/kv0653/k202134/Paraview/master/0b87ced7ae/install/bin:${PATH}
# export LD_LIBRARY_PATH=/work/kv0653/k202134/Paraview/master/tb_av/install/lib64:$LD_LIBRARY_PATH
#module load paraview
which pvbatch
md5sum $(which pvbatch)
scriptdir=$(pwd)n
scriptdir=$(pwd)
if [ "$1" == MOLL ] ; then moll="MOLL world_no-legend" ; fi
if [ "$1" == SPHERE ] ; then moll=SPHERE ; fi
ulimit -s 10240
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
run_pv 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
......@@ -135,11 +135,13 @@ print (region)
#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())
# LoadPlugin('/sw/rhel6-x64/paraview/paraview-5.7.0-gcc71-osmesa/lib64/paraview-5.7/plugins/NetCDFTimeAnnotationPlugin/NetCDFTimeAnnotationPlugin.so', remote=False, ns=globals())
# LoadPlugin('/sw/rhel6-x64/paraview/paraview-5.7.0-gcc71-osmesa/lib64/paraview-5.7/plugins/EmbossingRepresentations/EmbossingRepresentations.so', remote=False, ns=globals())
# LoadPlugin('/sw/rhel6-x64/paraview/paraview-5.7.0-gcc71-osmesa/lib64/paraview-5.7/plugins/StreamLinesRepresentation/StreamLinesRepresentation.so', remote=False, ns=globals())
# LoadPlugin('/sw/rhel6-x64/paraview/paraview-5.7.0-gcc71-osmesa/lib64/paraview-5.7/plugins/SurfaceLIC/SurfaceLIC.so', remote=False, ns=globals())
#LoadPlugin('/sw/rhel6-x64/paraview/paraview-5.8.0-gcc64-osmesa/lib64/paraview-5.8/plugins/CDIReader/CDIReader.so', remote=False, ns=globals())
#LoadPlugin('/work/kv0653/k202134/Paraview/master/osmesa-release-O2/install/lib64/paraview-5.8/plugins/CDIReader/CDIReader.so', remote=False, ns=globals())
#LoadPlugin('/work/kv0653/k202134/Paraview/NIK/paraview-5.8.0-gcc64-osmesa/lib64/paraview-5.8/plugins/CDIReader/CDIReader.so', remote=False, ns=globals())
#LoadPlugin('/sw/rhel6-x64/paraview/paraview-5.8.0-gcc64-osmesa/lib64/paraview-5.8/plugins/NetCDFTimeAnnotationPlugin/NetCDFTimeAnnotationPlugin.so', remote=False, ns=globals())
#LoadPlugin('/sw/rhel6-x64/paraview/paraview-5.8.0-gcc64-osmesa/lib64/paraview-5.8/plugins/EmbossingRepresentations/EmbossingRepresentations.so', remote=False, ns=globals())
#LoadPlugin('/sw/rhel6-x64/paraview/paraview-5.8.0-gcc64-osmesa/lib64/paraview-5.8/plugins/StreamLinesRepresentation/StreamLinesRepresentation.so', remote=False, ns=globals())
#LoadPlugin('/sw/rhel6-x64/paraview/paraview-5.8.0-gcc64-osmesa/lib64/paraview-5.8/plugins/SurfaceLIC/SurfaceLIC.so', remote=False, ns=globals())
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
......@@ -394,14 +396,18 @@ cloudsDisplay = Show(calculator1, renderView1)
prLUT = GetColorTransferFunction('pr')
prLUT.AutomaticRescaleRangeMode = 'Never'
prLUT.EnableOpacityMapping = 1
prLUT.RGBPoints = [0.0, 1.0, 1.0, 1.0, 2., 1.0, 1.0, 1.0] # value, r, g, b, value , r, g, b
prLUT.ColorSpace = 'Lab'
prLUT.RGBPoints = [0.001, 1.0, 1.0, 1.0, 5., 1.0, 1.0, 1.0] # value, r, g, b, value , r, g, b
prLUT.ColorSpace = 'RGB'
prLUT.UseLogScale = 1
prLUT.ScalarRangeInitialized = 1.0
# get opacity transfer function/opacity map for 'pr'
prPWF = GetOpacityTransferFunction('pr')
prPWF.Points = [0.0, 0.0, 0.5, 0.0, 2., 1.0, 0.5, 0.0] # same as above with r = opacity, g = 0.5, b=0 (whyever)
prPWF.Points = [0.001, 0.0, 0.5, 0.0, 5., 1.0, 0.5, 0.0] # same as above with r = opacity, g = 0.5, b=0 (whyever)
prPWF.UseLogScale = 1
prPWF.ScalarRangeInitialized = 1
# convert to log space
# trace defaults for the display properties.
cloudsDisplay.Representation = 'Surface'
......@@ -445,14 +451,14 @@ prLUTColorBar.RangeLabelFormat = '%.3f'
log_clouds=True
if (log_clouds):
# Rescale transfer function
prPWF.RescaleTransferFunction(0.001, 5.0)
prLUT.RescaleTransferFunction(0.001, 5.0)
# prPWF.RescaleTransferFunction(0.001, 5.0)
# prLUT.RescaleTransferFunction(0.001, 5.0)
# convert to log space
prPWF.MapControlPointsToLogSpace()
# prPWF.MapControlPointsToLogSpace()
# Properties modified on prPWF
prPWF.UseLogScale = 1
# convert to log space
prLUT.MapControlPointsToLogSpace()
# prLUT.MapControlPointsToLogSpace()
# Properties modified on prLUT
prLUT.UseLogScale = 1
......@@ -524,7 +530,7 @@ for n,t in enumerate (tsteps):
renderView1.CameraParallelScale = 149.9 # dann sind die Ränder leicht beschnitten, und die fehlenden Zellen tauchen nicht auf.
netCDFTimeAnnotation1Display.WindowLocation = 'AnyLocation' # top-left
netCDFTimeAnnotation1Display.Position = [0.01, 0.46]
netCDFTimeAnnotation1Display.FontSize = 4
netCDFTimeAnnotation1Display.FontSize = 18
icon_readerDisplay.SetScalarBarVisibility(renderView1, False)
cloudsDisplay.SetScalarBarVisibility(renderView1, False)
......@@ -537,7 +543,7 @@ for n,t in enumerate (tsteps):
SaveScreenshot(basepath + '/%s_4p_cb_%06d.png'%(my_id, n), ImageResolution=(4096,2048))
else:
netCDFTimeAnnotation1Display.FontSize = 4
netCDFTimeAnnotation1Display.FontSize = 12
sort_location(tsLUTColorBar, [0.92, 0.05])
sort_location(prLUTColorBar, [0.92, 0.63])
prLUTColorBar.LabelFontSize = 8
......@@ -565,5 +571,8 @@ for n,t in enumerate (tsteps):
tsr = conf["ts_range"]
tsLUT.RescaleTransferFunction(tsr[0],tsr[1])
print("Saving 4k")
SaveScreenshot(basepath + '/%s_%s_4k_%06d.png'%(my_id, region, n), ImageResolution=(3840,2160))
print("Saving HD")
SaveScreenshot(basepath + '/%s_%s_hd_%06d.png'%(my_id, region, n), ImageResolution=(1920,1080))
print("Saved HD")
#!/bin/bash
if [ ! -f $s/icon_data.nc ] ; then
cdo -setgrid,/pool/data/ICON/grids/public/mpim/0015/icon_grid_0015_R02B09_G.nc -merge -expr,'cloud=clivi*5+cllvi;rsdt=rsdt' -select,date=2020-02-05T16:00:00,name=clivi,cllvi,rsdt /work/ka1081/NextGEMS/MPIM-DWD-DKRZ/ICON-SAP-5km/Cycle1/atm/30min/clivi/dpp0052/2d/gn/clivi_30min_ICON-SAP-5km_Cycle1_dpp0052_2d_gn_20200205000000-20200205235920.nc $s/icon-cloud.nc
cdo -setgrid,/pool/data/ICON/grids/public/mpim/0015/icon_grid_0015_R02B09_G.nc -select,date=2020-02-05T16:00:00,name=psl /work/ka1081/NextGEMS/MPIM-DWD-DKRZ/ICON-SAP-5km/Cycle1/atm/30min/psl/dpp0052/2d/gn/psl_30min_ICON-SAP-5km_Cycle1_dpp0052_2d_gn_20200205000000-20200205235920.nc $s/icon_psl.nc
# if [ ! -f $s/icon_data.nc ] ; then
cdo -O -setgrid,/pool/data/ICON/grids/public/mpim/0015/icon_grid_0015_R02B09_G.nc -merge -expr,'cloud=clivi*5+cllvi;rsdt=rsdt' -select,date=2020-01-22T16:00:00,name=clivi,cllvi,rsdt /work/ka1081/NextGEMS/MPIM-DWD-DKRZ/ICON-SAP-5km/Cycle1/atm/30min/clivi/dpp0052/2d/gn/clivi_30min_ICON-SAP-5km_Cycle1_dpp0052_2d_gn_20200122000000-20200122235920.nc $s/icon-cloud.nc
cdo -O -setgrid,/pool/data/ICON/grids/public/mpim/0015/icon_grid_0015_R02B09_G.nc -select,date=2020-01-22T16:00:00,name=psl /work/ka1081/NextGEMS/MPIM-DWD-DKRZ/ICON-SAP-5km/Cycle1/atm/30min/psl/dpp0052/2d/gn/psl_30min_ICON-SAP-5km_Cycle1_dpp0052_2d_gn_20200122000000-20200122235920.nc $s/icon_psl.nc
cdo -O -merge $s/icon-cloud.nc $s/icon_psl.nc $s/icon_data.nc
ncatted -a level_type,cloud,o,c,atm -a level_type,psl,o,c,atm -a level_type,rsdt,o,c,atm -a units,cloud,o,c,one -a long_name,cloud,o,c,cloudiness $s/icon_data.nc
# fi
cdo -merge $s/icon-cloud.nc $s/icon_psl.nc $s/icon_data.nc
ncatted -a level_type,cloud,o,c,atm -a level_type,psl,o,c,atm -a level_type,rsdt,o,c,atm -a units,cloud,o,c,one -a long_name,cloud,o,c,cloudiness $s/icon_data.nc
fi
cdo -setgrid,/work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-DEEPon-4km/Cycle1/atm/fx/gn/grid.nc -select,date=2020-02-05T16:00:00 /work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-DEEPon-4km/Cycle1/atm/1hr/clivi/r1i1p1f1/2d/gn/clivi_1hr_IFS-NEMO-DEEPon-4km_Cycle1_r1i1p1f1_2d_gn_20200205000000-20200205230000.nc $s/ifs-DEEPon_clivi.nc
cdo -setgrid,/work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-DEEPon-4km/Cycle1/atm/fx/gn/grid.nc -select,date=2020-02-05T16:00:00 /work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-DEEPon-4km/Cycle1/atm/1hr/clwvi/r1i1p1f1/2d/gn/clwvi_1hr_IFS-NEMO-DEEPon-4km_Cycle1_r1i1p1f1_2d_gn_20200205000000-20200205230000.nc $s/ifs-DEEPon_clwvi.nc
cdo -setgrid,/work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-DEEPon-4km/Cycle1/atm/fx/gn/grid.nc -select,date=2020-01-22T16:00:00 /work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-DEEPon-4km/Cycle1/atm/1hr/clivi/r1i1p1f1/2d/gn/clivi_1hr_IFS-NEMO-DEEPon-4km_Cycle1_r1i1p1f1_2d_gn_20200122000000-20200122230000.nc $s/ifs-DEEPon_clivi.nc
cdo -setgrid,/work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-DEEPon-4km/Cycle1/atm/fx/gn/grid.nc -select,date=2020-01-22T16:00:00 /work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-DEEPon-4km/Cycle1/atm/1hr/clwvi/r1i1p1f1/2d/gn/clwvi_1hr_IFS-NEMO-DEEPon-4km_Cycle1_r1i1p1f1_2d_gn_20200122000000-20200122230000.nc $s/ifs-DEEPon_clwvi.nc
cdo -merge $s/ifs-DEEPon_clivi.nc $s/ifs-DEEPon_clwvi.nc $s/ifs-DEEPon_raw.nc
cdo -expr,cloud=clivi*5+clwvi $s/ifs-DEEPon_raw.nc $s/ifs-DEEPon-cloud.nc
cdo -setgrid,/work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-4km/Cycle1/atm/fx/gn/grid.nc -select,date=2020-02-05T16:00:00 /work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-4km/Cycle1/atm/1hr/clivi/r1i1p1f1/2d/gn/clivi_1hr_IFS-NEMO-4km_Cycle1_r1i1p1f1_2d_gn_20200205000000-20200205230000.nc $s/ifs_clivi.nc
cdo -setgrid,/work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-4km/Cycle1/atm/fx/gn/grid.nc -select,date=2020-02-05T16:00:00 /work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-4km/Cycle1/atm/1hr/clwvi/r1i1p1f1/2d/gn/clwvi_1hr_IFS-NEMO-4km_Cycle1_r1i1p1f1_2d_gn_20200205000000-20200205230000.nc $s/ifs_clwvi.nc
cdo -setgrid,/work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-4km/Cycle1/atm/fx/gn/grid.nc -select,date=2020-01-22T16:00:00 /work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-4km/Cycle1/atm/1hr/clivi/r1i1p1f1/2d/gn/clivi_1hr_IFS-NEMO-4km_Cycle1_r1i1p1f1_2d_gn_20200122000000-20200122230000.nc $s/ifs_clivi.nc
cdo -setgrid,/work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-4km/Cycle1/atm/fx/gn/grid.nc -select,date=2020-01-22T16:00:00 /work/ka1081/NextGEMS/ECMWF-AWI/IFS-NEMO-4km/Cycle1/atm/1hr/clwvi/r1i1p1f1/2d/gn/clwvi_1hr_IFS-NEMO-4km_Cycle1_r1i1p1f1_2d_gn_20200122000000-20200122230000.nc $s/ifs_clwvi.nc
cdo -merge $s/ifs_clivi.nc $s/ifs_clwvi.nc $s/ifs_raw.nc
cdo -expr,cloud=clivi*5+clwvi $s/ifs_raw.nc $s/ifs-cloud.nc
......@@ -400,13 +400,17 @@ icon_reader2Display = Show(calculator1, renderView1)
prLUT = GetColorTransferFunction('pr')
prLUT.AutomaticRescaleRangeMode = 'Never'
prLUT.EnableOpacityMapping = 1
prLUT.RGBPoints = [0.0, 1.0, 1.0, 1.0, 2., 1.0, 1.0, 1.0] # value, r, g, b, value , r, g, b
prLUT.ColorSpace = 'Lab'
prLUT.RGBPoints = [0.001, 1.0, 1.0, 1.0, 5., 1.0, 1.0, 1.0] # value, r, g, b, value , r, g, b
prLUT.ColorSpace = 'RGB'
prLUT.UseLogScale = 1
prLUT.ScalarRangeInitialized = 1.0
# get opacity transfer function/opacity map for 'pr'
prPWF = GetOpacityTransferFunction('pr')
prPWF.Points = [0.0, 0.0, 0.5, 0.0, 2., 1.0, 0.5, 0.0] # same as above with r = opacity, g = 0.5, b=0 (whyever)
prPWF.Points = [0.001, 0.0, 0.5, 0.0, 5., 1.0, 0.5, 0.0] # same as above with r = opacity, g = 0.5, b=0 (whyever)
prPWF.UseLogScale = 1
prPWF.ScalarRangeInitialized = 1
# trace defaults for the display properties.
......@@ -451,14 +455,14 @@ prLUTColorBar.RangeLabelFormat = '%.3f'
log_clouds=True
if (log_clouds):
# Rescale transfer function
prPWF.RescaleTransferFunction(0.001, 5.0)
prLUT.RescaleTransferFunction(0.001, 5.0)
# prPWF.RescaleTransferFunction(0.001, 5.0)
# prLUT.RescaleTransferFunction(0.001, 5.0)
# convert to log space
prPWF.MapControlPointsToLogSpace()
# prPWF.MapControlPointsToLogSpace()
# Properties modified on prPWF
prPWF.UseLogScale = 1
# convert to log space
prLUT.MapControlPointsToLogSpace()
# prLUT.MapControlPointsToLogSpace()
# Properties modified on prLUT
prLUT.UseLogScale = 1
......
......@@ -15,8 +15,10 @@ def parse_args():
op = parser.parse_args()
options = vars(op)
if options.get("oce", False):
print ("Globbing for " + options["oce"])
options["oce"]=glob.glob(options["oce"])
if options.get("atm", False):
print ("Globbing for " + options["atm"])
options["atm"]=glob.glob(options["atm"])
if options.get("ice", False):
options["ice"]=glob.glob(options["ice"])
......
......@@ -11,6 +11,13 @@
#### import the simple module from the paraview
from paraview.simple import *
import run_pv_ao
import os
options=run_pv_ao.parse_args()
my_id="so_conc_"+os.path.basename(options["oce"][0])[:-3].split("_")[-1]
print (my_id)
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
......@@ -48,34 +55,35 @@ SetActiveView(renderView1)
# ----------------------------------------------------------------
# create a new 'CDIReader'
dpp0016_ocean2D_20201030TZnc = CDIReader(FileNames=['/home/dkrz/k202134/Paraview/DYAMOND_WINTER/dpp0016/oce/dpp0016_ocean2D_20201030T000000Z.nc'])
dpp0016_ocean2D_20201030TZnc.Dimensions = '(clon, clat, lev)'
dpp0016_ocean2D_20201030TZnc.CellArrayStatus = ['hi', 'hs', 'conc']
dpp0016_ocean2D_20201030TZnc.SetProjection = 'Cassini Projection'
dpp0016_ocean2D_20201030TZnc.LayerThickness = 50
ice_file = CDIReader(FileNames= options['ice'])
ice_file.Dimensions = '(clon, clat, lev)'
ice_file.CellArrayStatus = ['hi', 'hs', 'conc']
ice_file.SetProjection = 'Cassini Projection'
ice_file.LayerThickness = 50
# create a new 'NetCDF Time Annotation'
netCDFTimeAnnotation1 = NetCDFTimeAnnotation(Input=dpp0016_ocean2D_20201030TZnc)
netCDFTimeAnnotation1 = NetCDFTimeAnnotation(Input=ice_file)
netCDFTimeAnnotation1.Expression = '"%02i-%02i-%02i" % (Date[0], Date[1], Date[2])'
# create a new 'CDIReader'
dpp0016_ocean3D_u1000m_20201030TZnc = CDIReader(FileNames=['/home/dkrz/k202134/Paraview/DYAMOND_WINTER/dpp0016/oce/dpp0016_ocean3D_u1000m_20201030T000000Z.nc'])
dpp0016_ocean3D_u1000m_20201030TZnc.Dimensions = '(clon, clat, depth)'
dpp0016_ocean3D_u1000m_20201030TZnc.CellArrayStatus = ['to', 'so']
dpp0016_ocean3D_u1000m_20201030TZnc.SetProjection = 'Cassini Projection'
dpp0016_ocean3D_u1000m_20201030TZnc.LayerThickness = 50
oce_file = CDIReader(FileNames=options['oce'])
oce_file.Dimensions = '(clon, clat, depth)'
oce_file.CellArrayStatus = ['to', 'so']
oce_file.SetProjection = 'Cassini Projection'
oce_file.LayerThickness = 50
oce_file.VerticalLevel = 0
# create a new 'Threshold'
threshold1 = Threshold(Input=dpp0016_ocean3D_u1000m_20201030TZnc)
threshold1.Scalars = ['CELLS', 'so']
threshold1.ThresholdRange = [1.0, 60.0]
so_threshold = Threshold(Input=oce_file)
so_threshold.Scalars = ['CELLS', 'so']
so_threshold.ThresholdRange = [0.00001, 60.0]
# ----------------------------------------------------------------
# setup the visualization in view 'renderView1'
# ----------------------------------------------------------------
# show data from dpp0016_ocean2D_20201030TZnc
dpp0016_ocean2D_20201030TZncDisplay = Show(dpp0016_ocean2D_20201030TZnc, renderView1, 'UnstructuredGridRepresentation')
# show data from ice_file
ice_fileDisplay = Show(ice_file, renderView1, 'UnstructuredGridRepresentation')
# get color transfer function/color map for 'conc'
concLUT = GetColorTransferFunction('conc')
......@@ -90,31 +98,31 @@ concPWF.Points = [0.0, 0.0, 0.5, 0.0, 0.15, 0.5, 0.5, 0.0, 1.0, 0.5, 0.5, 0.0]
concPWF.ScalarRangeInitialized = 1
# trace defaults for the display properties.
dpp0016_ocean2D_20201030TZncDisplay.Representation = 'Surface'
dpp0016_ocean2D_20201030TZncDisplay.ColorArrayName = ['CELLS', 'conc']
dpp0016_ocean2D_20201030TZncDisplay.LookupTable = concLUT
dpp0016_ocean2D_20201030TZncDisplay.OSPRayScaleFunction = 'PiecewiseFunction'
dpp0016_ocean2D_20201030TZncDisplay.SelectOrientationVectors = 'None'
dpp0016_ocean2D_20201030TZncDisplay.ScaleFactor = 60.166174316406256
dpp0016_ocean2D_20201030TZncDisplay.SelectScaleArray = 'None'
dpp0016_ocean2D_20201030TZncDisplay.GlyphType = 'Arrow'
dpp0016_ocean2D_20201030TZncDisplay.GlyphTableIndexArray = 'None'
dpp0016_ocean2D_20201030TZncDisplay.GaussianRadius = 3.008308715820313
dpp0016_ocean2D_20201030TZncDisplay.SetScaleArray = [None, '']
dpp0016_ocean2D_20201030TZncDisplay.ScaleTransferFunction = 'PiecewiseFunction'
dpp0016_ocean2D_20201030TZncDisplay.OpacityArray = [None, '']
dpp0016_ocean2D_20201030TZncDisplay.OpacityTransferFunction = 'PiecewiseFunction'
dpp0016_ocean2D_20201030TZncDisplay.DataAxesGrid = 'GridAxesRepresentation'
dpp0016_ocean2D_20201030TZncDisplay.PolarAxes = 'PolarAxesRepresentation'
dpp0016_ocean2D_20201030TZncDisplay.ScalarOpacityFunction = concPWF
dpp0016_ocean2D_20201030TZncDisplay.ScalarOpacityUnitDistance = 6.795499595074316
dpp0016_ocean2D_20201030TZncDisplay.BumpMapInputDataArray = [None, '']
dpp0016_ocean2D_20201030TZncDisplay.ExtrusionInputDataArray = ['CELLS', 'hi']
dpp0016_ocean2D_20201030TZncDisplay.SelectInputVectors = [None, '']
dpp0016_ocean2D_20201030TZncDisplay.WriteLog = ''
# show data from threshold1
threshold1Display = Show(threshold1, renderView1, 'UnstructuredGridRepresentation')
ice_fileDisplay.Representation = 'Surface'
ice_fileDisplay.ColorArrayName = ['CELLS', 'conc']
ice_fileDisplay.LookupTable = concLUT
ice_fileDisplay.OSPRayScaleFunction = 'PiecewiseFunction'
ice_fileDisplay.SelectOrientationVectors = 'None'
ice_fileDisplay.ScaleFactor = 60.166174316406256
ice_fileDisplay.SelectScaleArray = 'None'
ice_fileDisplay.GlyphType = 'Arrow'
ice_fileDisplay.GlyphTableIndexArray = 'None'
ice_fileDisplay.GaussianRadius = 3.008308715820313
ice_fileDisplay.SetScaleArray = [None, '']
ice_fileDisplay.ScaleTransferFunction = 'PiecewiseFunction'
ice_fileDisplay.OpacityArray = [None, '']
ice_fileDisplay.OpacityTransferFunction = 'PiecewiseFunction'
ice_fileDisplay.DataAxesGrid = 'GridAxesRepresentation'
ice_fileDisplay.PolarAxes = 'PolarAxesRepresentation'
ice_fileDisplay.ScalarOpacityFunction = concPWF
ice_fileDisplay.ScalarOpacityUnitDistance = 6.795499595074316
ice_fileDisplay.BumpMapInputDataArray = [None, '']
ice_fileDisplay.ExtrusionInputDataArray = ['CELLS', 'hi']
ice_fileDisplay.SelectInputVectors = [None, '']
ice_fileDisplay.WriteLog = ''
# show data from so_threshold
so_thresholdDisplay = Show(so_threshold, renderView1, 'UnstructuredGridRepresentation')
# get color transfer function/color map for 'so'
soLUT = GetColorTransferFunction('so')
......@@ -129,28 +137,28 @@ soPWF.Points = [20.0, 0.0, 0.5, 0.0, 35.0, 1.0, 0.5, 0.0]
soPWF.ScalarRangeInitialized = 1
# trace defaults for the display properties.
threshold1Display.Representation = 'Surface'
threshold1Display.ColorArrayName = ['CELLS', 'so']
threshold1Display.LookupTable = soLUT
threshold1Display.OSPRayScaleFunction = 'PiecewiseFunction'
threshold1Display.SelectOrientationVectors = 'None'
threshold1Display.ScaleFactor = 62.79500427246094
threshold1Display.SelectScaleArray = 'None'
threshold1Display.GlyphType = 'Arrow'
threshold1Display.GlyphTableIndexArray = 'None'
threshold1Display.GaussianRadius = 3.139750213623047
threshold1Display.SetScaleArray = [None, '']
threshold1Display.ScaleTransferFunction = 'PiecewiseFunction'
threshold1Display.OpacityArray = [None, '']
threshold1Display.OpacityTransferFunction = 'PiecewiseFunction'
threshold1Display.DataAxesGrid = 'GridAxesRepresentation'
threshold1Display.PolarAxes = 'PolarAxesRepresentation'
threshold1Display.ScalarOpacityFunction = soPWF
threshold1Display.ScalarOpacityUnitDistance = 7.210946129682988
threshold1Display.BumpMapInputDataArray = [None, '']
threshold1Display.ExtrusionInputDataArray = ['CELLS', 'Center Latitude (CLAT)']
threshold1Display.SelectInputVectors = [None, '']
threshold1Display.WriteLog = ''
so_thresholdDisplay.Representation = 'Surface'
so_thresholdDisplay.ColorArrayName = ['CELLS', 'so']
so_thresholdDisplay.LookupTable = soLUT
so_thresholdDisplay.OSPRayScaleFunction = 'PiecewiseFunction'
so_thresholdDisplay.SelectOrientationVectors = 'None'
so_thresholdDisplay.ScaleFactor = 62.79500427246094
so_thresholdDisplay.SelectScaleArray = 'None'
so_thresholdDisplay.GlyphType = 'Arrow'
so_thresholdDisplay.GlyphTableIndexArray = 'None'
so_thresholdDisplay.GaussianRadius = 3.139750213623047
so_thresholdDisplay.SetScaleArray = [None, '']
so_thresholdDisplay.ScaleTransferFunction = 'PiecewiseFunction'
so_thresholdDisplay.OpacityArray = [None, '']
so_thresholdDisplay.OpacityTransferFunction = 'PiecewiseFunction'
so_thresholdDisplay.DataAxesGrid = 'GridAxesRepresentation'
so_thresholdDisplay.PolarAxes = 'PolarAxesRepresentation'
so_thresholdDisplay.ScalarOpacityFunction = soPWF
so_thresholdDisplay.ScalarOpacityUnitDistance = 7.210946129682988
so_thresholdDisplay.BumpMapInputDataArray = [None, '']
so_thresholdDisplay.ExtrusionInputDataArray = ['CELLS', 'Center Latitude (CLAT)']
so_thresholdDisplay.SelectInputVectors = [None, '']
so_thresholdDisplay.WriteLog = ''
# show data from netCDFTimeAnnotation1
netCDFTimeAnnotation1Display = Show(netCDFTimeAnnotation1, renderView1, 'TextSourceRepresentation')
......@@ -172,7 +180,7 @@ soLUTColorBar.ComponentTitle = ''
soLUTColorBar.Visibility = 1
# show color legend
threshold1Display.SetScalarBarVisibility(renderView1, True)
so_thresholdDisplay.SetScalarBarVisibility(renderView1, True)
# ----------------------------------------------------------------
# setup color maps and opacity mapes used in the visualization
......@@ -180,6 +188,32 @@ threshold1Display.SetScalarBarVisibility(renderView1, True)
# ----------------------------------------------------------------
# ----------------------------------------------------------------
# finally, restore active source
SetActiveSource(netCDFTimeAnnotation1)
# ----------------------------------------------------------------
\ No newline at end of file
# ----------------------------------------------------------------
SetActiveSource(oce_file)
view = GetActiveView()
reader=GetActiveSource()
tsteps=reader.TimestepValues
print ("Timesteps: ", ", ".join((str (x) for x in tsteps)))
if len(tsteps) == 0 :
tsteps = [0]
for n,t in enumerate (tsteps):
print ("rendering for time %f"%t)
view.ViewTime = t
view.CameraPosition = [0, -160, 10000.0]
view.CameraFocalPoint = [0, -160., 0.0]
renderView1.CameraParallelScale = 42.
filename='%s_%s_4k_%06d.png'%(my_id, "SH", n)
print("saving to ", filename)
SaveScreenshot(filename, ImageResolution=(3840,2160))
SaveScreenshot('%s_%s_8k_%06d.png'%(my_id, "SH", n), ImageResolution=(7680,4320))
SaveScreenshot('%s_%s_hd_%06d.png'%(my_id, "SH", n), ImageResolution=(1920,1080))
view.CameraPosition = [0, 160, 15000.0]
view.CameraFocalPoint = [0, 160, 0.0]
renderView1.CameraParallelScale = 60.
SaveScreenshot('%s_%s_4k_%06d.png'%(my_id, "NH", n), ImageResolution=(3840,2160))
SaveScreenshot('%s_%s_hd_%06d.png'%(my_id, "NH", n), ImageResolution=(1920,1080))
SaveScreenshot('%s_%s_8k_%06d.png'%(my_id, "NH", n), ImageResolution=(7680,4320))
......@@ -11,6 +11,13 @@
#### import the simple module from the paraview
from paraview.simple import *
import run_pv_ao
import os
options=run_pv_ao.parse_args()
my_id="zos_eff_"+os.path.basename(options["oce"][0])[:-3].split("_")[-1]
print (my_id)
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
......@@ -48,38 +55,38 @@ SetActiveView(renderView1)
# ----------------------------------------------------------------
# create a new 'CDIReader'
dpp0016_ocean2D_20201205T150000Znc = CDIReader(FileNames=['/work/mh0287/k203123/GIT/icon-aes-dyw_albW/experiments/dpp0016_icefix_debug/oce/dpp0016_ocean2D_20201205T150000Z.nc'])
dpp0016_ocean2D_20201205T150000Znc.Dimensions = '(lon, lat, sfc)'
dpp0016_ocean2D_20201205T150000Znc.CellArrayStatus = ['hi', 'hs', 'conc', 'mld', 'mlotst', 'mlotstsq', 'zos']
dpp0016_ocean2D_20201205T150000Znc.SetProjection = 'Cassini Projection'
dpp0016_ocean2D_20201205T150000Znc.LayerThickness = 50
oce_file = CDIReader(FileNames=options["oce"])
oce_file.Dimensions = '(lon, lat, sfc)'
oce_file.CellArrayStatus = ['hi', 'hs', 'zos', 'conc']
oce_file.SetProjection = 'Cassini Projection'
oce_file.LayerThickness = 50
# create a new 'Calculator'
calculator1 = Calculator(Input=dpp0016_ocean2D_20201205T150000Znc)
calculator1.AttributeType = 'Cell Data'
calculator1.ResultArrayName = 'zos_eff'
calculator1.Function = 'zos-.9*hi-.3*hs'
zos_eff = Calculator(Input=oce_file)
zos_eff.AttributeType = 'Cell Data'
zos_eff.ResultArrayName = 'zos_eff'
zos_eff.Function = 'zos-.9*hi*conc-.3*hs*conc'
# create a new 'CDIReader'
dpp0016_atm_2d_ml_20201205T150000Znc = CDIReader(FileNames=['/work/mh0287/k203123/GIT/icon-aes-dyw_albW/experiments/dpp0016_icefix_debug/atm/dpp0016_atm_2d_ml_20201205T150000Z.nc'])
dpp0016_atm_2d_ml_20201205T150000Znc.Dimensions = '(lon, lat, sfc)'
dpp0016_atm_2d_ml_20201205T150000Znc.CellArrayStatus = ['ps', 'psl', 'rsdt', 'rsut', 'rsutcs', 'rlut', 'rlutcs', 'rsds', 'rsdscs', 'rlds', 'rldscs', 'rsus', 'rsuscs', 'rlus', 'ts', 'sic', 'sit', 'clt', 'prlr', 'prls', 'pr', 'prw', 'cllvi', 'clivi', 'qgvi', 'qrvi', 'qsvi', 'hfls', 'hfss', 'evspsbl', 'tauu', 'tauv', 'sfcwind', 'uas', 'vas', 'tas']
dpp0016_atm_2d_ml_20201205T150000Znc.SetProjection = 'Cassini Projection'
dpp0016_atm_2d_ml_20201205T150000Znc.LayerThickness = 50
atm_file = CDIReader(FileNames=options["atm"])
atm_file.Dimensions = '(lon, lat, sfc)'
atm_file.CellArrayStatus = ['psl']
atm_file.SetProjection = 'Cassini Projection'
atm_file.LayerThickness = 50
# create a new 'Cell Data to Point Data'
cellDatatoPointData1 = CellDatatoPointData(Input=dpp0016_atm_2d_ml_20201205T150000Znc)
cellDatatoPointData1.ProcessAllArrays = 0
cellDatatoPointData1.CellDataArraytoprocess = ['psl']
psl_as_point = CellDatatoPointData(Input=atm_file)
psl_as_point.ProcessAllArrays = 0
psl_as_point.CellDataArraytoprocess = ['psl']
# create a new 'Contour'
contour1 = Contour(Input=cellDatatoPointData1)
contour1.ContourBy = ['POINTS', 'psl']
contour1.Isosurfaces = [97000.0, 96000.0, 95000.0, 99000.0, 98000.0]
contour1.PointMergeMethod = 'Uniform Binning'
psl_contour = Contour(Input=psl_as_point)
psl_contour.ContourBy = ['POINTS', 'psl']
psl_contour.Isosurfaces = [97000.0, 96000.0, 95000.0, 99000.0, 98000.0]
psl_contour.PointMergeMethod = 'Uniform Binning'
# create a new 'Threshold'
threshold1 = Threshold(Input=calculator1)
threshold1 = Threshold(Input=zos_eff)
threshold1.Scalars = ['CELLS', 'Result']
threshold1.ThresholdRange = [-5.0, -0.0]
......@@ -87,42 +94,46 @@ threshold1.ThresholdRange = [-5.0, -0.0]
# setup the visualization in view 'renderView1'
# ----------------------------------------------------------------
# show data from dpp0016_atm_2d_ml_20201205T150000Znc
dpp0016_atm_2d_ml_20201205T150000ZncDisplay = Show(dpp0016_atm_2d_ml_20201205T150000Znc, renderView1, 'UnstructuredGridRepresentation')
# show data from atm_file
atm_fileDisplay = Show(atm_file, renderView1, 'UnstructuredGridRepresentation')
# trace defaults for the display properties.
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.Representation = 'Surface'
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.AmbientColor = [0.0, 0.0, 0.0]
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.ColorArrayName = ['POINTS', '']
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.DiffuseColor = [0.0, 0.0, 0.0]
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.OSPRayScaleFunction = 'PiecewiseFunction'
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.SelectOrientationVectors = 'None'
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.ScaleFactor = 59.99998779296875
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.SelectScaleArray = 'None'
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.GlyphType = 'Arrow'
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.GlyphTableIndexArray = 'None'
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.GaussianRadius = 2.9999993896484374
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.SetScaleArray = [None, '']
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.ScaleTransferFunction = 'PiecewiseFunction'
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.OpacityArray = [None, '']
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.OpacityTransferFunction = 'PiecewiseFunction'
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.DataAxesGrid = 'GridAxesRepresentation'
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.PolarAxes = 'PolarAxesRepresentation'
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.ScalarOpacityUnitDistance = 2.432556203035958
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.BumpMapInputDataArray = [None, '']
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.ExtrusionInputDataArray = ['CELLS', 'Center Latitude (CLAT)']
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.SelectInputVectors = [None, '']
dpp0016_atm_2d_ml_20201205T150000ZncDisplay.WriteLog = ''
# show data from calculator1
calculator1Display = Show(calculator1, renderView1, 'UnstructuredGridRepresentation')
atm_fileDisplay.Representation = 'Surface'
atm_fileDisplay.AmbientColor = [0.0, 0.0, 0.0]
atm_fileDisplay.ColorArrayName = ['POINTS', '']
atm_fileDisplay.DiffuseColor = [0.0, 0.0, 0.0]
atm_fileDisplay.OSPRayScaleFunction = 'PiecewiseFunction'
atm_fileDisplay.SelectOrientationVectors = 'None'
atm_fileDisplay.ScaleFactor = 59.99998779296875
atm_fileDisplay.SelectScaleArray = 'None'
atm_fileDisplay.GlyphType = 'Arrow'
atm_fileDisplay.GlyphTableIndexArray = 'None'
atm_fileDisplay.GaussianRadius = 2.9999993896484374
atm_fileDisplay.SetScaleArray = [None, '']
atm_fileDisplay.ScaleTransferFunction = 'PiecewiseFunction'
atm_fileDisplay.OpacityArray = [None, '']
atm_fileDisplay.OpacityTransferFunction = 'PiecewiseFunction'
atm_fileDisplay.DataAxesGrid = 'GridAxesRepresentation'
atm_fileDisplay.PolarAxes = 'PolarAxesRepresentation'
atm_fileDisplay.ScalarOpacityUnitDistance = 2.432556203035958