[SIM2D-139] Simulator fails with TypeError Created: 29/Jun/21  Updated: 29/Jun/21  Resolved: 29/Jun/21

Status: Done
Project: DRP 2-D Simulator
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: hassan Assignee: hassan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Story Points: 1
Reviewers: price

 Description   

When running the simulator, eg with the command:

makeSim --visit 47 --detector r1  --pfsDesignId 1 --exptime 1800 --type object

The simulator fails with the following error:

Traceback (most recent call last):
  File "/tigress/HSC/PFS/stack/current/python/miniconda3-4.5.12/envs/lsst-scipipe/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/tigress/HSC/PFS/stack/current/python/miniconda3-4.5.12/envs/lsst-scipipe/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tigress/hassans/software/drp_instmodel/python/pfs/instmodel/makeSim.py", line 308, in <module>
    main()
  File "/tigress/hassans/software/drp_instmodel/python/pfs/instmodel/makeSim.py", line 275, in main
    logger=logger)
  File "/tigress/hassans/software/drp_instmodel/python/pfs/instmodel/makeSim.py", line 88, in makeSim
    spectra = [source.getSpectrum(fiberId) for fiberId in fibers]
  File "/tigress/hassans/software/drp_instmodel/python/pfs/instmodel/makeSim.py", line 88, in <listcomp>
    spectra = [source.getSpectrum(fiberId) for fiberId in fibers]
  File "/tigress/hassans/software/drp_instmodel/python/pfs/instmodel/lightSource.py", line 164, in getSpectrum
    target = self.getTargetData(fiberId)
  File "/tigress/hassans/software/drp_instmodel/python/pfs/instmodel/lightSource.py", line 216, in getTargetData
    assert len(index) == 1
TypeError: object of type 'int' has no len()


 Comments   
Comment by hassan [ 29/Jun/21 ]

Problem seems to be a consequence of the changes made in PIPE2D-762. With the changes made there, the return value of pfsDesign.selectFiber(fiberId) can now be a scalar as well as a sequence. A scalar return value its currently not supported in the 2D simulator (specifically lightSource.py), resulting in the failure.

Comment by hassan [ 29/Jun/21 ]

Merged to master.

Generated at Sat Feb 10 16:08:58 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.