@@ -30,12 +30,19 @@ def parse_args(args=None):
30
30
argparser .add_argument ("--particle" , "-p" , help = "Specify the particle type to visualise" ,
31
31
default = "dm" , type = str )
32
32
argparser .add_argument ("--center" , "-c" , help = "Specify the centering method: 'halo-<N>', 'all', 'zoom' or 'none'" ,
33
- default = "halo-1 " , type = str )
33
+ default = "none " , type = str )
34
34
argparser .add_argument ("--quantity" , "-q" , help = "Specify a quantity to render instead of density" ,
35
35
default = None , type = str )
36
36
argparser .add_argument ("--tile" , "-t" , help = "Wrap and tile the simulation box using its periodicity" ,
37
37
default = False , action = "store_true" )
38
38
39
+ argparser .add_argument ("--load-sphere" , nargs = 4 , help = "Load a sphere of particles with the given "
40
+ "radius and centre in simulation units, "
41
+ "e.g. --load-sphere 0.2 0.3 0.4 0.5 to load a sphere of "
42
+ "particles centre (0.3, 0.4, 0.5), radius 0.2. "
43
+ "Supported only for swift simulations" ,
44
+ default = None , type = float )
45
+
39
46
if args is None :
40
47
args = sys .argv [1 :]
41
48
arg_batches = []
@@ -77,8 +84,13 @@ def main():
77
84
logger .info (f"Using test data with { n_part } particles" )
78
85
loader_args = (n_part ,)
79
86
else :
87
+ import pynbody
80
88
loader_class = loader .PynbodyDataLoader
81
- loader_args = (args .filename , args .center , args .particle )
89
+ if args .load_sphere is not None :
90
+ loader_args = (args .filename , args .center , args .particle ,
91
+ pynbody .filt .Sphere (args .load_sphere [0 ], args .load_sphere [1 :]))
92
+ else :
93
+ loader_args = (args .filename , args .center , args .particle )
82
94
83
95
84
96
vis = visualizer .Visualizer (data_loader_class = loader_class ,
0 commit comments