In [1]:
# imports
from desispec import io
from desispec.io import zfind as io_zfind
from desispec.io.qa import load_qa_brick, write_qa_brick
from desispec.qa import qa_plots as qap
In [2]:
zb_file = '/Users/xavier/DESI/TST/dogwood/bricks/3587p000/zbest-3587p000.fits'
In [3]:
zbest = io_zfind.read_zbest(zb_file)
zbest.nspec
Out[3]:
In [4]:
# bricks
brick = {}
bb_file = '/Users/xavier/DESI/TST/dogwood/bricks/3587p000/brick-b-3587p000.fits'
br_file = '/Users/xavier/DESI/TST/dogwood/bricks/3587p000/brick-r-3587p000.fits'
bz_file = '/Users/xavier/DESI/TST/dogwood/bricks/3587p000/brick-z-3587p000.fits'
brick['b'] = io.Brick(bb_file)
brick['r'] = io.Brick(br_file)
brick['z'] = io.Brick(bz_file)
In [5]:
qafile = '/Users/xavier/DESI/TST/dogwood/bricks/3587p000/qa_3587p000.yaml'
In [6]:
qabrick = load_qa_brick(qafile)
qabrick
Out[6]:
In [7]:
qabrick.run_qa('ZBEST', (zbest,brick))
In [8]:
qabrick.data
Out[8]:
In [9]:
# Write
write_qa_brick(qafile, qabrick)
Out[9]:
In [10]:
qafig = '/Users/xavier/DESI/TST/dogwood/bricks/3587p000/qa-zbest_3587p000.pdf'
In [11]:
reload(qap)
qap.brick_zbest(qafig, zbest, qabrick)
In [ ]: