| | 1 | |
| | 2 | == Notes on a PS1 postage stamp server web interface == |
| | 3 | |
| | 4 | |
| | 5 | The postage stamp server (PSS) is primarily designed to handle requests for many postage |
| | 6 | stamps by science clients. |
| | 7 | |
| | 8 | It is also desired to have a user friendly web interface that allows a user |
| | 9 | to input parameters for a request (or requests), submit them to the server for |
| | 10 | processing, and retrieve the results. |
| | 11 | |
| | 12 | This note discusses features that such a web interface might have. |
| | 13 | |
| | 14 | First we provide some technical context by describing the operation of the postage stamp server and |
| | 15 | the prototype web interface. Those interested only in potential web interface |
| | 16 | features may skip ahead to the section "[Features for the IPP PSS Web Interface]" |
| | 17 | |
| | 18 | |
| | 19 | |
| | 20 | == Overview of the operation of the IPP Postage Stamp Server == |
| | 21 | |
| | 22 | The postage stamp server consists of a set of IPP programs that run in under pantasks. |
| | 23 | The sequence of requests and jobs is managed with the use of a mysql database. |
| | 24 | |
| | 25 | The nominal mode of operation is to query a set of predefined web sites for new request files. |
| | 26 | These web sites follow the data store interface. |
| | 27 | |
| | 28 | When a new fileset on a datastore is discovered the postage stamp server creates a new |
| | 29 | request in the database for each file in the fileset. All files are assumed to be |
| | 30 | fits binary tables with EXTNAME=PS1_PS_REQUEST. The definition of this files may be |
| | 31 | found in the postage stamp server interface control document on the wiki. |
| | 32 | |
| | 33 | http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/PostageStampServer |
| | 34 | |
| | 35 | |
| | 36 | Each row in a request file is a "request specification". |
| | 37 | The columns in the request specification server three purposes |
| | 38 | |
| | 39 | * to select the images of interest |
| | 40 | * to define the region of interest (the pixels in the input image that will be |
| | 41 | included in the stamp) |
| | 42 | * to select which data products that are included in the results (e.g. image stamp, mask stamp, |
| | 43 | variance stamp, psf, background model) |
| | 44 | |
| | 45 | Sometime after the requests have been queued, they are processed. The request file is copied to |
| | 46 | the PSS network and parsed. The parser reads each row in the request file and creates zero |
| | 47 | or more postage stamp jobs. |
| | 48 | Currently each job creates one stamp but there is an expectation that in the future jobs request |
| | 49 | specifications that reference the same images of interest will be processed by a single job. |
| | 50 | |
| | 51 | When all jobs have finished, the postage stamp server builds a fits binary table that describes |
| | 52 | the results of each job. Then that file and the results of the jobs are packaged into a fileset on |
| | 53 | a PSS data store product specific to the requestor. |
| | 54 | |
| | 55 | |
| | 56 | |
| | 57 | == Web Interface == |
| | 58 | |
| | 59 | Now all of the above is very good for science clients but not at all convienent for random |
| | 60 | user requests. |
| | 61 | |
| | 62 | What we need is some sort of form based web pages that users may use to create requests, submit |
| | 63 | them for processing, and "get" the results. |
| | 64 | |
| | 65 | We have a "prototype" web interface which is very simple, feature incomplete, and still not particularly |
| | 66 | friendly. It's a set of php forms. I do not expect that any of it will be used in the "real web interface". |
| | 67 | |
| | 68 | The way the prototype interacts with the PSS is worth reviewing. |
| | 69 | |
| | 70 | The site is http://pstamp.ipp.ifa.hawaii.edu/request.php |
| | 71 | |
| | 72 | It is password protected with the "standard" PS1 science consortium username and password. |
| | 73 | |
| | 74 | The form allows users to input some of the supported parameters. |
| | 75 | At the top we have data for the images of interest |
| | 76 | For example: |
| | 77 | |
| | 78 | |
| | 79 | {{{ |
| | 80 | Select Images by: Exposure Name |
| | 81 | Image Type: warp |
| | 82 | ID: o5013g0086o |
| | 83 | Sky RA: 293.3888 DEC: 16.04312 |
| | 84 | Pixels width 200 height: 200 |
| | 85 | }}} |
| | 86 | |
| | 87 | |
| | 88 | If the user hits submit, the apache web server hosting the page executes a cgi script that |
| | 89 | runs a program that creates a request table file containing a single row. Then the cgi script runs a command that enters |
| | 90 | a postage stamp request into the database. |
| | 91 | |
| | 92 | On the form the radio button "Get Status" gets selected. If the submit button is pushed again it |
| | 93 | shows the status of the request (and any previous requests entered in the given http session. |
| | 94 | |
| | 95 | Once all of the jobs from the request have finished processing |
| | 96 | part of the the status line turns into a link to the data store fileset where the results |
| | 97 | have been posted. For example: http://datastore.ipp.ifa.hawaii.edu/pstampresults/web_373/ |
| | 98 | |
| | 99 | If we go to this location we find two files: results.fits and parse_error.txt |
| | 100 | Unfortunately this example generated postage stamp images. |
| | 101 | |
| | 102 | results.fits is the results table. If we download it and examine it with fv we find that it |
| | 103 | contains 4 rows all of which have an error code set. |
| | 104 | * The first two rows have ERROR_CODE=24 PSTAMP_NOT_DESTREAKED. |
| | 105 | * The other two rows have ERROR_CODE=25 PSTAMP_NOT_AVAILABLE. |
| | 106 | |
| | 107 | The first error is somewhat self explanatory. The images haven't been run through magic and thus can't |
| | 108 | be released. PSTAMP_NOT_AVAILABLE is the error that happens when the input images have been |
| | 109 | cleaned up (deleted to recover disk space). |
| | 110 | |
| | 111 | If these images hadn't been cleaned up postage stamp images would have been placed in the fileset as well. |
| | 112 | |
| | 113 | Soon the postage stamp server will (optionally by user request) queue update runs which will ask the IPP |
| | 114 | to regenerate the images. This will of course increase the latency for processing requests significantly. |
| | 115 | |
| | 116 | parse_error.txt gives any errors printed to stderr by the request file parser. |
| | 117 | In this example it contains the lines |
| | 118 | |
| | 119 | {{{ |
| | 120 | skipping non-magicked image neb://ipp035.0/gpc1/ThreePi_NorthernRegion.090729//o5013g0086o.83651/o5013g0086o.83651.wrp.9992.skycell.1662.134.fits |
| | 121 | skipping non-magicked image neb://ipp023.0/gpc1/ThreePi_NorthernRegion.090729//o5013g0086o.836515013g0086o.83651.wrp.9992.skycell.1748.006.fits |
| | 122 | }}} |
| | 123 | |
| | 124 | |
| | 125 | These lines correspond to the jobs in the results file with ERROR_CODE=24. |
| | 126 | |
| | 127 | |
| | 128 | Desired Features for the IPP PSS Web Interface |
| | 129 | ---------------------------------------------- |
| | 130 | |
| | 131 | Form elements for all parameters. |
| | 132 | --------------------------------- |
| | 133 | |
| | 134 | The elements presented to the user should be context sensitive. For example the form elements |
| | 135 | where the ID and COMPONENT are to be entered should be labeled depending on the REQ_TYPE: |
| | 136 | if the REQ_TYPE is "byexp" then the ID element should be labeled "Exposure ID". |
| | 137 | Similar considerations apply to the COMPONENT parameter. |
| | 138 | |
| | 139 | This suggests using some code that operates on the client side in the implementation |
| | 140 | (e.g. Javascript or Java). |
| | 141 | |
| | 142 | Form elements need not follow the exact names in the request specification. |
| | 143 | |
| | 144 | Parameter validation |
| | 145 | -------------------- |
| | 146 | Where efficient, parameters should be validated as they are entered and the user should |
| | 147 | be notified of errors. (The prototype delays what checking it does until submission). |
| | 148 | Some parameters that are "invalid" on the server side but legal in the request interface |
| | 149 | should be caught and either corrected or raised as an error. |
| | 150 | For example o5013g0086o is a valid GPC1 exposure name but o50130086o is not. |
| | 151 | |
| | 152 | That said perhaps the user should be allowed to enter values that map to the exp_name. |
| | 153 | |
| | 154 | {{{ |
| | 155 | MJD: 55013 SEQ: 86 |
| | 156 | }}} |
| | 157 | |
| | 158 | (Note this would require either the ability to read the ipp database or some other table that |
| | 159 | maps from date and sequence number to exposure name). |
| | 160 | |
| | 161 | |
| | 162 | == User Accounts == |
| | 163 | |
| | 164 | |
| | 165 | We want to define a set of authorized users each with it's own password. The PSS server will |
| | 166 | be enhanced to include the identity of the user in the submitted requests. The PSS server |
| | 167 | may use this to ration usage or prioritize the processing of jobs. |
| | 168 | |
| | 169 | Since requests can have significant latency it would be useful to allow users to "save" the |
| | 170 | state of a session so that it can be resumed later. |
| | 171 | |
| | 172 | |
| | 173 | == User experience for Request submission and status == |
| | 174 | |
| | 175 | One of the biggest limitations of the prototype interface is the interaction with the server. |
| | 176 | The whole push a button to get status is rather primitive. |
| | 177 | |
| | 178 | |
| | 179 | == Presentation of Results == |
| | 180 | |
| | 181 | When a request completes, the results file should be parsed and importand data presented |
| | 182 | to the user in an easy to understand way. |
| | 183 | |
| | 184 | It might be useful to optionally display jpeg images of the stamps. (An option to create these should |
| | 185 | be added to the PSS request specification). |
| | 186 | |
| | 187 | A way to convenient way to download the fits files is desired. |
| | 188 | |
| | 189 | |