This notebook shows (1) how to use ztfquery to obtain the corners of the ZTF quadrants needed to interpret the observation_library for sim_survey. To run this notebook, you will need to have ztfquery installed and setup (2) How to use these in a simulation.


In [1]:
from ztfquery import ccd
df = ccd.CCDQUADLAYOUT
df.rename(columns=dict(Quad='rcid', CCD='ccd'), inplace=True)
df.ccd = df.ccd -1
df.rcid = df.rcid + 1
df.ccd.unique()


Out[1]:
array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15])

In [2]:
df = df[['EW', 'NS', 'rcid']].rename(columns=dict(rcid='CCD'))

In [3]:
df.head()


Out[3]:
EW NS CCD
0 2.781842 -2.866617 1
1 2.782178 -2.003445 1
2 3.645452 -2.001932 1
3 3.645011 -2.865003 1
4 1.918673 -2.868231 2

In [4]:
df.CCD.unique()


Out[4]:
array([ 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, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
       52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64])

This was used to create the file containing the corners.

df.to_csv('data/ZTF_corners_rcid.txt', index=False)

In order to use these corner files, do:


In [5]:
from simsurvey_tools import load_ztf_ccds

In [6]:
len(load_ztf_ccds(filename='data/ZTF_corners_rcid.txt', num_segs=64))


Out[6]:
64

In [7]:
# But really these are ccd quadrants
ccds = load_ztf_ccds(filename='data/ZTF_corners_rcid.txt', num_segs=64)