deepskies / deeplenstronomy

A pipeline for versatile strong lens sample simulations
MIT License
26 stars 7 forks source link

MASS_PROFILE requirement for source galaxy in config file #138

Open pensamint opened 9 months ago

pensamint commented 9 months ago

Hi team, I'm working on a conda virtual environment with jupyter lab on ubuntu 22.04.3. I was trying to run the notebooks hoping to recreate the images it currently shows. It throws a the following error:

SPECIES.GALAXY_2 needs at least one MASS_PROFILE (this is a new requirement as of version 0.0.1.8)

Fatal error(s) detected in config file. Please edit and rerun.
---------------------------------------------------------------------------
ConfigFileError                           Traceback (most recent call last)
~/anaconda3/envs/deeplens/lib/python3.7/site-packages/deeplenstronomy/check.py in _run_checks(full_dict, config_dict)
   1011     try:
-> 1012         check_runner = AllChecks(full_dict, config_dict)
   1013     except ConfigFileError:

~/anaconda3/envs/deeplens/lib/python3.7/site-packages/deeplenstronomy/check.py in __init__(self, full_dict, config_dict)
     85             _kind_output(total_errs)
---> 86             raise ConfigFileError
     87 

ConfigFileError: 

During handling of the above exception, another exception occurred:

ConfigFileError                           Traceback (most recent call last)
/tmp/ipykernel_24901/3483464997.py in <module>
----> 1 dataset = dl.make_dataset(config_file, verbose = True)

~/anaconda3/envs/deeplens/lib/python3.7/site-packages/deeplenstronomy/deeplenstronomy.py in make_dataset(config, dataset, save_to_disk, store_in_memory, verbose, store_sample, image_file_format, survey, return_planes, skip_image_generation, solve_lens_equation)
    313         if not _check_survey(survey):
    314             raise RuntimeError("survey={0} is not a valid survey.".format(survey))
--> 315         parser = Parser(config, survey=survey)
    316         dataset.config_dict = parser.config_dict
    317 

~/anaconda3/envs/deeplens/lib/python3.7/site-packages/deeplenstronomy/input_reader.py in __init__(self, config, survey)
     53 
     54         # Check for user errors in inputs
---> 55         self.check()
     56 
     57         return

~/anaconda3/envs/deeplens/lib/python3.7/site-packages/deeplenstronomy/input_reader.py in check(self)
    177         Check configuration file for possible user errors.
    178         """
--> 179         big_check._run_checks(self.full_dict, self.config_dict)
    180 
    181         return

~/anaconda3/envs/deeplens/lib/python3.7/site-packages/deeplenstronomy/check.py in _run_checks(full_dict, config_dict)
   1013     except ConfigFileError:
   1014         print("\nFatal error(s) detected in config file. Please edit and rerun.")
-> 1015         raise ConfigFileError
   1016 
   1017     return

ConfigFileError: 

The documentation still states that you don’t need one for the source, so the documentation should be changed to reflect this. And why does it need a source mass profile anyways, if only light is getting bent? Do we generally know the masses of source objects irl?

Also, when I specify a mass profile for the source, it doesn’t look like the ones in the repo.How do I recreate the outputs that are shown in the notebooks on this repo? I haven't changed anything else in the config file other than my output location

Here is my config file: https://github.com/pensamint/dspl-classification/blob/main/deeplens/demo.yaml

and here are what my outputs look like when i specify a mass profile: https://github.com/pensamint/dspl-classification/blob/main/deeplens/DeepLenstronomyDemo.ipynb

and here is the notebook i was trying to recreate: https://github.com/deepskies/deeplenstronomy/blob/9672080cd1a5792887341f4fb13c3b0bcf913600/Notebooks/DeepLenstronomyDemo.ipynb