コード例 #1
0
ファイル: simulation.py プロジェクト: nicocardiel/megaradrp
def create_mos():
    _logger.info('create MOS')
    layouttable = np.loadtxt('v03/MOS_spaxel_centers.txt')
    # Create fiber bundles and light fibers

    fiberset = FiberSet(name='MOS', size=0.31 * u.arcsec, fwhm=3.6)
    # FIXME: a trans object per fiber is very slow
    trans = EfficiencyFile('v03/tfiber_0.1aa_20m.dat')
    for line in layouttable:
        idx =  int(line[3])
        if idx not in fiberset.bundles:
            name = 'FiberBundle_{}'.format(idx)
            fiberset.bundles[idx] = FiberBundle(name, bid=idx, static=False)
        fibid = int(line[4])
        name = 'LightFiber_{}'.format(fibid)

        lf = LightFiber(name, fibid, transmission=trans)
        fiberset.bundles[idx].add_light_fiber(lf)
        fiberset.fibers[fibid] = lf

    # Center of bundles
    fiber_mos = FiberMOS('MOS', fiberset)
    for line in layouttable[3::7]:
        idx =  int(line[3])
        name = 'RoboticPositioner_{}'.format(idx)
        rb = RoboticPositioner(name, id=idx, pos=(line[0], line[1], 0.0), parent=fiber_mos)
        rb.connect_bundle(fiberset.bundles[idx])

    pseudo_slit_mos = PseudoSlit(name="MOS", insmode='MOS')
    pseudo_slit_mos.connect_fibers(fiberset, layouttable[:, 2])

    return fiber_mos, pseudo_slit_mos
コード例 #2
0
ファイル: simulation.py プロジェクト: nicocardiel/megaradrp
def create_lcb():
    _logger.info('create LCB')
    layouttable = np.loadtxt('v03/LCB_spaxel_centers.txt')

    fiberset = FiberSet(name='LCB', size=0.31 * u.arcsec, fwhm=3.6)
    # FIXME: a trans object per fiber is very slow
    trans = EfficiencyFile('v03/tfiber_0.1aa_20m.dat')
    for line in layouttable:
        idx =  int(line[3])
        if idx not in fiberset.bundles:
            name = 'FiberBundle_{}'.format(idx)
            fiberset.bundles[idx] = FiberBundle(name, bid=idx)
        fibid = int(line[4])
        name = 'LightFiber_{}'.format(fibid)

        lf = LightFiber(name, fibid, transmission=trans)
        fiberset.bundles[idx].add_light_fiber(lf)
        fiberset.fibers[fibid] = lf

    lcb_pos = {}
    for line in layouttable:
        idx =  int(line[4])
        lcb_pos[idx] = (line[0], line[1])
    lcb = LargeCompactBundle('LCB', fiberset, lcb_pos)

    pseudo_slit_lcb = PseudoSlit(name="LCB", insmode='LCB')
    pseudo_slit_lcb.connect_fibers(fiberset, layouttable[:,2])

    return lcb, pseudo_slit_lcb