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

Number of detectors per tube #15

Open
zonca opened this issue Jul 1, 2020 · 18 comments
Open

Number of detectors per tube #15

zonca opened this issue Jul 1, 2020 · 18 comments

Comments

@zonca
Copy link
Member

zonca commented Jul 1, 2020

Sorry, I can't find the number of detectors per tube either, can you please point me to those?

@smsimon
Copy link
Contributor

smsimon commented Jul 1, 2020

It is in the instrument design file here: https://docs.google.com/spreadsheets/d/1X0x8wYhjHdI_WPjhgbtyVlVQrX86tTgxgqEUhan2Hxg/edit?usp=sharing

You'll want to go to the 19 tube LAT tabs and the SAT tab. There is a field for detectors per optics tube in each.

@zonca
Copy link
Member Author

zonca commented Jul 1, 2020

can I link that spreadsheet in the README of this repository? so I can find it more easily in the future

@smsimon
Copy link
Contributor

smsimon commented Jul 1, 2020

Yes, absolutely

@zonca
Copy link
Member Author

zonca commented Jul 1, 2020

ok thanks

@zonca zonca closed this as completed Jul 1, 2020
zonca added a commit that referenced this issue Jul 1, 2020
@zonca
Copy link
Member Author

zonca commented Jul 2, 2020

@keskitalo how did you get the number of detectors into the TOAST simulations? have you extracted them from the spreadsheet and pasted into the TOAST config files?
Wouldn't it be better to have them available in a package?

@zonca zonca reopened this Jul 2, 2020
@keskitalo
Copy link
Member

The detector counts are encoded in the default hardware map in s4sims.

@zonca
Copy link
Member Author

zonca commented Jul 2, 2020

how do I extract those? I tried grepping and looking around but cannot find them

@smsimon
Copy link
Contributor

smsimon commented Jul 2, 2020

@zonca It is not trivial to get them from the instrument configuration files. https://github.com/CMB-S4/s4sim/blob/master/s4sim/hardware/config.py has the number of pixels per wafer (x2 to get the number of pixels at a given frequency). But the wafer numbers include partial wafers so you can't just multiply the detector/wafer by the number of wafers (and you'd need to know what type of partial wafer). I calculated all the detector numbers based on the layouts and the pBD spreadsheet was updated to reflect those values, so they're consistent and you should feel free to use the pBD spreadsheet if that is simpler.

@keskitalo
Copy link
Member

You can always simulate the focalplane:

from collections import OrderedDict

import s4sim.hardware as hardware


for telescope in "LAT0", "LAT1", "LAT2", "SAT0", "SAT1", "SAT2", "SAT3", "SAT4", "SAT5":
    print("{}".format(telescope))
    hw = hardware.get_example()
    hw.data["detectors"] = hardware.sim_telescope_detectors(hw, telescope)
    counts = OrderedDict()
    for band in hw.data["bands"]:
        counts[band] = 0
    for det_data in hw.data["detectors"].values():
        counts[det_data["band"]] += 1
    for key, value in counts.items():
        if value > 0:
            print(" - {:6} {:8}".format(key, value))

Will print

LAT0
 - LFL1        768
 - LFL2        768
 - MFL1      41472
 - MFL2      41472
 - HFL1      17280
 - HFL2      17280
LAT1
 - LFL1        768
 - LFL2        768
 - MFL1      41472
 - MFL2      41472
 - HFL1      17280
 - HFL2      17280
LAT2
 - ULFPL1      216
 - LFPL1       768
 - LFPL2       768
 - MFPL1     41472
 - MFPL2     41472
 - HFPL1     13824
 - HFPL2     13824
SAT0
 - MFLS1     10668
 - MFLS2     10668
SAT1
 - MFLS1     10668
 - MFLS2     10668
SAT2
 - MFHS1     10668
 - MFHS2     10668
SAT3
 - MFHS1     10668
 - MFHS2     10668
SAT4
 - HFS1      25782
 - HFS2      25782
SAT5
 - LFS1        592
 - LFS2        592
 - HFS1       8594
 - HFS2       8594

@zonca
Copy link
Member Author

zonca commented Jul 3, 2020

ok, let me just copy paste from the pDB.

I added this to the rest of information I pull out from s4sim.

then I dump everything into a CSV so I have a place to quickly cross-check everything, it would be nice to instead just have such a simple format to start from.
https://github.com/CMB-S4/s4mapbasedsims/blob/master/202006_foregrounds_extragalactic_cmb_tophat/cmbs4_tophat.csv

@zonca zonca closed this as completed Jul 3, 2020
@jdborrill
Copy link

jdborrill commented Jul 3, 2020 via email

@zonca
Copy link
Member Author

zonca commented Jul 3, 2020

I think we could start from the pDB, reformat it to make more machine readable.
Then write a tool that just dumps a CSV from that programmatically and then commit that to a repository, so it's versioned robustly.

@jdborrill
Copy link

jdborrill commented Jul 3, 2020 via email

@zonca
Copy link
Member Author

zonca commented Feb 10, 2021

@smsimon also for the new release I need the number of detectors per tube, is there an easier way to get this information now?
would it be possible to add it to hardware/config.py?

@zonca zonca reopened this Feb 10, 2021
@smsimon
Copy link
Contributor

smsimon commented Feb 10, 2021

We can add this as an item to implement in the next iteration.

The LAT tubes all only have one wafer, so the number of detectors per frequency band is the number of pixels/wafer*2. The pixel/wafer numbers are in lines 600-610 in config.py, so you just need to multiply those by 2.

For the SATs, you can use https://docs.google.com/spreadsheets/d/1X0x8wYhjHdI_WPjhgbtyVlVQrX86tTgxgqEUhan2Hxg/edit?usp=sharing. Line 46 has the number of detectors per optics tube per band.

@zonca
Copy link
Member Author

zonca commented Feb 10, 2021

ok, I exported the instrument model to a text file, can you plase doublecheck I got the right number of detectors per tube? https://github.com/CMB-S4/s4mapbasedsims/blob/6dadbf44e7afa34b1397bc048f4e512e396cf267/202102_design_tool_run/instrument_model/cmbs4_instrument_model.tbl

@smsimon
Copy link
Contributor

smsimon commented Feb 10, 2021

Those are the correct number of detectors per tube though the Pole LAT fwhm will need to be updated with the new values (now committed in 85-tube_LAT branch)

@zonca
Copy link
Member Author

zonca commented Feb 10, 2021

ok, I am going to leave this issue open to remind that for next release it would be nice to have the number of detectors per tube written into the instrument model.

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

4 participants