[SIM2D-88] Compare ETC and SIM2D+DRP2D outputs Created: 02/Nov/18  Updated: 27/Apr/19  Resolved: 30/Jan/19

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

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

Attachments: File armStats.py     PNG File signoise.png    
Story Points: 8
Sprint: 2019 A
Reviewers: cloomis

 Description   

Given some input pfsSimObject, we need drp_instmodel plus drp_stella outputs to match those from spt_ExposureTimeCalculator.



 Comments   
Comment by price [ 18/Dec/18 ]

Running the 1D simulator:

price@MacBook:~/pfs/spt_ExposureTimeCalculator (tickets/SIM2D-88=) $ python scripts/run_etc.py @scripts/run_etc.defaults --MAG_FILE=22.0 --MR_MODE=no --EXP_TIME=900 --OUTFILE_SNC=out/etc-22mag-900sec.dat --OUTFILE_SNL=-
price@MacBook:~/pfs/spt_ExposureTimeCalculator (tickets/SIM2D-88=) $ python scripts/gen_sim_spec.py @scripts/gen_sim_spec.defaults --outDir=out --etcFile=out/etc-22mag-900sec.dat --MAG_FILE=22.0
Comment by price [ 18/Dec/18 ]

Running the 2D simulator:

setup pfs_pipe2d
setup -jr ~/pfs/datamodel  # tickets/DAMD-32
setup -jr ~/pfs/drp_instmodel  # tickets/SIM2D-88
setup -jr ~/pfs/drp_instdata  # master
cd ~/pfs/SIMS
makeSingleSim

Processing the 2D simulated data:

lsst@824ef520e03f:~/pfs/SIMS $ echo lsst.obs.pfs.PfsMapper > 20181213/_mapper
lsst@824ef520e03f:~/pfs/SIMS $ ingestImages.py /home/lsst/pfs/SIMS/20181213 20181213-raw/PFFA*.fits

sqlite> select * from raw;
id|site|category|field|visit|ccd|filter|arm|spectrograph|dateObs|expTime|dataType|taiObs|pfsConfigId|slitOffset
1|F|A|BIAS|0|1|r|r|1|2018-12-13|0.0|BIAS|2018-12-13|0|0.0
2|F|A|BIAS|1|1|r|r|1|2018-12-13|0.0|BIAS|2018-12-13|0|0.0
3|F|A|BIAS|2|1|r|r|1|2018-12-13|0.0|BIAS|2018-12-13|0|0.0
4|F|A|BIAS|3|1|r|r|1|2018-12-13|0.0|BIAS|2018-12-13|0|0.0
5|F|A|BIAS|4|1|r|r|1|2018-12-13|0.0|BIAS|2018-12-13|0|0.0
6|F|A|BIAS|5|1|r|r|1|2018-12-13|0.0|BIAS|2018-12-13|0|0.0
7|F|A|BIAS|6|1|r|r|1|2018-12-13|0.0|BIAS|2018-12-13|0|0.0
8|F|A|BIAS|7|1|r|r|1|2018-12-13|0.0|BIAS|2018-12-13|0|0.0
9|F|A|BIAS|8|1|r|r|1|2018-12-13|0.0|BIAS|2018-12-13|0|0.0
10|F|A|BIAS|9|1|r|r|1|2018-12-13|0.0|BIAS|2018-12-13|0|0.0
11|F|A|DARK|10|1|r|r|1|2018-12-13|900.0|DARK|2018-12-13|0|0.0
12|F|A|DARK|11|1|r|r|1|2018-12-13|900.0|DARK|2018-12-13|0|0.0
13|F|A|DARK|12|1|r|r|1|2018-12-13|900.0|DARK|2018-12-13|0|0.0
14|F|A|DARK|13|1|r|r|1|2018-12-13|900.0|DARK|2018-12-13|0|0.0
15|F|A|DARK|14|1|r|r|1|2018-12-13|900.0|DARK|2018-12-13|0|0.0
16|F|A|DARK|15|1|r|r|1|2018-12-13|900.0|DARK|2018-12-13|0|0.0
17|F|A|DARK|16|1|r|r|1|2018-12-13|900.0|DARK|2018-12-13|0|0.0
18|F|A|DARK|17|1|r|r|1|2018-12-13|900.0|DARK|2018-12-13|0|0.0
19|F|A|DARK|18|1|r|r|1|2018-12-13|900.0|DARK|2018-12-13|0|0.0
20|F|A|DARK|19|1|r|r|1|2018-12-13|900.0|DARK|2018-12-13|0|0.0
21|F|A|FLAT|20|1|r|r|1|2018-12-13|30.0|FLAT|2018-12-13|0|0.0
22|F|A|FLAT|21|1|r|r|1|2018-12-13|30.0|FLAT|2018-12-13|0|0.0
23|F|A|FLAT|22|1|r|r|1|2018-12-13|30.0|FLAT|2018-12-13|0|0.0
24|F|A|FLAT|23|1|r|r|1|2018-12-13|30.0|FLAT|2018-12-13|0|0.0
25|F|A|FLAT|24|1|r|r|1|2018-12-13|30.0|FLAT|2018-12-13|0|0.0
26|F|A|FLAT|25|1|r|r|1|2018-12-13|30.0|FLAT|2018-12-13|0|0.0
27|F|A|FLAT|26|1|r|r|1|2018-12-13|30.0|FLAT|2018-12-13|0|0.0
28|F|A|FLAT|27|1|r|r|1|2018-12-13|30.0|FLAT|2018-12-13|0|0.0
29|F|A|FLAT|28|1|r|r|1|2018-12-13|30.0|FLAT|2018-12-13|0|0.0
30|F|A|FLAT|29|1|r|r|1|2018-12-13|30.0|FLAT|2018-12-13|0|0.0
31|F|A|FLAT|30|1|r|r|1|2018-12-13|30.0|FLAT|2018-12-13|0|0.0
32|F|A|ARC|31|1|r|r|1|2018-12-13|1.0|ARC|2018-12-13|0|0.0
33|F|A|OBJECT|32|1|r|r|1|2018-12-13|900.0|OBJECT|2018-12-13|0|0.0

lsst@824ef520e03f:~/pfs/SIMS $ mkdir 20181213/CALIB/

lsst@824ef520e03f:~/pfs/SIMS $ constructBias.py 20181213 --calib 20181213/CALIB --rerun bias --cores 3 --job bias --id field=BIAS
lsst@824ef520e03f:~/pfs/SIMS $ ingestCalibs.py 20181213 --calib 20181213/CALIB --validity 3000 20181213/rerun/bias/BIAS/pfsBias-2018-12-13-0-r1.fits

lsst@824ef520e03f:~/pfs/SIMS $ constructDark.py 20181213 --calib 20181213/CALIB --rerun dark --cores 3 --job dark --id field=DARK
lsst@824ef520e03f:~/pfs/SIMS $ ingestCalibs.py 20181213 --calib 20181213/CALIB --validity 3000 20181213/rerun/dark/DARK/pfsDark-2018-12-13-0-r1.fits

lsst@824ef520e03f:~/pfs/SIMS $ ingestCalibs.py 20181213 --calib 20181213/CALIB --validity 3000 $OBS_PFS_DIR/pfs/camera/pfsDetectorMap-005833-r1.fits --mode=link

lsst@824ef520e03f:~/pfs/SIMS $ constructFiberFlat.py 20181213 --calib 20181213/CALIB --rerun flat --cores 3 --job flat --id field=FLAT
lsst@824ef520e03f:~/pfs/SIMS $ ingestCalibs.py 20181213 --calib 20181213/CALIB --validity 3000 20181213/rerun/flat/FLAT/pfsFiberFlat-2018-12-13-000020-r1.fits

lsst@824ef520e03f:~/pfs/SIMS $ constructFiberTrace.py 20181213 --calib 20181213/CALIB --rerun fiberTrace --cores 1 --job fiberTrace --id visit=21
lsst@824ef520e03f:~/pfs/SIMS $ ingestCalibs.py 20181213 --calib 20181213/CALIB --validity 3000 20181213/rerun/fiberTrace/FIBERTRACE/pfsFiberTrace-2018-12-13-000021-r1.fits

lsst@824ef520e03f:~/pfs/SIMS $ reduceArc.py 20181213 --calib=20181213/CALIB/ --rerun arc --id field=ARC
lsst@824ef520e03f:~/pfs/SIMS $ reduceExposure.py 20181213 --calib 20181213/CALIB --rerun exp --id field=OBJECT
Comment by price [ 18/Dec/18 ]

So now I have a pfsArm file from the 1D simulator, and a pfsArm file from the 2D simulator+pipeline, so I can compare them.
The flux values from the 1D simulator are in 1e-17 erg/s/cm2/A (per Kiyoto Yabe), so I've multiplied it by 200 so I can plot it on the same graph as the flux from the 2D simulator+pipeline.
In the attached plot, red is the 1D simulator (fluxes scaled) and blue is the 2D simulator+pipeline. The agreement isn't bad (I was surprised they are as close as they are!), except at the edges, where the flux from the 1D simulator (and the noise) goes up, while the flux from the 2D simulator+pipeline goes down (the latter makes sense: there should be no flux at the ends because of the dichroics).

Comment by price [ 18/Dec/18 ]

The remaining thing to do is to review and merge the changes. cloomis, would you please have a look at the changes in drp_instmodel and drp_stella?

Comment by price [ 30/Jan/19 ]

Merged with PIPE2D-310.

Comment by price [ 27/Apr/19 ]

Merged the changes to spt_ExposureTimeCalculator today after discovering they hadn't been merged previously.

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