Parse and manipulation of the IFU center files with the following structure
# HETDEX IFU description file
# $Id: IFUcen_HETDEX.txt 789 2012-08-17 19:52:17Z mxhf $
#
# IFU 00001
#
# Test date: YYYYMMDD
# Total number of dead fibers (T < X %):
#
#
# history
# date author change
# -------------------------
# 20110702 mF created
#
#
# FIBERD FIBERSEP
1.55 2.20
# NFIBX NFIBY
20 23
#
# col 1: fiber ID, starts with 1, IDs 1-246 belong to left unit, 247-492 belong to right unit
# col 2: fiber x position ["]
# col 3: fiber y position ["]
# col 4: target unit spectrograph L=left, R=right
# col 5: target fiber within the spectrograph, fiber numbers start with 1 within each spectrograph
# col 6: relative throughput at fiducial wavelength
#
0001 -19.8000 -19.6876 L 0001 1.000
0002 -17.6000 -19.6876 L 0002 1.000
[...]
0447 17.6000 19.6876 R 0223 1.000
0448 19.8000 19.6876 R 0224 1.000
From the header the FIBERD, FIBERSEP, NFIBX and NFIBY are extracted. The rest of the file is parsed as follow:
the number of L or R are counted;
channels as keys;
it starts with #;
integer (e.g. nan, --);
IFUCenterError is raised as such a fiber should be ignored.
Exception raised when the IFU center file parsing fails
Parse the IFU center file
Parameters: | ifu_center_file : string
|
---|---|
Raises: | IFUCenterError
|
Attributes
filename | (string) name of the IFU center file |
fiber_d | (float) fiber diameter |
fiber_sep | (float) fiber separation |
nfibx, nfiby | (int) number of fibers in the x and y directions |
xifu, yifu | (dictionary of lists) fibers x and y positions per channel |
n_fibers | (dictionary of int) number of fibers per channel |
fib_number | (dictionary of lists) fiber number corresponding to positions xifu, yifu per channel |
throughput | (dictionary of lists) throughput corresponding to positions xifu, yifu per channel |
Parameters: | f : file object
|
---|---|
Returns: | f : file object
|
Read the ifu center file
Parameters: | ifu_center_file : string
|
---|