[SIM2D-94] Simulator should accept a PfsConfig instance Created: 30/Jan/19  Updated: 14/Mar/19  Resolved: 14/Mar/19

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

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

Issue Links:
Blocks
blocks PIPE2D-316 Demonstrate arm merging Done
Relates
relates to SIM2D-109 Refactor code such that PfsConfigs ar... Done
Story Points: 5
Sprint: 2019 B, 2DDRP-2019 C
Reviewers: hassan

 Description   

The Simulator has the capability of reading a library of spectra, but the association between fibers and spectra is currently random. In order to simulate a survey, the user should provide a PfsConfig to the Simulator, which it then implements.
This requires:

  • Modifying the front-end of the Simulator to accept a PfsConfig
  • Providing a facility to construct a PfsConfig (random assignment) for the user who doesn't want to run a full simulated survey targeting program.


 Comments   
Comment by price [ 09/Feb/19 ]

Also, create the blue and red images as part of the same command.

Comment by price [ 22/Feb/19 ]

Actually, we want the simulator to accept a PfiDesign; this is kinda how the actual instrument works too.

Comment by price [ 22/Feb/19 ]

hassan, I believe this is done; I'll do some more testing on Monday.

I've made the modifications to the simulator. There's also a minor addition to PfsConfig in datamodel and a bugfix there too, just because I spotted it. The changes in pfs_instmodel are based off PIPE2D-316.

price@MacBook:~/pfs/datamodel (tickets/SIM2D-94=) $ git sub
commit e5f9193c3694baef9195c99f4e53d7605c4d1db8
Author: Paul Price <price@astro.princeton.edu>
Date:   Wed Feb 20 15:54:10 2019 -0500

    PfsSpectra: fix plotting
    
    Was attempting to iterate over multiple arrays withing zipping them.

 python/pfs/datamodel/pfsSpectra.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit da266024310c3564a9801ffba3278549ca844513
Author: Paul Price <price@astro.princeton.edu>
Date:   Wed Feb 20 18:27:14 2019 -0500

    git: ignore test side effect

 .gitignore | 1 +
 1 file changed, 1 insertion(+)

commit 80ecb2918596f246df9f5cddce043616280e72ac (HEAD -> tickets/SIM2D-94, origin/tickets/SIM2D-94)
Author: Paul Price <price@astro.princeton.edu>
Date:   Thu Feb 21 15:23:48 2019 -0500

    add PfsConfig.fromPfiDesign
    
    Construct a PfsConfig given a PfiDesign and a couple of other bits.

 python/pfs/datamodel/pfsConfig.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)



price@MacBook:~/pfs/drp_instmodel (tickets/SIM2D-94 %=) $ git sub tickets/SIM2D-94 origin/tickets/PIPE2D-316
commit 210807152bd423cef1be439c7647a40c8a3c71b3 (HEAD -> tickets/SIM2D-94, origin/tickets/SIM2D-94, tickets/PIPE2D-316)
Author: Paul Price <price@astro.princeton.edu>
Date:   Thu Feb 21 20:55:45 2019 -0500

    split makeSim into makePfiDesign+makeSim
    
    In order to create multiple arms with the same fiber assignments, we
    want makeSim to receive a PfiDesign (that's kinda how the actual
    instrument will work too!). So now you first makePfiDesign, and then
    use that PfiDesign in makeSim.
    
    In the process, did some reorganisation ("python/pfs_instmodel" -->
    "python/pfs/instmodel"; remove "examples" directory and rename
    sampleField.py to fieldDefinitions.py); sorry to include these here,
    but it was difficult to split out after having done the work.

 bin/makePfiDesign                                  |   1 +
 bin/makeSimRun                                     |  75 +++++-----
 .../{pfs_instmodel => pfs/instmodel}/__init__.py   |   0
 .../{pfs_instmodel => pfs/instmodel}/detector.py   |   0
 .../{pfs_instmodel => pfs/instmodel}/exposure.py   |   0
 python/pfs/instmodel/fieldDefinitions.py           |  87 ++++++++++++
 .../{pfs_instmodel => pfs/instmodel}/jegSpots.py   |   0
 python/pfs/instmodel/makePfiDesign.py              |  51 +++++++
 .../instmodel}/makePfsConfig.py                    | 117 ++++++++--------
 python/{pfs_instmodel => pfs/instmodel}/makeSim.py |  35 ++---
 .../{pfs_instmodel => pfs/instmodel}/plotutils.py  |   0
 python/{pfs_instmodel => pfs/instmodel}/probe.py   |   0
 python/{pfs_instmodel => pfs/instmodel}/psf.py     |   0
 python/pfs/instmodel/readme.txt                    | 154 +++++++++++++++++++++
 .../examples => pfs/instmodel/schema}/__init__.py  |   0
 .../instmodel}/schema/probes.py                    |   0
 .../{pfs_instmodel => pfs/instmodel}/simImage.py   |   6 +-
 python/{pfs_instmodel => pfs/instmodel}/sky.py     |   0
 python/{pfs_instmodel => pfs/instmodel}/slit.py    |   0
 python/{pfs_instmodel => pfs/instmodel}/specMap.py |   0
 .../{pfs_instmodel => pfs/instmodel}/spectrum.py   |   0
 .../instmodel}/spectrumLibrary.py                  |   0
 .../{pfs_instmodel => pfs/instmodel}/splinedPsf.py |   8 ++
 .../{pfs_instmodel => pfs/instmodel}/spotgames.py  |   2 +-
 .../instmodel}/utils/SeqPath.py                    |   0
 .../instmodel}/utils/__init__.py                   |   0
 .../instmodel}/utils/blackbody.py                  |   0
 .../instmodel}/utils/centroid.py                   |   0
 .../instmodel}/utils/configFile.py                 |   0
 .../instmodel}/utils/generators.py                 |   0
 .../{pfs_instmodel => pfs/instmodel}/utils/geom.py |   0
 .../instmodel}/utils/pydebug.py                    |   0
 .../instmodel}/utils/rebin.py                      |   0
 .../instmodel}/utils/schema.py                     |   0
 .../{pfs_instmodel => pfs/instmodel}/zemaxSpots.py |   0
 python/pfs_instmodel/examples/sampleField.py       |  77 -----------
 python/pfs_instmodel/schema/__init__.py            |   0
 37 files changed, 418 insertions(+), 195 deletions(-)
Comment by price [ 08/Mar/19 ]

I've added GitHub PRs for datamodel and drp_instmodel. The latter includes related work that gets the simulator working on the blue arm.

Comment by hassan [ 08/Mar/19 ]

Comment made by cloomis during review moved to a separate ticket (SIM2D-109).

Comment by price [ 14/Mar/19 ]

Merged to master.

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