diff --git a/dataset/cluster/simple/data.fits b/dataset/cluster/simple/data.fits index 6e527a11d..a81431924 100644 Binary files a/dataset/cluster/simple/data.fits and b/dataset/cluster/simple/data.fits differ diff --git a/dataset/cluster/simple/dataset_point.png b/dataset/cluster/simple/dataset_point.png deleted file mode 100644 index f1ceb0ae4..000000000 Binary files a/dataset/cluster/simple/dataset_point.png and /dev/null differ diff --git a/dataset/cluster/simple/noise_map.fits b/dataset/cluster/simple/noise_map.fits index 234ec0e15..11666ea11 100644 Binary files a/dataset/cluster/simple/noise_map.fits and b/dataset/cluster/simple/noise_map.fits differ diff --git a/dataset/cluster/simple/point_dataset_0.json b/dataset/cluster/simple/point_dataset_0.json index 3dba503b3..27fbec5d7 100644 --- a/dataset/cluster/simple/point_dataset_0.json +++ b/dataset/cluster/simple/point_dataset_0.json @@ -3,11 +3,6 @@ "class_path": "autolens.point.dataset.PointDataset", "arguments": { "time_delays": null, - "fluxes_noise_map": null, - "fluxes": null, - "time_delays_noise_map": null, - "redshift": 1.0, - "name": "point_0", "positions_noise_map": { "type": "instance", "class_path": "autoarray.structures.arrays.irregular.ArrayIrregular", @@ -15,7 +10,6 @@ "values": { "type": "ndarray", "array": [ - 0.005, 0.005, 0.005 ], @@ -23,6 +17,9 @@ } } }, + "redshift": 1.0, + "name": "point_0", + "fluxes_noise_map": null, "positions": { "type": "instance", "class_path": "autoarray.structures.grids.irregular_2d.Grid2DIrregular", @@ -31,21 +28,19 @@ "type": "ndarray", "array": [ [ - -9.166406249999998, - -19.276733167466432 - ], - [ - 0.0359375, - -0.0739730032399208 + 1.0, + 0.0 ], [ - 1.8125, - 23.34028674178623 + 0.0, + 1.0 ] ], "dtype": "float64" } } - } + }, + "time_delays_noise_map": null, + "fluxes": null } } \ No newline at end of file diff --git a/dataset/cluster/simple/point_dataset_1.json b/dataset/cluster/simple/point_dataset_1.json index b566489dc..2d8b83da6 100644 --- a/dataset/cluster/simple/point_dataset_1.json +++ b/dataset/cluster/simple/point_dataset_1.json @@ -3,11 +3,6 @@ "class_path": "autolens.point.dataset.PointDataset", "arguments": { "time_delays": null, - "fluxes_noise_map": null, - "fluxes": null, - "time_delays_noise_map": null, - "redshift": 2.0, - "name": "point_1", "positions_noise_map": { "type": "instance", "class_path": "autoarray.structures.arrays.irregular.ArrayIrregular", @@ -15,7 +10,6 @@ "values": { "type": "ndarray", "array": [ - 0.005, 0.005, 0.005 ], @@ -23,6 +17,9 @@ } } }, + "redshift": 2.0, + "name": "point_1", + "fluxes_noise_map": null, "positions": { "type": "instance", "class_path": "autoarray.structures.grids.irregular_2d.Grid2DIrregular", @@ -31,21 +28,19 @@ "type": "ndarray", "array": [ [ - -15.96796875, - 19.00429600919258 - ], - [ - 0.68125, - -0.5133004737014016 + 1.0, + 0.0 ], [ - 13.6921875, - -14.30926557794663 + 0.0, + 1.0 ] ], "dtype": "float64" } } - } + }, + "time_delays_noise_map": null, + "fluxes": null } } \ No newline at end of file diff --git a/dataset/cluster/simple/point_datasets.csv b/dataset/cluster/simple/point_datasets.csv index 7c9c3b36a..a460418f0 100644 --- a/dataset/cluster/simple/point_datasets.csv +++ b/dataset/cluster/simple/point_datasets.csv @@ -1,7 +1,5 @@ name,y,x,positions_noise,redshift -point_0,-9.166406249999998,-19.276733167466432,0.005,1.0 -point_0,0.0359375,-0.0739730032399208,0.005,1.0 -point_0,1.8125,23.34028674178623,0.005,1.0 -point_1,-15.96796875,19.00429600919258,0.005,2.0 -point_1,0.68125,-0.5133004737014016,0.005,2.0 -point_1,13.6921875,-14.30926557794663,0.005,2.0 +point_0,1.0,0.0,0.005,1.0 +point_0,0.0,1.0,0.005,1.0 +point_1,1.0,0.0,0.005,2.0 +point_1,0.0,1.0,0.005,2.0 diff --git a/dataset/cluster/simple/psf.fits b/dataset/cluster/simple/psf.fits index 940efcd87..3d342eff1 100644 Binary files a/dataset/cluster/simple/psf.fits and b/dataset/cluster/simple/psf.fits differ diff --git a/dataset/cluster/simple/tracer.json b/dataset/cluster/simple/tracer.json index 8dc008087..82175406a 100644 --- a/dataset/cluster/simple/tracer.json +++ b/dataset/cluster/simple/tracer.json @@ -23,8 +23,8 @@ ] }, "sersic_index": 4.0, - "intensity": 1.5, - "effective_radius": 3.0 + "effective_radius": 3.0, + "intensity": 1.5 } }, "mass": { @@ -38,8 +38,8 @@ 0.0 ] }, - "rs": 20.0, "b0": 3.0, + "rs": 20.0, "ra": 8.0 } } @@ -63,8 +63,8 @@ ] }, "sersic_index": 3.5, - "intensity": 0.8, - "effective_radius": 1.5 + "effective_radius": 1.5, + "intensity": 0.8 } }, "mass": { @@ -78,8 +78,8 @@ 8.0 ] }, - "rs": 12.0, "b0": 1.2, + "rs": 12.0, "ra": 5.0 } } @@ -103,8 +103,8 @@ ] }, "sersic_index": 3.0, - "intensity": 0.4, - "effective_radius": 0.8 + "effective_radius": 0.8, + "intensity": 0.4 } }, "mass": { @@ -118,8 +118,8 @@ -6.5 ] }, - "rs": 10.0, "b0": 0.12, + "rs": 10.0, "ra": 0.1 } } @@ -143,8 +143,8 @@ ] }, "sersic_index": 3.0, - "intensity": 0.32, - "effective_radius": 0.8 + "effective_radius": 0.8, + "intensity": 0.32 } }, "mass": { @@ -158,8 +158,8 @@ 3.0 ] }, - "rs": 8.94427190999916, "b0": 0.1073312629199899, + "rs": 8.94427190999916, "ra": 0.1 } } @@ -183,8 +183,8 @@ ] }, "sersic_index": 3.0, - "intensity": 0.25, - "effective_radius": 0.8 + "effective_radius": 0.8, + "intensity": 0.25 } }, "mass": { @@ -198,8 +198,8 @@ -5.0 ] }, - "rs": 7.905694150420949, "b0": 0.09486832980505139, + "rs": 7.905694150420949, "ra": 0.1 } } @@ -223,8 +223,8 @@ ] }, "sersic_index": 3.0, - "intensity": 0.2, - "effective_radius": 0.8 + "effective_radius": 0.8, + "intensity": 0.2 } }, "mass": { @@ -238,8 +238,8 @@ -9.0 ] }, - "rs": 7.0710678118654755, "b0": 0.08485281374238571, + "rs": 7.0710678118654755, "ra": 0.1 } } @@ -263,8 +263,8 @@ ] }, "sersic_index": 3.0, - "intensity": 0.16, - "effective_radius": 0.8 + "effective_radius": 0.8, + "intensity": 0.16 } }, "mass": { @@ -278,8 +278,8 @@ 13.0 ] }, - "rs": 6.324555320336759, "b0": 0.0758946638440411, + "rs": 6.324555320336759, "ra": 0.1 } } @@ -303,8 +303,8 @@ ] }, "sersic_index": 3.0, - "intensity": 0.13, - "effective_radius": 0.8 + "effective_radius": 0.8, + "intensity": 0.13 } }, "mass": { @@ -318,8 +318,8 @@ 4.0 ] }, - "rs": 5.7008771254956905, "b0": 0.06841052550594828, + "rs": 5.7008771254956905, "ra": 0.1 } } @@ -343,8 +343,8 @@ ] }, "sersic_index": 3.0, - "intensity": 0.1, - "effective_radius": 0.8 + "effective_radius": 0.8, + "intensity": 0.1 } }, "mass": { @@ -358,8 +358,8 @@ 9.0 ] }, - "rs": 5.0, "b0": 0.06, + "rs": 5.0, "ra": 0.1 } } @@ -383,8 +383,8 @@ ] }, "sersic_index": 3.0, - "intensity": 0.08, - "effective_radius": 0.8 + "effective_radius": 0.8, + "intensity": 0.08 } }, "mass": { @@ -398,8 +398,8 @@ -12.0 ] }, - "rs": 4.47213595499958, "b0": 0.05366563145999495, + "rs": 4.47213595499958, "ra": 0.1 } } @@ -423,8 +423,8 @@ ] }, "sersic_index": 3.0, - "intensity": 0.06, - "effective_radius": 0.8 + "effective_radius": 0.8, + "intensity": 0.06 } }, "mass": { @@ -438,8 +438,8 @@ 5.5 ] }, - "rs": 3.872983346207417, "b0": 0.046475800154489, + "rs": 3.872983346207417, "ra": 0.1 } } @@ -463,8 +463,8 @@ ] }, "sersic_index": 3.0, - "intensity": 0.05, - "effective_radius": 0.8 + "effective_radius": 0.8, + "intensity": 0.05 } }, "mass": { @@ -478,8 +478,8 @@ 11.0 ] }, - "rs": 3.5355339059327378, "b0": 0.042426406871192854, + "rs": 3.5355339059327378, "ra": 0.1 } } @@ -502,9 +502,9 @@ 0.0 ] }, - "redshift_object": 0.5, "redshift_source": 2.0, - "mass_at_200": 1995262314968882.8 + "mass_at_200": 1995262314968882.8, + "redshift_object": 0.5 } } } @@ -519,8 +519,9 @@ "type": "instance", "class_path": "autogalaxy.profiles.light.standard.sersic_core.SersicCore", "arguments": { - "intensity": 2.0, - "sersic_index": 1.0, + "alpha": 3.0, + "radius_break": 0.025, + "effective_radius": 0.3, "ell_comps": { "type": "tuple", "values": [ @@ -528,7 +529,7 @@ -0.05555555555555551 ] }, - "effective_radius": 0.3, + "intensity": 2.0, "centre": { "type": "tuple", "values": [ @@ -536,9 +537,8 @@ 0.5 ] }, - "gamma": 0.25, - "alpha": 3.0, - "radius_break": 0.025 + "sersic_index": 1.0, + "gamma": 0.25 } } } @@ -553,8 +553,9 @@ "type": "instance", "class_path": "autogalaxy.profiles.light.standard.sersic_core.SersicCore", "arguments": { - "intensity": 2.0, - "sersic_index": 1.0, + "alpha": 3.0, + "radius_break": 0.025, + "effective_radius": 0.3, "ell_comps": { "type": "tuple", "values": [ @@ -562,7 +563,7 @@ -0.11111111111111108 ] }, - "effective_radius": 0.3, + "intensity": 2.0, "centre": { "type": "tuple", "values": [ @@ -570,9 +571,8 @@ 1.2 ] }, - "gamma": 0.25, - "alpha": 3.0, - "radius_break": 0.025 + "sersic_index": 1.0, + "gamma": 0.25 } } } diff --git a/scripts/cluster/lenstool/data.py b/scripts/cluster/lenstool/data.py index e04a14df6..159428927 100644 --- a/scripts/cluster/lenstool/data.py +++ b/scripts/cluster/lenstool/data.py @@ -285,7 +285,14 @@ def parse_best_par(path: Path) -> tuple: """ cutout_path = DATASET_PATH / "data.fits" -if not cutout_path.exists(): +import os + +if os.environ.get("PYAUTO_SMALL_DATASETS") == "1": + print( + "PYAUTO_SMALL_DATASETS=1: skipping the 96 MB RELICS mosaic download / cutout " + "(visualization-only product; the modeling data products above are complete)." + ) +elif not cutout_path.exists(): from astropy.io import fits from astropy.wcs import WCS diff --git a/scripts/cluster/lenstool/modeling.py b/scripts/cluster/lenstool/modeling.py index 05446b664..acc9dadcc 100644 --- a/scripts/cluster/lenstool/modeling.py +++ b/scripts/cluster/lenstool/modeling.py @@ -490,7 +490,7 @@ def halo_model_from(label, limits): import os -if os.environ.get("PYAUTO_TEST_MODE") or os.environ.get("LENSTOOL_EXAMPLE_RUN_FIT"): +if os.environ.get("LENSTOOL_EXAMPLE_RUN_FIT"): analysis_factor_list = [ af.AnalysisFactor(prior_model=model, analysis=analysis) for analysis in analysis_list @@ -502,8 +502,9 @@ def halo_model_from(label, limits): print("Refit complete — compare result_list max-likelihood values with Table 3.") else: print( - "Refit composition validated; set LENSTOOL_EXAMPLE_RUN_FIT=1 (or PYAUTO_TEST_MODE=2 for " - "a structural pass) to execute the search." + "Refit composition validated (the model.info above is the structural pass); set " + "LENSTOOL_EXAMPLE_RUN_FIT=1 to execute the production-scale search — a 72-parameter " + "factor-graph fit is never smoke-mode material." ) """ diff --git a/scripts/cluster/modeling.py b/scripts/cluster/modeling.py index f5ac81294..379ff8109 100644 --- a/scripts/cluster/modeling.py +++ b/scripts/cluster/modeling.py @@ -104,11 +104,7 @@ If the dataset does not already exist on your system, it will be created by running the corresponding simulator script. This ensures that all example scripts can be run without manually simulating data first. """ -if ( - not (dataset_path / "data.fits").exists() - or not (dataset_path / "scaling_galaxies.csv").exists() - or not (dataset_path / "mass.csv").exists() -): +if al.util.dataset.should_simulate(str(dataset_path)): import subprocess import sys diff --git a/scripts/cluster/start_here.py b/scripts/cluster/start_here.py index 4f6d31a18..d2f1a0df1 100644 --- a/scripts/cluster/start_here.py +++ b/scripts/cluster/start_here.py @@ -124,16 +124,14 @@ - ``mass.csv`` / ``light.csv`` / ``point.csv`` — named-galaxy CSVs carrying the full truth model, including the centres of the main galaxies and host halo (see ``csv_api.py``). -If the dataset is missing on disk, the corresponding simulator script runs automatically. +If the dataset does not already exist on your system (per ``al.util.dataset.should_simulate``, +which also handles the smoke-mode ``PYAUTO_SMALL_DATASETS`` regeneration case), it is created +by running the corresponding simulator script. """ dataset_name = "simple" dataset_path = Path("dataset") / "cluster" / dataset_name -if ( - not (dataset_path / "data.fits").exists() - or not (dataset_path / "scaling_galaxies.csv").exists() - or not (dataset_path / "mass.csv").exists() -): +if al.util.dataset.should_simulate(str(dataset_path)): subprocess.run( [sys.executable, "scripts/cluster/simulator.py"], check=True,