From 4f6a0b31b04134baa82edacb6ebde1dad819dcff Mon Sep 17 00:00:00 2001 From: Alessandro Febretti Date: Wed, 24 Aug 2016 14:36:45 -0500 Subject: [PATCH] improved customizable config --- config.py => examples/config.py | 4 ++-- firefly.py | 5 ++++- loader.py | 10 ++++------ 3 files changed, 10 insertions(+), 9 deletions(-) rename config.py => examples/config.py (78%) diff --git a/config.py b/examples/config.py similarity index 78% rename from config.py rename to examples/config.py index 3363d57..39deb7b 100644 --- a/config.py +++ b/examples/config.py @@ -7,9 +7,9 @@ # use this to load a single file. # <<<<<<< Updated upstream -# datasetPath = '/Volumes/Windows/dev/omegalib/apps/firefly/snapshot_140.hdf5' +datasetPath = 'snapshot_140.hdf5' # ======= -datasetPath = 'C:/Users/defaultuser0/snapshot_140.hdf5' +#datasetPath = 'C:/Users/defaultuser0/snapshot_140.hdf5' # >>>>>>> Stashed changes diff --git a/firefly.py b/firefly.py index 572949e..077a3bc 100644 --- a/firefly.py +++ b/firefly.py @@ -4,6 +4,7 @@ from omium import * import porthole import datetime +import sys # # Initialize the signac point cloud rendering module. Whenever new data is loaded # # call the redraw function to refresh the screen. @@ -17,7 +18,9 @@ # #------------------------------------------------------------------------------- # # Load firefly components -orun('firefly/config.py') +configFile = sys.argv[1] +orun(configFile) +orun(loaderScript) orun('firefly/colormapConfig.py') orun('firefly/render.py') orun('firefly/loader.py') diff --git a/loader.py b/loader.py index fe8d5bc..285bd06 100644 --- a/loader.py +++ b/loader.py @@ -1,9 +1,6 @@ l = FireLoader() l.open(datasetPath) -# change the last number to choose a different decimation level for data loading -pointCloudLoadOptions = "50000 0:100000:10" - # # PartType0 ds0 = Dataset.create('PartType0') ds0.setLoader(l) @@ -17,8 +14,8 @@ vy0 = ds0.addDimension('Velocities', DimensionType.Float, 1, 'vy') vz0 = ds0.addDimension('Velocities', DimensionType.Float, 2, 'vz') -m0 = ds0.addDimension('Masses', DimensionType.Float,0, 'm') -e0 = ds0.addDimension('InternalEnergy',DimensionType.Float,0,'e') +#m0 = ds0.addDimension('Masses', DimensionType.Float,0, 'm') +#e0 = ds0.addDimension('InternalEnergy',DimensionType.Float,0,'e') pc0 = PointCloud.create('pc0') pc0.setOptions(pointCloudLoadOptions) @@ -39,6 +36,7 @@ pc1.setColor(Color('blue')) parts = [pc0, pc1] + dataModes = [ 'DataType', @@ -94,4 +92,4 @@ def setDataMode(mode): pc1.setVisible(False) redraw() -setDataMode(0) \ No newline at end of file +setDataMode(0)