nfs_wcs

Overview

First estimate of WCS paramaters for a field.

Creators

  • PlateMaker external interface
  • PlateMaker internals
    • nfsWcsJob

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 nfsproc is run for a sequence, the get PML command may be used retrieve the nfs_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 nfs_wcs data is normally calculated by PlateMaker when fidproc is called. So, load some sample input for it, and run nfsproc:

>>> from PlateMaker import test_data
>>> targets = test_data.targets
>>> fiducial_pos = test_data.fiducial_pos
>>> fvcspots = test_data.initial_merged_fvc_spots
>>> pm.execute('set', seqid=test_data.seq_id)
'SUCCESS'
>>> pm.execute('set', targets=targets)
'SUCCESS'
>>> pm.execute('set', fiducial_pos=fiducial_pos)
'SUCCESS'
>>> pm.execute('set', merged_fvc_spots=fvcspots)
'SUCCESS'
>>> pm.execute('fidproc')
'SUCCESS'

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

>>> nfs_wcs = pm.execute('get', 'nfs_wcs')
>>> nfs_wcs.shape
(10,)
>>> nfs_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 nfs_wcs to PlateMaker (never really a useful thing to do):

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

Preferred file representation

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

Example file contents

::
>>> from PlateMaker import test_data
>>> fname = test_data.data_dir + '/wcs-nfs-52254.3.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.2301e-05 -4.5615e-05 -4.9671e-05 2.9654e-05
1 179.4255 11.4697 1024.5 512.5 -5.5316e-05 -1.9464e-05 -2.1202e-05 5.0797e-05
2 180.4168 11.5202 1024.5 512.5 -5.7199e-05 1.4114e-05 1.5354e-05 5.2536e-05
3 181.2468 10.9878 1024.5 512.5 -3.7240e-05 4.2296e-05 4.6039e-05 3.4211e-05
4 181.5969 10.0779 1024.5 512.5 -3.0605e-06 5.4325e-05 5.9142e-05 2.8222e-06
5 181.3368 9.1393 1024.5 512.5 3.2294e-05 4.5606e-05 4.9659e-05 -2.9649e-05
6 180.5696 8.5293 1024.5 512.5 5.5323e-05 1.9465e-05 2.1204e-05 -5.0802e-05
7 179.5871 8.4788 1024.5 512.5 5.7224e-05 -1.4119e-05 -1.5361e-05 -5.2552e-05
8 178.7602 9.0071 1024.5 512.5 3.7261e-05 -4.2314e-05 -4.6066e-05 -3.4226e-05
9 178.4033 9.9146 1024.5 512.5 3.0621e-06 -5.4345e-05 -5.9172e-05 -2.8233e-06