"""
The following recipe will create 15 light cone projections that have 
at most 10% volume in common with each other.
"""
import yt.extensions.lightcone as LC

# Instantiate a light cone object as usual.
lc = LC.LightCone("128Mpc256grid_SFFB.param", initial_redshift=0.4, 
                  final_redshift=0.0, observer_redshift=0.0,
                  field_of_view_in_arcminutes=120.0, 
                  image_resolution_in_arcseconds=60.0,
                  use_minimum_datasets=True, deltaz_min=0.0, 
                  minimum_coherent_box_fraction=0.0,
                  output_dir='LC', output_prefix='LightCone')

# Try to find 15 solutions that have at most 10% volume in 
# common and give up after 50 consecutive failed attempts.
# The recycle=True setting tells the code to first attempt 
# to use recycled solutions before trying completely 
# independent solutions. 
LC.find_unique_solutions(lc, max_overlap=0.10, failures=50, 
                         seed=123456789, recycle=True,
                         solutions=15, filename='unique.dat')

# Make light cone projections with each of the random seeds 
# found above.  All output files will be written with unique 
# names based on the random seed numbers.  All keyword arguments 
# accepted by project_light_cone can be given here as well.
field = 'SZY'
LC.project_unique_light_cones(lc, 'unique.dat', field)
