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

misc plots

parent 9cebb2d3
...@@ -8000,7 +8000,7 @@ ...@@ -8000,7 +8000,7 @@
<Domain name="bool" id="27514.SelectionVisibility.bool"/> <Domain name="bool" id="27514.SelectionVisibility.bool"/>
</Property> </Property>
<Property name="Visibility" id="27514.Visibility" number_of_elements="1"> <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"/> <Domain name="bool" id="27514.Visibility.bool"/>
</Property> </Property>
<Property name="Ambient" id="27514.Ambient" number_of_elements="1"> <Property name="Ambient" id="27514.Ambient" number_of_elements="1">
...@@ -10141,7 +10141,7 @@ ...@@ -10141,7 +10141,7 @@
<Domain name="bool" id="26325.SelectionVisibility.bool"/> <Domain name="bool" id="26325.SelectionVisibility.bool"/>
</Property> </Property>
<Property name="Visibility" id="26325.Visibility" number_of_elements="1"> <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"/> <Domain name="bool" id="26325.Visibility.bool"/>
</Property> </Property>
<Property name="Ambient" id="26325.Ambient" number_of_elements="1"> <Property name="Ambient" id="26325.Ambient" number_of_elements="1">
......
...@@ -13,7 +13,8 @@ mkdir -p animations ...@@ -13,7 +13,8 @@ mkdir -p animations
set -vx 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 #module load paraview
which pvbatch which pvbatch
md5sum $(which pvbatch) md5sum $(which pvbatch)
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
#SBATCH --partition=compute2 # Specify partition name #SBATCH --partition=compute2 # Specify partition name
#SBATCH --nodes=1 #SBATCH --nodes=1
#SBATCH --ntasks-per-node=24 #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 --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 --output=clouds.eo%j # File name for standard output
#SBATCH --error=clouds.eo%j # File name for standard error output #SBATCH --error=clouds.eo%j # File name for standard error output
...@@ -13,20 +13,24 @@ mkdir -p animations ...@@ -13,20 +13,24 @@ mkdir -p animations
set -vx 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 #module load paraview
which pvbatch which pvbatch
md5sum $(which pvbatch) md5sum $(which pvbatch)
scriptdir=$(pwd)n scriptdir=$(pwd)
if [ "$1" == MOLL ] ; then moll="MOLL world_no-legend" ; fi if [ "$1" == MOLL ] ; then moll="MOLL world_no-legend" ; fi
if [ "$1" == SPHERE ] ; then moll=SPHERE ; fi if [ "$1" == SPHERE ] ; then moll=SPHERE ; fi
ulimit -s 10240
for x in $@ ; do for x in $@ ; do
if [ "$x" == MOLL -o "$x" == SPHERE ] ; then if [ "$x" == MOLL -o "$x" == SPHERE ] ; then
continue continue
fi 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 done
# srun -l --propagate=STACK,CORE --cpu_bind=cores \ # srun -l --propagate=STACK,CORE --cpu_bind=cores \
# --distribution=block:cyclic # --distribution=block:cyclic
...@@ -135,11 +135,13 @@ print (region) ...@@ -135,11 +135,13 @@ print (region)
#import numpy as np #import numpy as np
from paraview.simple import * 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.8.0-gcc64-osmesa/lib64/paraview-5.8/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('/work/kv0653/k202134/Paraview/master/osmesa-release-O2/install/lib64/paraview-5.8/plugins/CDIReader/CDIReader.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('/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.7.0-gcc71-osmesa/lib64/paraview-5.7/plugins/StreamLinesRepresentation/StreamLinesRepresentation.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.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/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' #### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset() paraview.simple._DisableFirstRenderCameraReset()
...@@ -394,14 +396,18 @@ cloudsDisplay = Show(calculator1, renderView1) ...@@ -394,14 +396,18 @@ cloudsDisplay = Show(calculator1, renderView1)
prLUT = GetColorTransferFunction('pr') prLUT = GetColorTransferFunction('pr')
prLUT.AutomaticRescaleRangeMode = 'Never' prLUT.AutomaticRescaleRangeMode = 'Never'
prLUT.EnableOpacityMapping = 1 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.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 = 'Lab' prLUT.ColorSpace = 'RGB'
prLUT.UseLogScale = 1
prLUT.ScalarRangeInitialized = 1.0 prLUT.ScalarRangeInitialized = 1.0
# get opacity transfer function/opacity map for 'pr' # get opacity transfer function/opacity map for 'pr'
prPWF = GetOpacityTransferFunction('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 prPWF.ScalarRangeInitialized = 1
# convert to log space
# trace defaults for the display properties. # trace defaults for the display properties.
cloudsDisplay.Representation = 'Surface' cloudsDisplay.Representation = 'Surface'
...@@ -445,14 +451,14 @@ prLUTColorBar.RangeLabelFormat = '%.3f' ...@@ -445,14 +451,14 @@ prLUTColorBar.RangeLabelFormat = '%.3f'
log_clouds=True log_clouds=True
if (log_clouds): if (log_clouds):
# Rescale transfer function # Rescale transfer function
prPWF.RescaleTransferFunction(0.001, 5.0) # prPWF.RescaleTransferFunction(0.001, 5.0)
prLUT.RescaleTransferFunction(0.001, 5.0) # prLUT.RescaleTransferFunction(0.001, 5.0)
# convert to log space # convert to log space
prPWF.MapControlPointsToLogSpace() # prPWF.MapControlPointsToLogSpace()
# Properties modified on prPWF # Properties modified on prPWF
prPWF.UseLogScale = 1 prPWF.UseLogScale = 1
# convert to log space # convert to log space
prLUT.MapControlPointsToLogSpace() # prLUT.MapControlPointsToLogSpace()
# Properties modified on prLUT # Properties modified on prLUT
prLUT.UseLogScale = 1 prLUT.UseLogScale = 1
...@@ -524,7 +530,7 @@ for n,t in enumerate (tsteps): ...@@ -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. renderView1.CameraParallelScale = 149.9 # dann sind die Ränder leicht beschnitten, und die fehlenden Zellen tauchen nicht auf.
netCDFTimeAnnotation1Display.WindowLocation = 'AnyLocation' # top-left netCDFTimeAnnotation1Display.WindowLocation = 'AnyLocation' # top-left
netCDFTimeAnnotation1Display.Position = [0.01, 0.46] netCDFTimeAnnotation1Display.Position = [0.01, 0.46]
netCDFTimeAnnotation1Display.FontSize = 4 netCDFTimeAnnotation1Display.FontSize = 18
icon_readerDisplay.SetScalarBarVisibility(renderView1, False) icon_readerDisplay.SetScalarBarVisibility(renderView1, False)
cloudsDisplay.SetScalarBarVisibility(renderView1, False) cloudsDisplay.SetScalarBarVisibility(renderView1, False)
...@@ -537,7 +543,7 @@ for n,t in enumerate (tsteps): ...@@ -537,7 +543,7 @@ for n,t in enumerate (tsteps):
SaveScreenshot(basepath + '/%s_4p_cb_%06d.png'%(my_id, n), ImageResolution=(4096,2048)) SaveScreenshot(basepath + '/%s_4p_cb_%06d.png'%(my_id, n), ImageResolution=(4096,2048))
else: else:
netCDFTimeAnnotation1Display.FontSize = 4 netCDFTimeAnnotation1Display.FontSize = 12
sort_location(tsLUTColorBar, [0.92, 0.05]) sort_location(tsLUTColorBar, [0.92, 0.05])
sort_location(prLUTColorBar, [0.92, 0.63]) sort_location(prLUTColorBar, [0.92, 0.63])
prLUTColorBar.LabelFontSize = 8 prLUTColorBar.LabelFontSize = 8
...@@ -565,5 +571,8 @@ for n,t in enumerate (tsteps): ...@@ -565,5 +571,8 @@ for n,t in enumerate (tsteps):
tsr = conf["ts_range"] tsr = conf["ts_range"]
tsLUT.RescaleTransferFunction(tsr[0],tsr[1]) tsLUT.RescaleTransferFunction(tsr[0],tsr[1])
print("Saving 4k")
SaveScreenshot(basepath + '/%s_%s_4k_%06d.png'%(my_id, region, n), ImageResolution=(3840,2160)) 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)) SaveScreenshot(basepath + '/%s_%s_hd_%06d.png'%(my_id, region, n), ImageResolution=(1920,1080))
print("Saved HD")
#!/bin/bash #!/bin/bash
if [ ! -f $s/icon_data.nc ] ; then # 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 -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 -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 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 -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 -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-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-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/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 -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 cdo -expr,cloud=clivi*5+clwvi $s/ifs_raw.nc $s/ifs-cloud.nc
...@@ -400,13 +400,17 @@ icon_reader2Display = Show(calculator1, renderView1) ...@@ -400,13 +400,17 @@ icon_reader2Display = Show(calculator1, renderView1)
prLUT = GetColorTransferFunction('pr') prLUT = GetColorTransferFunction('pr')
prLUT.AutomaticRescaleRangeMode = 'Never' prLUT.AutomaticRescaleRangeMode = 'Never'
prLUT.EnableOpacityMapping = 1 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.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 = 'Lab' prLUT.ColorSpace = 'RGB'
prLUT.UseLogScale = 1
prLUT.ScalarRangeInitialized = 1.0 prLUT.ScalarRangeInitialized = 1.0
# get opacity transfer function/opacity map for 'pr' # get opacity transfer function/opacity map for 'pr'
prPWF = GetOpacityTransferFunction('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 prPWF.ScalarRangeInitialized = 1
# trace defaults for the display properties. # trace defaults for the display properties.
...@@ -451,14 +455,14 @@ prLUTColorBar.RangeLabelFormat = '%.3f' ...@@ -451,14 +455,14 @@ prLUTColorBar.RangeLabelFormat = '%.3f'
log_clouds=True log_clouds=True
if (log_clouds): if (log_clouds):
# Rescale transfer function # Rescale transfer function
prPWF.RescaleTransferFunction(0.001, 5.0) # prPWF.RescaleTransferFunction(0.001, 5.0)
prLUT.RescaleTransferFunction(0.001, 5.0) # prLUT.RescaleTransferFunction(0.001, 5.0)
# convert to log space # convert to log space
prPWF.MapControlPointsToLogSpace() # prPWF.MapControlPointsToLogSpace()
# Properties modified on prPWF # Properties modified on prPWF
prPWF.UseLogScale = 1 prPWF.UseLogScale = 1
# convert to log space # convert to log space
prLUT.MapControlPointsToLogSpace() # prLUT.MapControlPointsToLogSpace()
# Properties modified on prLUT # Properties modified on prLUT
prLUT.UseLogScale = 1 prLUT.UseLogScale = 1
......
...@@ -15,8 +15,10 @@ def parse_args(): ...@@ -15,8 +15,10 @@ def parse_args():
op = parser.parse_args() op = parser.parse_args()
options = vars(op) options = vars(op)
if options.get("oce", False): if options.get("oce", False):
print ("Globbing for " + options["oce"])
options["oce"]=glob.glob(options["oce"]) options["oce"]=glob.glob(options["oce"])
if options.get("atm", False): if options.get("atm", False):
print ("Globbing for " + options["atm"])
options["atm"]=glob.glob(options["atm"]) options["atm"]=glob.glob(options["atm"])
if options.get("ice", False): if options.get("ice", False):
options["ice"]=glob.glob(options["ice"]) options["ice"]=glob.glob(options["ice"])
......
...@@ -11,6 +11,13 @@ ...@@ -11,6 +11,13 @@
#### import the simple module from the paraview #### import the simple module from the paraview
from paraview.simple import * 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' #### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset() paraview.simple._DisableFirstRenderCameraReset()
...@@ -48,34 +55,35 @@ SetActiveView(renderView1) ...@@ -48,34 +55,35 @@ SetActiveView(renderView1)
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# create a new 'CDIReader' # create a new 'CDIReader'
dpp0016_ocean2D_20201030TZnc = CDIReader(FileNames=['/home/dkrz/k202134/Paraview/DYAMOND_WINTER/dpp0016/oce/dpp0016_ocean2D_20201030T000000Z.nc']) ice_file = CDIReader(FileNames= options['ice'])
dpp0016_ocean2D_20201030TZnc.Dimensions = '(clon, clat, lev)' ice_file.Dimensions = '(clon, clat, lev)'
dpp0016_ocean2D_20201030TZnc.CellArrayStatus = ['hi', 'hs', 'conc'] ice_file.CellArrayStatus = ['hi', 'hs', 'conc']
dpp0016_ocean2D_20201030TZnc.SetProjection = 'Cassini Projection' ice_file.SetProjection = 'Cassini Projection'
dpp0016_ocean2D_20201030TZnc.LayerThickness = 50 ice_file.LayerThickness = 50
# create a new 'NetCDF Time Annotation' # 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])' netCDFTimeAnnotation1.Expression = '"%02i-%02i-%02i" % (Date[0], Date[1], Date[2])'
# create a new 'CDIReader' # create a new 'CDIReader'
dpp0016_ocean3D_u1000m_20201030TZnc = CDIReader(FileNames=['/home/dkrz/k202134/Paraview/DYAMOND_WINTER/dpp0016/oce/dpp0016_ocean3D_u1000m_20201030T000000Z.nc']) oce_file = CDIReader(FileNames=options['oce'])
dpp0016_ocean3D_u1000m_20201030TZnc.Dimensions = '(clon, clat, depth)' oce_file.Dimensions = '(clon, clat, depth)'
dpp0016_ocean3D_u1000m_20201030TZnc.CellArrayStatus = ['to', 'so'] oce_file.CellArrayStatus = ['to', 'so']
dpp0016_ocean3D_u1000m_20201030TZnc.SetProjection = 'Cassini Projection' oce_file.SetProjection = 'Cassini Projection'
dpp0016_ocean3D_u1000m_20201030TZnc.LayerThickness = 50 oce_file.LayerThickness = 50
oce_file.VerticalLevel = 0
# create a new 'Threshold' # create a new 'Threshold'
threshold1 = Threshold(Input=dpp0016_ocean3D_u1000m_20201030TZnc) so_threshold = Threshold(Input=oce_file)
threshold1.Scalars = ['CELLS', 'so'] so_threshold.Scalars = ['CELLS', 'so']
threshold1.ThresholdRange = [1.0, 60.0] so_threshold.ThresholdRange = [0.00001, 60.0]
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# setup the visualization in view 'renderView1' # setup the visualization in view 'renderView1'
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# show data from dpp0016_ocean2D_20201030TZnc # show data from ice_file
dpp0016_ocean2D_20201030TZncDisplay = Show(dpp0016_ocean2D_20201030TZnc, renderView1, 'UnstructuredGridRepresentation') ice_fileDisplay = Show(ice_file, renderView1, 'UnstructuredGridRepresentation')
# get color transfer function/color map for 'conc' # get color transfer function/color map for 'conc'
concLUT = GetColorTransferFunction('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] ...@@ -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 concPWF.ScalarRangeInitialized = 1
# trace defaults for the display properties. # trace defaults for the display properties.
dpp0016_ocean2D_20201030TZncDisplay.Representation = 'Surface' ice_fileDisplay.Representation = 'Surface'
dpp0016_ocean2D_20201030TZncDisplay.ColorArrayName = ['CELLS', 'conc'] ice_fileDisplay.ColorArrayName = ['CELLS', 'conc']
dpp0016_ocean2D_20201030TZncDisplay.LookupTable = concLUT ice_fileDisplay.LookupTable = concLUT
dpp0016_ocean2D_20201030TZncDisplay.OSPRayScaleFunction = 'PiecewiseFunction' ice_fileDisplay.OSPRayScaleFunction = 'PiecewiseFunction'
dpp0016_ocean2D_20201030TZncDisplay.SelectOrientationVectors = 'None' ice_fileDisplay.SelectOrientationVectors = 'None'
dpp0016_ocean2D_20201030TZncDisplay.ScaleFactor = 60.166174316406256 ice_fileDisplay.ScaleFactor = 60.166174316406256
dpp0016_ocean2D_20201030TZncDisplay.SelectScaleArray = 'None' ice_fileDisplay.SelectScaleArray = 'None'
dpp0016_ocean2D_20201030TZncDisplay.GlyphType = 'Arrow' ice_fileDisplay.GlyphType = 'Arrow'
dpp0016_ocean2D_20201030TZncDisplay.GlyphTableIndexArray = 'None' ice_fileDisplay.GlyphTableIndexArray = 'None'
dpp0016_ocean2D_20201030TZncDisplay.GaussianRadius = 3.008308715820313 ice_fileDisplay.GaussianRadius = 3.008308715820313
dpp0016_ocean2D_20201030TZncDisplay.SetScaleArray = [None, ''] ice_fileDisplay.SetScaleArray = [None, '']
dpp0016_ocean2D_20201030TZncDisplay.ScaleTransferFunction = 'PiecewiseFunction' ice_fileDisplay.ScaleTransferFunction = 'PiecewiseFunction'
dpp0016_ocean2D_20201030TZncDisplay.OpacityArray = [None, ''] ice_fileDisplay.OpacityArray = [None, '']
dpp0016_ocean2D_20201030TZncDisplay.OpacityTransferFunction = 'PiecewiseFunction' ice_fileDisplay.OpacityTransferFunction = 'PiecewiseFunction'
dpp0016_ocean2D_20201030TZncDisplay.DataAxesGrid = 'GridAxesRepresentation' ice_fileDisplay.DataAxesGrid = 'GridAxesRepresentation'
dpp0016_ocean2D_20201030TZncDisplay.PolarAxes = 'PolarAxesRepresentation' ice_fileDisplay.PolarAxes = 'PolarAxesRepresentation'
dpp0016_ocean2D_20201030TZncDisplay.ScalarOpacityFunction = concPWF ice_fileDisplay.ScalarOpacityFunction = concPWF
dpp0016_ocean2D_20201030TZncDisplay.ScalarOpacityUnitDistance = 6.795499595074316 ice_fileDisplay.ScalarOpacityUnitDistance = 6.795499595074316
dpp0016_ocean2D_20201030TZncDisplay.BumpMapInputDataArray = [None, ''] ice_fileDisplay.BumpMapInputDataArray = [None, '']
dpp0016_ocean2D_20201030TZncDisplay.ExtrusionInputDataArray = ['CELLS', 'hi'] ice_fileDisplay.ExtrusionInputDataArray = ['CELLS', 'hi']
dpp0016_ocean2D_20201030TZncDisplay.SelectInputVectors = [None, ''] ice_fileDisplay.SelectInputVectors = [None, '']
dpp0016_ocean2D_20201030TZncDisplay.WriteLog = '' ice_fileDisplay.WriteLog = ''
# show data from threshold1 # show data from so_threshold
threshold1Display = Show(threshold1, renderView1, 'UnstructuredGridRepresentation') so_thresholdDisplay = Show(so_threshold, renderView1, 'UnstructuredGridRepresentation')
# get color transfer function/color map for 'so' # get color transfer function/color map for 'so'
soLUT = GetColorTransferFunction('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] ...@@ -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 soPWF.ScalarRangeInitialized = 1
# trace defaults for the display properties. # trace defaults for the display properties.
threshold1Display.Representation = 'Surface' so_thresholdDisplay.Representation = 'Surface'
threshold1Display.ColorArrayName = ['CELLS', 'so'] so_thresholdDisplay.ColorArrayName = ['CELLS', 'so']
threshold1Display.LookupTable = soLUT so_thresholdDisplay.LookupTable = soLUT
threshold1Display.OSPRayScaleFunction = 'PiecewiseFunction' so_thresholdDisplay.OSPRayScaleFunction = 'PiecewiseFunction'
threshold1Display.SelectOrientationVectors = 'None' so_thresholdDisplay.SelectOrientationVectors = 'None'
threshold1Display.ScaleFactor = 62.79500427246094 so_thresholdDisplay.ScaleFactor = 62.79500427246094
threshold1Display.SelectScaleArray = 'None' so_thresholdDisplay.SelectScaleArray = 'None'
threshold1Display.GlyphType = 'Arrow' so_thresholdDisplay.GlyphType = 'Arrow'
threshold1Display.GlyphTableIndexArray = 'None' so_thresholdDisplay.GlyphTableIndexArray = 'None'
threshold1Display.GaussianRadius = 3.139750213623047 so_thresholdDisplay.GaussianRadius = 3.139750213623047
threshold1Display.SetScaleArray = [None, ''] so_thresholdDisplay.SetScaleArray = [None, '']
threshold1Display.ScaleTransferFunction = 'PiecewiseFunction' so_thresholdDisplay.ScaleTransferFunction = 'PiecewiseFunction'
threshold1Display.OpacityArray = [None, ''] so_thresholdDisplay.OpacityArray = [None, '']
threshold1Display.OpacityTransferFunction = 'PiecewiseFunction' so_thresholdDisplay.OpacityTransferFunction = 'PiecewiseFunction'
threshold1Display.DataAxesGrid = 'GridAxesRepresentation' so_thresholdDisplay.DataAxesGrid = 'GridAxesRepresentation'
threshold1Display.PolarAxes = 'PolarAxesRepresentation' so_thresholdDisplay.PolarAxes = 'PolarAxesRepresentation'
threshold1Display.ScalarOpacityFunction = soPWF so_thresholdDisplay.ScalarOpacityFunction = soPWF
threshold1Display.ScalarOpacityUnitDistance = 7.210946129682988 so_thresholdDisplay.ScalarOpacityUnitDistance = 7.210946129682988
threshold1Display.BumpMapInputDataArray = [None, ''] so_thresholdDisplay.BumpMapInputDataArray = [None, '']
threshold1Display.ExtrusionInputDataArray = ['CELLS', 'Center Latitude (CLAT)'] so_thresholdDisplay.ExtrusionInputDataArray = ['CELLS', 'Center Latitude (CLAT)']
threshold1Display.SelectInputVectors = [None, ''] so_thresholdDisplay.SelectInputVectors = [None, '']
threshold1Display.WriteLog = '' so_thresholdDisplay.WriteLog = ''
# show data from netCDFTimeAnnotation1 # show data from netCDFTimeAnnotation1
netCDFTimeAnnotation1Display = Show(netCDFTimeAnnotation1, renderView1, 'TextSourceRepresentation') netCDFTimeAnnotation1Display = Show(netCDFTimeAnnotation1, renderView1, 'TextSourceRepresentation')
...@@ -172,7 +180,7 @@ soLUTColorBar.ComponentTitle = '' ...@@ -172,7 +180,7 @@ soLUTColorBar.ComponentTitle = ''
soLUTColorBar.Visibility = 1 soLUTColorBar.Visibility = 1
# show color legend # show color legend
threshold1Display.SetScalarBarVisibility(renderView1, True) so_thresholdDisplay.SetScalarBarVisibility(renderView1, True)
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# setup color maps and opacity mapes used in the visualization # setup color maps and opacity mapes used in the visualization
...@@ -180,6 +188,32 @@ threshold1Display.SetScalarBarVisibility(renderView1, True) ...@@ -180,6 +188,32 @@ threshold1Display.SetScalarBarVisibility(renderView1, True)
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# finally, restore active source
SetActiveSource(netCDFTimeAnnotation1) 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))
This diff is collapsed.
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