-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplot_eorspec_fp.py
38 lines (32 loc) · 1.2 KB
/
plot_eorspec_fp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
This script reads detector data from an HDF5 file into an astropy QTable,
initializes a Focalplane object with specific parameters such as sample rate
and field of view, and then plots the focal plane using the
plot_focalplane_eorspec function. The purpose of this script is to visualize the
arrangement of detectors in the focal plane based on the provided data.
"""
from astropy.table import QTable
from plotting_func import plot_focalplane_eorspec
from toast.instrument import Focalplane
import matplotlib.pyplot as plt
import astropy.units as u
# Read the Astropy Qtable from the HDF5 file
# hf_fulltable_file = './test_dir/eorspec_dettable.h5'
hf_fulltable_file = './eorspec_dettable.h5'
# QTable includes the Quantities as well
dettable_stack = QTable.read(hf_fulltable_file, path='dettable_stack')
#print(dettable_stack[:10])
sample_rate = 244 * u.Hz
width= 1.3 * u.degree
fp_test = Focalplane(
detector_data=dettable_stack,
sample_rate=sample_rate,
field_of_view=1.1 * width,
)
plot_focalplane_eorspec(
focalplane=fp_test,
width=width,
height=width,
show_labels=False,
outfile="test_dir/fp_eorspec_rot2_2024_v4.pdf")
plt.show()