Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in multiple_lens_injection notebook #97

Open
alxogm opened this issue Nov 29, 2023 · 1 comment
Open

Error in multiple_lens_injection notebook #97

alxogm opened this issue Nov 29, 2023 · 1 comment

Comments

@alxogm
Copy link

alxogm commented Nov 29, 2023

Hi @nkhadka21 when running notebooks/alxogm/slsim/notebooks/multiple_lens_injection.ipynb I get the following error in cell 6.

any idea why it could be?

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[6], line 9
      1 ## specify pixel number and pixel scale of the images. Here we have chosen 64 and 0.2 respectively.
      2 ## We should choose pixel scale = 0.2 to match the pixel scale scale of DC2 data.
      3 ## For this function one lens_cut. If not provided, default option is None.
      4 lens_cut = {
      5     "min_image_separation": 0.8,
      6     "max_image_separation": 10,
      7     "mag_arc_limit": {"g": 23, "r": 23, "i": 23},
      8 }
----> 9 injected_lens_catalog = lsst_science_pipeline.multiple_lens_injection(
     10     gg_lens_pop, 64, 0.2, ra, dec, butler, lens_cut=lens_cut, flux=None
     11 )

File ~/notebooks/alxogm/slsim/slsim/lsst_science_pipeline.py:308, in multiple_lens_injection(lens_pop, num_pix, delta_pix, butler, ra, dec, lens_cut, flux)
    299 injected_images = []
    300 for i in range(len(ra)):
    301     injected_images.append(
    302         lens_inejection(
    303             lens_pop,
    304             num_pix,
    305             delta_pix,
    306             butler,
    307             ra[i],
--> 308             dec[i],
    309             lens_cut=None,
    310             flux=None,
    311         )
    312     )
    313 injected_image_catalog = vstack(injected_images)
    314 return injected_image_catalog

TypeError: 'Butler' object is not subscriptable
@alxogm alxogm changed the title Error in Error in multiple_lens_injection notebook Nov 29, 2023
@nkhadka21
Copy link
Collaborator

Hi @alxogm, thank you very much for pointing out this. It is just a miss place of a butler object. Please correct as following:
injected_lens_catalog = lsst_science_pipeline.multiple_lens_injection(
10 gg_lens_pop, 64, 0.2, butler, ra, dec, lens_cut=lens_cut, flux=None
11 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants