IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links
wiki:sample_pstamp_request

Version 3 (modified by bills, 17 years ago) ( diff )

--

Creating Postage Stamp Request Files == up to PostageStampServer

Postage Stamp request files are FITS tables.

We expect that various science servers and other users will have their own programs for building request files.

To help with testing the postage stamp server we have written a simple script called pstamp_req_create. It may be found in the IPP source tree in the directory pstamp/test.

This script has no IPP dependencies but does use the perl module Astro::FITS::CFITSIO.

The input to this program is a text file. For example

# Sample Postage stamp request description file

# pstamp/test/asteroid.txt

# This can be parsed by the program pstamp_req_create to build a 
# PS1_PSTAMP_REQUEST binary table

# First line of data is for the extension header
# The order of keywords follows TABLE 6 of ICD
#
# Note that value for REQ_NAME may be overriden by a command line
# argument to pstamp_req_create.
# Blank and comment lines are ignored

# REQ_NAME EXTVER
CHANGEME     1

# subsequent lines define the rows in the table
#

# These coordinates get stamps from warp and diff images that show a moving object that mops found.

# ROWNUM PROJECT       JOB_TYPE OPTION_MASK REQ_TYPE IMG_TYPE    ID      TESS_ID COMPONENT COORD_MASK CENTER_X   CENTER_Y             WIDTH HEIGHT  REQFILT MJD_MIN MJD_MAX

1        gpc1           stamp     3         bydiff   warp      362483    NULL      NULL      2       284.688522833822 -3.86916140936841 200  200     null   0         0
2        gpc1           stamp     3         bydiff   diff      362483    NULL      NULL      2       284.688522833822 -3.86916140936841 200  200     null   0         0
3        gpc1           stamp     1027      bydiff   warp      362483    NULL      NULL      2       284.688522833822 -3.86916140936841 200  200     null   0         0
4        gpc1           stamp     1027      bydiff   diff      362483    NULL      NULL      2       284.688522833822 -3.86916140936841 200  200     null   0         0

To create a request file is simple

                pstamp_req_create --input asteroid.txt --req_name bills.20090910_1 --output myrequest.fits

If the --req_name parameter is omitted, the REQ_NAME given in the input file will be used (in this example CHANGEME).

This file uses the 'bydiff' mode which selects the images of interest based on a diff_skyfile_id. The next file shows some other modes.

# REQ_NAME EXTVER
CHANGEME     1

# subsequent lines define the rows in the table

# ROWNUM PROJECT JOB_TYPE OPTION_MASK REQ_TYPE IMG_TYPE    ID      TESS_ID COMPONENT   COORD_MASK CENTER_X   CENTER_Y WIDTH HEIGHT REQFILT MJD_MIN MJD_MAX
# warps from various epochs for one of the SN candidates. Specifiying the skycell speeds up processing
1         gpc1   stamp      1        byid        warp     6245   null skycell.077 2 242.400666 55.273513 200 200 null 0 0
2         gpc1   stamp      1        byid        warp     6254   null skycell.077 2 242.400666 55.273513 200 200 null 0 0
3         gpc1   stamp      1        byid        warp     6264   null skycell.077 2 242.400666 55.273513 200 200 null 0 0
4         gpc1   stamp      1        byid        warp     6317   null skycell.077 2 242.400666 55.273513 200 200 null 0 0
5         gpc1   stamp      1        byid        warp     6324   null skycell.077 2 242.400666 55.273513 200 200 null 0 0
6         gpc1   stamp      1        byid        warp     6465   null skycell.077 2 242.400666 55.273513 200 200 null 0 0
7         gpc1   stamp      1        byid        warp     6466   null skycell.077 2 242.400666 55.273513 200 200 null 0 0


# get a specific warp
10        gpc1   stamp      1        byid         warp     6316  null skycell.077 2 242.400666 55.273513 200 200 null 0 0

# get stamps from all warps for exposure (only destreaked ones will succeed)
11        gpc1   stamp      1        byexp        warp    o4973g0123o null skycell.077 2 242.400666 55.273513 200 200 null 0 0

# get stamps from all chipRuns for exposure (only destreaked ones will succeed)
# add the mask and weight images as well
12        gpc1   stamp      7        byexp      chip    o4973g0123o null null  2 242.400666 55.273513 200 200 null 0 0

# get the corresponding diff
13        gpc1   stamp      1        byexp      diff    o4973g0123o null null 2 242.400666 55.273513 200 200 null 0 0

When REQ_MODE is 'byid' the ID column is interpreted as the id of the run that corresponds to the IMG_TYPE (exp_id, chip_id, warp_id, etc.). If a column with string type is not required for a given request specification it may be given the value 'null'. For example in row 12 component is set to null. This tells the postage stamp server to check all chips

Most of these request specifications only request stamps from the image (OPTION_MASK = 1). An exception is row 12 which has OPTION_MASK = 7. This requests stamps from the mask and variance images be made as well. Soon more bits of this this column will be used to select other output products (psf files for example).

Note that at this time REQ_TYPE bycoord and byskycell have not yet been implemented.

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.