gfa_wcs

Overview

WCS paramaters fit to a GFA image.

Creators

  • PlateMaker external interface
  • PlateMaker internals
    • gfaWcsJob

Users

This list is not promised to be comprehensive.

Contents

Table columns

# name type units description
1 Petal integer   PETAL_ID from DESI docdb-2724
2 CRVAL1 float degrees as per FITS WCS standard
3 CRVAL2 float degrees as per FITS WCS standard
4 CRPIX1 float pixels as per FITS WCS standard
5 CRPIX2 float pixels as per FITS WCS standard
6 CD1_1 float   as per FITS WCS standard
7 CD1_2 float   as per FITS WCS standard
8 CD2_1 float   as per FITS WCS standard
9 CD2_2 float   as per FITS WCS standard

Storage and access

Through DOS

After gfaproc is run for a sequence, the get PML command may be used retrieve the gfa_wcs data from PlateMaker.

First, a PML connection must be established:

>>> from DOSlib.PML import dos_connection
>>> pm = dos_connection('PLATEMAKER')
>>> pm.execute('configure')
'SUCCESS'

The gfa_wcs data is normally calculated by PlateMaker when gfaproc is called. So, load some sample input for it, and run gfaproc:

>>> from PlateMaker import test_data
>>> nfsdata = test_data.nfs_data
>>> gfa_images = test_data.gfa_images
>>> stdstars = test_data.stdstars
>>> pm.execute('set', instrument=test_data.inst_name)
'SUCCESS'
>>> pm.execute('set', seqid=test_data.seq_id)
'SUCCESS'
>>> pm.execute('set', nfsdata=nfsdata)
'SUCCESS'
>>> pm.execute('set', gfa_images=gfa_images, stdstars=stdstars)
'SUCCESS'
>>> pm.execute('gfaproc')
'SUCCESS'

Now we can retrieve gfa_wcs from PlateMaker, which it will return in the form of numpy.recarray.

>>> gfa_wcs = pm.execute('get', 'gfa_wcs')
>>> gfa_wcs.shape
(6,)
>>> gfa_wcs.dtype
dtype((numpy.record, [('PETAL', '<i8'), ('CRVAL1', '<f8'), ('CRVAL2', '<f8'), ('CRPIX1', '<f8'), ('CRPIX2', '<f8'), ('CD1_1', '<f8'), ('CD1_2', '<f8'), ('CD2_1', '<f8'), ('CD2_2', '<f8')]))

Then we can also send values for gfa_wcs to PlateMaker (never really a useful thing to do):

>>> pm.execute('set', gfa_wcs=gfa_wcs)
'SUCCESS'

Preferred file representation

Name template:wcs-gfa-{PLATE_ID}.{CONFIG_ID}.dat
Format:whitespace delimited ASCII text

Example file contents

::
>>> from PlateMaker import test_data
>>> fname = test_data.data_dir + '/wcs-gfa-52254.4.dat'
>>> print(open(fname,'r').readline())
#PETAL CRVAL1 CRVAL2 CRPIX1 CRPIX2 CD1_1 CD1_2 CD2_1 CD2_2

>>> print(open(fname, 'r').read()) 
#PETAL CRVAL1 CRVAL2 CRPIX1 CRPIX2 CD1_1 CD1_2 CD2_1 CD2_2
0 178.6560 10.8556 1024.5 512.5 -3.2303e-05 -4.5616e-05 -4.9672e-05 2.9655e-05
2 180.4168 11.5202 1024.5 512.5 -5.7201e-05 1.4115e-05 1.5355e-05 5.2537e-05
4 181.5969 10.0779 1024.5 512.5 -3.0602e-06 5.4327e-05 5.9144e-05 2.8219e-06
5 181.3368 9.1393 1024.5 512.5 3.2295e-05 4.5608e-05 4.9661e-05 -2.9650e-05
7 179.5871 8.4788 1024.5 512.5 5.7226e-05 -1.4120e-05 -1.5362e-05 -5.2554e-05
9 178.4033 9.9146 1024.5 512.5 3.0618e-06 -5.4347e-05 -5.9174e-05 -2.8230e-06