-
Notifications
You must be signed in to change notification settings - Fork 15
Full focal plane infrastructure #495
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
Merged
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
9818ff7
Machinery to write photons outside image bounds as extra output to FITS.
welucas2 9152ec5
Put scattered photons in focal plane coords.
welucas2 2937c80
First partial attempt at reading in the photons from file.
welucas2 eaf79d3
Working scattered photon input
welucas2 43840a9
Initial full working pipeline
welucas2 12db575
Full focal plane tests
welucas2 06ca377
Move gathering of scattered photons into new function in photon_scatt…
welucas2 ed76d3e
Initial go at code to find a science detectors neighbours as part of …
welucas2 cb00410
Make references to 'scattered' photons 'off-detector' photons instead…
welucas2 582c76d
Rename photon_scattering.py to full_focal_plane.py
welucas2 32e57c1
Changes to variable names in get_adjacent_detectors()
welucas2 b981791
Move off detector photons from photon pooling config to FFP pass 1 ex…
welucas2 9062a75
Doing some horrible initial experimentation in instcat.py.
welucas2 c205bd9
Make the fiducial WCS a component of the instcat in the YAML config.
welucas2 536f5aa
Big improvements to the instcat multi detector object handling. And i…
welucas2 95499b1
First go at getting skyCatalog interface to accept/reject objects by …
welucas2 b1d9bf8
Add example_instance_catalog_ffp.txt
welucas2 63dbf79
Add the fiducial WCS to imsim-config-skycat.yaml.
welucas2 2678932
First attempt at logic to filter out objects closer to other dets in …
welucas2 b050370
keep track of objects to skip instead of trying to use an iterator pr…
jchiang87 bfcb934
include f-string prefix
jchiang87 36605bd
don't run AddNoise for pass 2 rendering
jchiang87 b6fe71c
Config now keys off-detector photons to det_num/name.
welucas2 c1466fd
Fix test_trimmer.py to set edge_pix=100, the old default, to keep a t…
welucas2 7a365be
New input.instance_catalog.full_focal_plane enables and disables FFP.
welucas2 b78dfc6
Have test_image_nobjects set edge_pix=100 as the new default of 200 (…
welucas2 75cd062
Calculate fiducial WCS before image WCS in order to correctly store _…
welucas2 68b36b5
Add full_focal_plane parameter to skycat and ensure correct _icrf_to_…
welucas2 5f8d821
Allow off_detector_photons to be read from multiple files.
welucas2 85272cf
Update tests to use LsstCamSim.
welucas2 0292416
Fix edge_pix values used in test_stamp.py to old value of 100.
welucas2 5342e86
Add tests for off-detector photon loader.
welucas2 3dee97b
New test for LSST_FocalPlaneImage.
welucas2 d1c740b
Rework off-detector photons input to lazily read photons and also all…
welucas2 e5b5134
Minor tidying up in the second pass example config.
welucas2 f8baa87
Add files in tests/data for new full focal plane tests.
welucas2 864dbc6
remove off-detector photons as they are read in for pass2; provide mo…
jchiang87 6058854
set image.sky_level and output.cosmic_ray_rate to zero for pass2 sinc…
jchiang87 4da5a4f
Update imsim/skycat.py
jchiang87 0dbd470
use a template based on image.wcs for the fiducial_wcs
jchiang87 a0d0dcf
use a glob pattern to find off-detector photon files
jchiang87 a2eacde
ensure there is only one photon_array in self.final_data
jchiang87 251ede4
raise an exception of .writeHdu is called
jchiang87 2becaea
use GetInputObj instead of accessing config['_input_objs'] directly
jchiang87 593ca5f
set input.instance_catalog.full_focal_plane to True; disable checkpoi…
jchiang87 0223c1f
remove the .photons setter
jchiang87 3c08040
remove non-linear distortions from fiducial wcs
jchiang87 6d0e6dd
add check that full_focal_plane for instcat and skycat is set consist…
jchiang87 e949c0d
simplify the argument to sorted
jchiang87 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| rightascension 60.49045502638662697 | ||
| declination -38.16437495898705379 | ||
| mjd 60143.42156961110595148 | ||
| altitude 53.16185928082865786 | ||
| azimuth 114.38574818197552929 | ||
| filter 2 | ||
| rotskypos 131.23506207988341998 | ||
| dist2moon 88.2886136 | ||
| moonalt -28.7317781 | ||
| moondec 24.6999775 | ||
| moonphase 0.5804871 | ||
| moonra 127.0562204 | ||
| nsnap 1 | ||
| obshistid 398414 | ||
| rottelpos 40.0386345 | ||
| seed 398414 | ||
| seeing 0.7501810 | ||
| sunalt -19.2243392 | ||
| vistime 30.0000000 | ||
| seqnum 0 | ||
| object 32166149840900 60.5808675 -38.07410111 13.8487927 starSED/phoSimMLT/lte035-4.5-1.0a+0.4.BT-Settl.spec.gz 0 0 0 0 0 0 point none CCM 0.0112685 3.1 | ||
| object 32166139536388 60.55213375 -38.04768278 13.2693929 starSED/phoSimMLT/lte035-4.5-1.0a+0.4.BT-Settl.spec.gz 0 0 0 0 0 0 point none CCM 0.01014165 3.1 | ||
| object 32166139536388 60.55989542 -38.038889 13.2693929 starSED/phoSimMLT/lte035-4.5-1.0a+0.4.BT-Settl.spec.gz 0 0 0 0 0 0 point none CCM 0.01014165 3.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Use imSim custom modules | ||
| modules: | ||
| - imsim | ||
|
|
||
| # Get most of the configuration from the imSim config-template | ||
| # for instance catalogs. | ||
| template: imsim-config-instcat | ||
|
|
||
| ################################################################ | ||
| # Make your changes below. | ||
| ################################################################ | ||
|
|
||
| # Put your own commands that override the defaults below here. For example | ||
| # input.instance_catalog.file_name: ./imsim_cat_197356.txt | ||
| # input.instance_catalog.sort_mag: False | ||
| # input.tree_rings.only_dets: [R22_S11] | ||
| # image.nobjects: 5 | ||
|
|
||
| input.checkpoint: "" | ||
| input.instance_catalog.file_name: $os.environ.get('IMSIM_HOME')+'/imSim/examples/example_instance_catalog_ffp.txt' | ||
| input.instance_catalog.full_focal_plane: True | ||
| input.instance_catalog.sort_mag: False | ||
|
|
||
| # For now, disable tree rings to make the diffraction spikes | ||
| # easier to see in the images. | ||
| input.tree_rings: "" | ||
| image.sensor.treering_center: "" | ||
| image.sensor.treering_func: "" | ||
|
|
||
| input.atm_psf: "" | ||
| psf: | ||
| type: Convolve | ||
| items: | ||
| - | ||
| type: Gaussian | ||
| fwhm: 0.3 | ||
|
|
||
| image.nobjects: 10 | ||
|
|
||
| stamp.fft_sb_thresh: 1.e30 | ||
|
|
||
| output.det_num.first: 94 | ||
| output.nfiles: 2 | ||
| output.nproc: 1 | ||
|
|
||
| output.dir: output | ||
|
|
||
| # Disable writing amp* files for pass1. | ||
| output.readout: "" | ||
|
|
||
| output.off_detector_photons: | ||
| dir: output | ||
| file_name: | ||
| type: FormattedStr | ||
| format : off_det_%08d-%1d-%s-%s-det%03d.fits | ||
| items: | ||
| - { type: OpsimData, field: observationId } | ||
| - { type: OpsimData, field: snap } | ||
| - $band | ||
| - $det_name | ||
| - "@output.det_num" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # Use imSim custom modules | ||
| modules: | ||
| - imsim | ||
|
|
||
| # Get most of the configuration from the imSim config-template | ||
| # for instance catalogs. | ||
| template: imsim-config-instcat | ||
|
|
||
| ################################################################ | ||
| # Make your changes below. | ||
| ################################################################ | ||
|
|
||
| input.checkpoint: "" | ||
| # input.instance_catalog: "" | ||
| input.instance_catalog.file_name: $os.environ.get('IMSIM_HOME')+'/imSim/examples/example_instance_catalog_ffp.txt' | ||
| input.instance_catalog.sort_mag: False | ||
| # input.opsim_data: "" | ||
|
|
||
| input.tree_rings: "" | ||
| input.atm_psf: "" | ||
|
|
||
| # In the second pass, we add off-detector photons to the image generated in the | ||
| # first pass from the the on-detector photons. Give the image here. | ||
| input.initial_image: | ||
| dir: output | ||
| file_name: | ||
| type: FormattedStr | ||
| format : eimage_%08d-%1d-%s-%s-det%03d.fits | ||
| items: | ||
| - { type: OpsimData, field: observationId } | ||
| - { type: OpsimData, field: snap } | ||
| - $band | ||
| - $det_name | ||
| - "@output.det_num" | ||
|
|
||
| # Two methods can be used to read files containing off-detector photons. If a | ||
| # single file only is to be read, then give the file_name. Alternatively, we can | ||
| # give a file_pattern containing the fields DETNAME and DETNUM, which are | ||
| # wildcards for the detector name and number in an expected set of files | ||
| # matching the pattern. The loader will then attempt to read from all files it | ||
| # finds matching this patter, excluding the file with the same name/num as the | ||
| # current detector. | ||
| input.off_detector_photons: | ||
| dir: output | ||
| file_name: | ||
| type: FormattedStr | ||
| format: off_det_%08d-%1d-%s-*-det*.fits | ||
| items: | ||
| - { type: OpsimData, field: observationId } | ||
| - { type: OpsimData, field: snap } | ||
| - $band | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A maybe simpler API would be to just have |
||
| camera: $camera | ||
| det_name: $det_name | ||
|
|
||
| psf: | ||
| type: Convolve | ||
| items: | ||
| - | ||
| type: Gaussian | ||
| fwhm: 0.3 | ||
|
|
||
| stamp: "" | ||
|
|
||
| image.type: LSST_FocalPlaneImage | ||
| image.sensor.treering_center: "" | ||
| image.sensor.treering_func: "" | ||
| image.sky_level: 0 | ||
|
|
||
| output.det_num.first: 95 | ||
| output.nfiles: 1 | ||
| output.file_name.format: "eimage_full_focal_%08d-%1d-%s-%s-det%03d.fits" | ||
| output.cosmic_ray_rate: 0.0 | ||
|
|
||
| output.dir: output | ||
|
jchiang87 marked this conversation as resolved.
|
||
| output.photon_pooling_truth: "" # Disable to avoid overwriting pass1 files. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.