emirdrp.instrument
— Static configuration
- emirdrp.instrument.channels.braid(*iterables)
Return the elements of each iterator in turn until some is exhausted. This function is similar to the roundrobin example in itertools documentation. >>> a = iter([1,2,3,4]) >>> b = iter([‘a’, ‘b’]) >>> c = iter([1,1,1,1,’a’, ‘c’]) >>> d = iter([1,1,1,1,1,1]) >>> list(braid(a, b, c, d)) [1, ‘a’, 1, 1, 2, ‘b’, 1, 1]
- emirdrp.instrument.channels.convert_name_to_channels(conf)
- class emirdrp.instrument.csu_configuration.CsuConfiguration
Configurable Slit Unit (CSU) Configuration class definition.
- _csu_bar_left
Location (mm) of the left bar for each slitlet.
- Type:
list of floats
- _csu_bar_right
Location (mm) of the right bar for each slitlet, using the same origin employed for _csu_bar_left (which is not the value stored in the FITS keywords.
- Type:
list of floats
- _csu_bar_slit_center
Middle point (mm) in between the two bars defining a slitlet.
- Type:
list of floats
- _csu_bar_slit_width
Slitlet width (mm), computed as the distance between the two bars defining the slitlet.
- Type:
list of floats
- csu_bar_left(islitlet)
Return csu_bar_left for requested slitlet number.
- csu_bar_right(islitlet)
Return csu_bar_right for requested slitlet number.
- csu_bar_slit_center(islitlet)
Return csu_bar_slit_center for requested slitlet number.
- csu_bar_slit_width(islitlet)
Return csu_bar_slit_width for requested slitlet number.
- classmethod define_from_fits(fitsobj, extnum=None)
Define class members from header information in FITS file.
- Parameters:
fitsobj (file object) – FITS file whose header contains the CSU bar information needed to initialise the members of this class.
extnum (None or int or str) – Extension number or extension name. If None, select ‘MECS’ extension if available. If not, use priamry extension
- classmethod define_from_header(image_header)
Define class members directly from FITS header.
- Parameters:
image_header (instance of hdulist.header) – Header content from a FITS file.
- display_pseudo_longslits(list_valid_slitlets=None, fracwidth=0.25, diffcenter=0.25)
- outdict(ndigits=3)
Return dictionary structure rounded to a given precision.
- pseudo_longslits(list_valid_slitlets=None, fracwidth=0.25, diffcenter=0.25)
Return dictionary of LongSlit instances
- Parameters:
list_valid_slitlets (list of integers or 'all') – List containing valid slitlets. Slitlet numbers not included in this list will be considered as individual longslits. If this list is None, all the slitlets are analysed.
fracwidth (float) – Maximum fractional slitlet width difference allowed to consider that two slitlets belong to the same longslit.
diffcenter (float) – Maximum allowed difference between slitlet centers (in units of the averaged slitlet widths).
- Returns:
result – Each LongSlit object provides the minimum and maximum islitlet for each longslit.
- Return type:
dictionary of LongSlit instances
- widths_in_range_mm(minwidth=0.0, maxwidth=1000.0)
Return list of slitlets which width is within given range
- Parameters:
minwidth (float) – Minimum slit width (mm).
maxwidth (float) – Maximum slit width (mm).
- Returns:
list_ok – List of booleans indicating whether the corresponding slitlet width is within range
- Return type:
list
- class emirdrp.instrument.csu_configuration.LongSlit(imin=None, imax=None)
Auxiliary class to store the minimum and maximum islitlet
- imax()
- imin()
- emirdrp.instrument.csu_configuration.merge_odd_even_csu_configurations(conf_odd, conf_even)
Merge CSU configuration using odd- and even-numbered values.
The CSU returned CSU configuration include the odd-numbered values from ‘conf_odd’ and the even-numbered values from ‘conf_even’.
- Parameters:
conf_odd (CsuConfiguration instance) – CSU configuration corresponding to odd-numbered slitlets.
conf_even (CsuConfiguration instance) – CSU configuration corresponding to even-numbered slitlets.
- Returns:
merged_conf – CSU configuration resulting from the merging process.
- Return type:
CsuConfiguration instance
- emirdrp.instrument.distortions.adapt_wcs(wcs, rotang_deg, ipa_deg)
Adapt WCS to use in distortions
- emirdrp.instrument.distortions.exvp(pos_x, pos_y)
Convert virtual pixel to real pixel
This function is deprecated, use wcs_exvp instead
- emirdrp.instrument.distortions.pix2virt(pos, origin=1)
This function is deprecated, use wcs_pix2virt instead
- emirdrp.instrument.distortions.pvex(pos_x, pos_y)
Convert real pixel to virtual pixel
This function is deprecated, use wcs_pvex instead
- emirdrp.instrument.distortions.wcs_exvp(wcs, xv, yv)
Convert virtual pixel to real pixel
- emirdrp.instrument.distortions.wcs_pix2virt(wcs, pos, origin=1)
- emirdrp.instrument.distortions.wcs_pvex(wcs, xr, yr)
Convert real pixel to virtual pixel