IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Initial Version and Version 1 of Simtest


Ignore:
Timestamp:
Feb 24, 2009, 4:23:58 PM (17 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Simtest

    v1 v1  
     1==== Summary ====
     2'''Simtest:''' is a process for testing the IPP with simulated data.
     3The simulated data is produced and injected into an SQL database by ipp_simulation_data.pl
     4It can then be carried through the following ipp stages:
     5
     6 * Registration
     7 * Detrend construction
     8 * Chip processing
     9 * Camera processing
     10 * Warp to skycell
     11 * Difference
     12 * Stack
     13
     14----
     15Updated for ipp-2.4 / ipp-2.5 by S.Rodney
     16----
     17=== Annotated simtest walkthrough ===
     18
     19
     20
     21==== Configuration: ====
     22 * Check ~/.ipprc (or $PS_SITE)
     23  * SITE and SYSTEM point at valid site.config and system.config files
     24  * PATH should contain your config directory
     25 * '''site.config''': DATAPATH for SIMTEST, SIMWORK
     26  * the directory pointed to by SIMTEST is where your RAW simtest data will be created and stored. You can refer to it in command -line arguments as path://SIMTEST/
     27  * the SIMWORK directory is where the intermediate and final output files and all log files will be placed. Refer to it as path://SIMWORK/. 
     28   * (The variable name used, e.g. SIMTEST or SIMWORK, is unimportant. Just be consistent in the program calls below)
     29  * DBSERVER, DBNAME, DBUSER, DBPASSWORD
     30   * these set the parameters used by programs to access the SQL database
     31
     32 * Check ~/.ptolemyrc for:
     33  * CONFDIR
     34   * this is the directory containing your configuration files.
     35
     36==== Initiating a database. ====
     37 *  There are three ways:
     381) If you don't care to use the ippMonitor webpage, you can create an empty database in mysql
     39 > mysql
     40 mysql> CREATE DATABASE mydatabase;
     41 mysql> exit
     42then initiate the new database
     43 > pxadmin -create -dbname mydatabase
     44
     452) If you are restarting an existing database project you can delete and rebuild an empty simtest database:
     46 > pxadmin -recreate -dbname mydatabase
     47
     483) You can use dbadmin to create an empty database that will be recognized by ippMonitor (note: the dbadmin tool is a shell script that creates an SQL database and populates it with the tables needed by ippMonitor for user administration. The dbadmin script is probably not in your path, so find it in the ippMonitor source code directory and link to it or copy it somewhere. Call dbadmin with no options for syntax help.)
     49 > cd /data/po02.0/ipp/ipp-2.1/ippMonitor
     50 > dbadmin[[BR]]
     51 USAGE: dbadmin (options)[[BR]]
     52  dbadmin init (dbserver) (dbuser) (dbpassword)
     53      creates admin tables, basic db user -- requires root password[[BR]]
     54  dbadmin client (dbserver) (dbuser) (dbpassword) (client)
     55      add client name or regex[[BR]]
     56  dbadmin user (dbserver) (dbuser) (username) (password)
     57      create a new www user and password[[BR]]
     58  dbadmin project (dbserver) (dbuser) (dbname)
     59      create a new ipp project (database)[[BR]]
     60 > dbadmin project alala ipp mydatabase
     61
     62then initiate the new database
     63 > pxadmin -create -dbname mydatabase
     64
     65==== Make sim data ====
     66'''(and inject it into the database)'''
     67 > ipp_simulation_data.pl --name test --dbname mydatabase --camera SIMTEST --telescope SimScope --workdir path://SIMWORK/ --path path://SIMTEST/
     68
     69wait until it finishes ...
     70
     71==== Start pantasks ====
     72pantasks is the ipp parallel process manager for distributed computing across multiple nodes.
     73start up pantasks from a second window
     74 > pantasks
     75 
     76 Welcome to pantasks - parallel task scheduler
     77 
     78load some pantasks commands
     79 pantasks: module pantasks.pro
     80
     81or, if you have a modified pantasks.pro file
     82 pantasks: input /home/username/pantasks/pantasks.pro
     83
     84Add some CPU 'controllers' to carry out the processing steps.  Each controller you add will start an instance of the 'pclient' program, which receives processes from the pantasks 'pcontroller.'
     85To add an individual controller host by hand:
     86 pantasks: controller host add myhost
     87
     88'''NOTE:'''  You must have passphraseless ssh authentication set up from your pcontroller machine (the one running pantasks) to your pclient machines (the ones added with 'controller host add'). 
     89You may want to set up a module in your pantasks.pro file to quickly add a set of controllers with one command.
     90
     91If you are using a database other than the one declared in your site.config file, use the DB variable. DB holds a list of databases. $DB:0 is the active database. The default database defined in your site.config file will only be used if $DB:n is 0.
     92 pantasks: list DB -add mydatabase
     93 pantasks: echo $DB:0
     94 mydatabase
     95
     96The pantasks.pro module should contain a function called '''add.database''' to do this as well.
     97 pantasks: add.database mydatabase
     98
     99==== Registration ====
     100The newly injected simulated data is in the database, but we don't know what each image is yet, so we register all the new exposures in the database, getting their vital statistics and sorting them appropriately.
     101In pantasks, start up the tasks list, turn off some switches and check the status
     102
     103 pantasks: module.tasks
     104 pantasks: all.off
     105 pantasks: register.on
     106 pantasks: status
     107 Task Status
     108  AV Name                    Njobs  Ngood Nfail Ntime Command
     109  -+ detrend.process.load        0      0     0     0 (dynamic)
     110  -+ detrend.process.run         0      0     0     0 (dynamic)
     111  -+ detrend.processexp.load     0      0     0     0 (dynamic)
     112  -+ detrend.processexp.run      0      0     0     0 (dynamic)
     113  -+ detrend.stack.load          0      0     0     0 (dynamic)
     114  -+ detrend.stack.run           0      0     0     0 (dynamic)
     115  -+ detrend.norm.load           0      0     0     0 (dynamic)
     116  -+ detrend.norm.run            0      0     0     0 (dynamic)
     117  -+ detrend.normexp.load        0      0     0     0 (dynamic)
     118  -+ detrend.normexp.run         0      0     0     0 (dynamic)
     119  -+ detrend.normstat.load       0      0     0     0 (dynamic)
     120  -+ detrend.normstat.run        0      0     0     0 (dynamic)
     121  -+ detrend.resid.load          0      0     0     0 (dynamic)
     122  -+ detrend.resid.run           0      0     0     0 (dynamic)
     123  -+ detrend.residexp.load       0      0     0     0 (dynamic)
     124  -+ detrend.residexp.run        0      0     0     0 (dynamic)
     125  -+ detrend.reject.load         0      0     0     0 (dynamic)
     126  -+ detrend.reject.run          0      0     0     0 (dynamic)
     127  -+ chip.imfile.load            0      0     0     0 (dynamic)
     128  -+ chip.imfile.run             0      0     0     0 (dynamic)
     129  -+ camera.exp.load             0      0     0     0 (dynamic)
     130  -+ camera.exp.run              0      0     0     0 (dynamic)
     131  -+ warp.exp.load               0      0     0     0 (dynamic)
     132  -+ warp.exp.run                0      0     0     0 (dynamic)
     133  -+ warp.skycell.load           0      0     0     0 (dynamic)
     134  -+ warp.skycell.run            0      0     0     0 (dynamic)
     135  -+ diff.skycell.load           0      0     0     0 (dynamic)
     136  -+ diff.skycell.run            0      0     0     0 (dynamic)
     137  -+ stack.skycell.load          0      0     0     0 (dynamic)
     138  -+ stack.skycell.run           0      0     0     0 (dynamic)
     139  ++ register.imfile.load        0      0     0     0 (dynamic)
     140  ++ register.imfile.run         0      0     0     0 (dynamic)
     141  ++ register.exp.load           0      0     0     0 (dynamic)
     142  ++ register.exp.run            0      0     0     0 (dynamic)
     143
     144Start the registration step
     145 pantasks: run
     146
     147You can check the progress of the registration with status calls or on the web monitor: http://kiawe.ifa.hawaii.edu/ippMonitor
     148
     149If you are watching the processes on your controller hosts (e.g. using 'top') then you should see pclient processes.  The pantasks process itself is called pcontrol.
     150
     151When all your images have finished registration you can halt the register.load processes, which are no longer needed. (or they can continue to run in the background.)  You can turn off the registration switches.
     152 pantasks: stop
     153 pantasks: register.off
     154
     155'''NOTE:''' using 'halt' instead of 'stop' will stop the processes without harvesting jobs.
     156
     157==== Detrend construction ====
     158Flip switches for the detrend step
     159 pantasks: detrend.on
     160
     161Back in a base shell, outside of pantasks, run the detrend tool. This creates a detRun table instance in the database, from which pantasks can get the info it needs to direct the detrend construction
     162 > dettool -dbname mydatabase -definebyquery -det_type BIAS -filelevel FPA -workdir path://SIMWORK/ -inst SIMTEST -telescope SimScope -filter NONE -select_exp_type BIAS
     163
     164You should now be able to find an entry for this detrend run on the ippMonitor web page or with a MySQL query on the detRun table. When you see it there, start the pantasks scheduler in your pantasks window, window 2.
     165 pantasks: run
     166
     167When you see the bias in the ippMonitor under Detrend Frames or in MySQL under detFrames, then go back to window 1 for a sequence of dettools for DARKs, SHUTTERs, and FLATs. After running each dettool command from the command line, you should be able to find the run on the ippMonitor or in MySQL.
     168 > dettool -dbname mydatabase -definebyquery -det_type DARK -filelevel FPA -workdir path://SIMWORK/ -inst SIMTEST -telescope SimScope -filter NONE -select_exp_type DARK
     169
     170Wait for the dark to finish before starting to make the shutter
     171 > dettool -dbname mydatabase -definebyquery -det_type SHUTTER -filelevel FPA -workdir path://SIMWORK/ -inst SIMTEST -telescope SimScope -filter r -select_exp_type FLAT -select_filter r
     172
     173Wait for the shutter to finish before starting the flats (but both flats can be done at once)
     174 > dettool -dbname mydatabase -definebyquery -det_type FLAT -filelevel FPA -workdir path://SIMWORK/ -inst SIMTEST -telescope SimScope -filter r -select_exp_type FLAT -select_filter r
     175
     176 > dettool -dbname mydatabase -definebyquery -det_type FLAT -filelevel FPA -workdir path://SIMWORK/ -inst SIMTEST -telescope SimScope -filter i -select_exp_type FLAT -select_filter i
     177
     178
     179When detrend creation is done, you can stop and switch off the detrend processing.
     180
     181 pantasks: stop
     182 pantasks: detrend.off
     183
     184==== Chip and Camera ====
     185Start the chip and camera processing. This takes all the science images and does the detrending (dark sub, bias sub, shutter correction, flat fielding)
     186
     187<pre>
     188 pantasks: chip.on
     189 pantasks: camera.on
     190 pantasks: run
     191
     192 ...
     193
     194 pantasks: stop
     195</pre>
     196
     197==== Warp ====
     198Next we prepare for warping the science images into common skycells. i.e. putting them on a common tessellated tangent plane projection
     199
     200If the skycells have not been defined, then the skycells program will make them. This creates a directory with catalogs of skycell definitions.
     201 > skycells -D CATDIR ./skycells 8 -scale 0.2
     202  no data in db ./skycells/Photcodes.dat
     203  directory ./skycells does not exist, creating...
     204
     205'''IMPORTANT:''' be sure to point to this directory in your site.config file with, e.g.:
     206 TESSELLATIONS   METADATA
     207        # Tessellation name with corresponding DVO catdir
     208        Skycells        STR     path://SIMTEST/skycells
     209 END
     210 
     211Now we should be able to go back to the pantasks window and start warping:
     212
     213<pre>
     214 pantasks: warp.on
     215 pantasks: run
     216
     217 ...
     218
     219 pantasks: stop
     220</pre>
     221
     222
     223The warped images will be stored in path://SIMWORK/tess_skycells/sky_skycell.<skycellnum>/ as '*.wrp[1-7].fits' with related mask ('.mask'), weight ('.wt'), and summary stats ('.stats').  The warping will automatically calculate the appropriate "<skycellnum>" for the given tessellation and location of image on the sky.
     224
     225==== Difference ====
     226
     227<pre>
     228 pantasks: warp.off
     229 pantasks: diff.on
     230 pantasks: run
     231
     232 ...
     233
     234 pantasks: stop
     235</pre>
     236
     237These difference image will be stored in path://SIMWORK/tess_skycells/sky_skycell.0743078/ as '*.dif1.fits' with related mask ('.mask'), weight ('.wt'), and summary stats ('.stats').
     238
     239==== Stack ====
     240
     241<pre>
     242 pantasks: diff.off
     243 pantasks: stack.on
     244 pantasks: run
     245
     246 ...
     247
     248 pantasks: stop
     249</pre>
     250
     251Lather, rinse, repeat.