IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Version 2 and Version 3 of IPPstripe82


Ignore:
Timestamp:
Apr 20, 2009, 4:06:37 AM (17 years ago)
Author:
Sebastian Jester
Comment:

reformat for trac

Legend:

Unmodified
Added
Removed
Modified
  • IPPstripe82

    v2 v3  
    1818To get more error messages to a command-line invocation of an IPP executable, add
    1919
     20{{{
    2021  -trace err 10
     22}}}
    2123
    2224= Step 0: Get a working installation of IPP =
     
    3436First I create a file firstimg.lis which has the name of the input file. Then I run psphot thus:
    3537
     38{{{
    3639 psphot -list firstimg.lis firsttry
     40}}}
    3741
    3842I could also have given it the input image on the command line with
    3943
     44{{{
    4045 psphot -file input.fits firsttry
     46}}}
    4147
    4248firsttry is the rootname for the output. Here's what happens when I run psphot on [http://www.mpia.de/homes/jester/fpC-001056-i1-0192.fit.gz fpC-001056-i1-0192.fit]
    4349
     50{{{
    4451    Camera SDSS, format SDSS matches header.
    4552    Chip 0: 1 1
     
    93100    complete psphot run: 8.708983 sec
    94101 found 0 leaks at psphot
     102}}}
    95103
    96104'''I also tried this on the Mac in Heidelberg and get different results...:'''
    97105
     106{{{
    98107    Camera SDSS, format SDSS matches header.
    99108    Chip 0: 1 1
     
    143152    skipping ap-mag resid plot
    144153    complete psphot run: 5.548932 sec
     154}}}
    145155
    146156I thought I was using exactly the same settings (copied all the config files 1:1 from IfA to MPIA), but maybe not? E.g. why is it skipping the moments plot in HD, but not in HI? According to Gene, the different numbers are explicable by different random numbers (i.e. seeds). The plots missing would only make sense if kapa wasn't compiled properly, but we think it was.
     
    150160psphot produces its output catalog in firsttry.cmf which we load into dvo:
    151161
     162{{{
    152163 addstar -D CAMERA sdss -accept-astrom firsttry.cmf
     164}}}
    153165
    154166-accept-astrom says that dvo should trust the WCS and ignore the fact that there are 0 astrometric stars reported in the header. Ohana commands like addstar require the -D CAMERA flag on the command line.
     
    156168Then start dvo by typing 'dvo' and plot things:
    157169
     170{{{
    158171 # Make a plot window
    159172 region 0 0 90 ait
     
    192205 # To just plot the ra,dec on a coordinate grid (i.e., not an image), say
    193206 cplot ra dec
     207}}}
    194208
    195209= Step 4: warping and stacking =
     
    199213DVO has Gene's tesselation of the sky built in. To create a table with the skycells of this tesselation, there's the skycells executable:
    200214
     215{{{
    201216 skycells 8 -scale .3 -D CATDIR /data/ipp001.0/jester/stripe82/coadd/skycells/
     217}}}
    202218
    203219The '8' tells it the tiling level, where 1 is coarse and 10 is fine. -scale gives the arcseconds per pixel. The skycells table is put into the directory specified by CATDIR.
     
    205221To look at the resulting tesselation, bring up dvo:
    206222
     223{{{
    207224 # Set catdir to the directory where the skycells live
    208225 catdir /data/ipp001.0/jester/stripe82/coadd/skycells/
     
    234251 output-> reading images (mode DVO_MODE_MEF)
    235252 output->  0 skycell.0484667 353.0672  -1.1307  1970/01/01,00:00:00     0  0 0.00  0.000 0.000 0.000    1
     253}}}
    236254
    237255skycell.0484667 is the ID we need.
     
    243261This uses a shell command:
    244262
     263{{{
    245264 dvoImageExtract skycell.0484667 -D CATDIR /data/ipp001.0/jester/stripe82/coadd/skycells/ -o /data/ipp001.0/jester/stripe82/coadd/run_ipp/skycell_0484667_warptemplate.fits
     265}}}
    246266
    247267to create the "warp template" fits file. It's a fits image with NAXIS=0, i.e., no pixels - just the header.
     
    251271You need to have the config files for the "simple" camera to run psWarp as follows:
    252272
     273{{{
    253274 pswarp -file ../input/fpC-001056-i1-0192.fit psWarp-001056-i1-0192 skycell_0484667_warptemplate.fits
    254275 pswarp -file ../input/fpC-001755-i1-0330.fit psWarp-001755-i1-0330 skycell_0484667_warptemplate.fits
     276}}}
    255277
    256278The 'output' parameter gives a rootname, so no .fits needed - it gets added automatically. The skycell needs to be specified with its full pathname.
     
    260282To run ppStack, you need an input file that specifies input images, weights, masks, seeing; here's an [[Image(htdocs:/images/PpStack.mdc.txt)]] (the .txt is just there because the wiki judges files by its name and doesn't know .mdc files). You then simply say:
    261283
     284{{{
    262285 ppStack ppStack.mdc ppStack-run1
     286}}}
    263287
    264288where ppStack-run1 is the output rootname.
     
    268292Initially, this barfed with some config file issue, but Paul fixed it. Now it runs with [[Image(htdocs:/images/Photstack-run1.out.txt)]]
    269293
     294{{{
    270295 psphot -file ppStack-run1.fits photstack-run1
     296}}}
    271297
    272298= Step 6: inject stacked psphot results into dvo =
     
    282308If the database is being set up for the very first time at all for IPP use, the admin need sto say (e.g.)
    283309
     310{{{
    284311 dbadmin init (dbserver) (dbname) (dbpassword)
    285312 dbadmin init aida77 ipp ********
     313}}}
    286314
    287315This creates an administrative database ippadmin which keeps track of everything else and is just required once per IPP installation.
     
    289317To set up a new project database, then say
    290318
     319{{{
    291320 dbadmin project (dbserver) (dbuser) (dbname)
    292321 dbadmin project aida77 ipp jester_s82
     322}}}
    293323
    294324confirming with the password set above. This creates a project database jester_s82 that keeps track of all files in that project.
     
    296326There's also something about creating a www user:
    297327
     328{{{
    298329 dbadmin user (dbserver) (dbuser) (username) (password)
     330}}}
    299331
    300332but I'm still fighting with the web server. NB: in our case, the php script install location is
    301333
     334{{{
    302335 /srv/www/htdocs/ippMonitor
     336}}}
    303337
    304338=== User things ===
     
    306340The server, ipp-dbname, password and project are specified in ~/.ipprc and/or site.config. I have in site.config:
    307341
     342{{{
    308343 ### Database configuration
    309344 DBSERVER       STR     aida77                  # Database host name (for psDBInit)
    310345 DBUSER         STR     ipp                     # Database user name (for psDBInit)
    311346 DBPASSWORD     STR     *******                 # Database password (for psDBInit)
     347}}}
    312348
    313349and in ~/.ipprc:
    314350
     351{{{
    315352 DBNAME         STR     jester_s82              # Database name (for psDBInit)
     353}}}
    316354
    317355I as user then use pxadmin to create a new database, or delete or recreate it (make sure that DBNAME is pointing to the database you actually want to work on!)
    318356
     357{{{
    319358 pxadmin -create
     359}}}
    320360
    321361'''There should proabably be something like an "IPP administrator's guide" (or maybe there is already one) that spells out how mySQL should be set up, what the best way is to make sure that different users don't interfere with each other's tables and projects (e.g. by having multiple mySQL users, if possible), etc.'''
     
    323363To start a whole reduction afresh, at the moment the fastest/only way is
    324364
     365{{{
    325366 pxadmin -recreate
     367}}}
    326368
    327369This will delete EVERYTHING in your database DBNAME...
     
    343385This is in
    344386
     387{{{
    345388 ~jester/IPP/ippconfig/sdss/camera.config
     389}}}
    346390
    347391The injection is simple here:
     392{{{
    348393 ipp_serial_inject.pl --telescope sdss --camera sdss \
    349394 --workdir path://S82/run_ipp --dbname jester \
    350395 --reduction PROCESSED /data/ipp001.0/jester/stripe82/coadd/input/fpC*.fits
     396}}}
    351397
    352398The "reduction class" PROCESSED selects a given set of reduction steps that is defined in the ppImage.config file. In the sdssmosaic/ppImage.config, I renamed this class into SDSSphotonly, which runs psphot but not psastro, to distinguish it from SDSSphotast, which runs both.
     
    355401
    356402This is in
    357 
     403{{{
    358404 ~jester/IPP/ippconfig/sdssmosaic/
    359 
     405}}}
    360406and the camera name is SDSSmosaic. Whether an SDSS image is recognized as SDSSmosaic or the single-chip SDSS format depends on which of the lines in my ~/.ipprc is commented out - the format.config for both files look identical, since the files ''are'' identical.
    361407
     
    369415
    370416To inject all the files in a given directory $D/stripe82/coadd/input/i/1056-0192/, use this command:
    371 
     417{{{
    372418 ipp_serial_inject_split.pl --telescope SDSS --camera SDSSmosaic --reduction SDSSphotast \
    373419 --workdir path://S82/run_ipp --dbname jester_s82 --tess_id S82CELLS --dvodb S82CATDIR \
    374420 $D/data/SDSS/stripe82/coadd/input/i/1056-0192/
    375 
     421}}}
    376422tess_id and dvodb are new in 2.5. The tesselation_name and dvodb_name can be explicit paths to catdirs above, but also abstract names defined in site.config
    377423
     
    383429
    384430"Registering" means getting them ingested into ippMon:
    385 
     431{{{
    386432 # Start pantasks
    387433 pantasks
     
    401447 register.on
    402448 run
    403 
     449}}}
    404450You can also save these steps in a macro, by puttin the commands in a file, wrapping them in "macro myMacro" and "end", and then reading the file in pantasks with the "input" command. In pantasks, one can then call the macro by just typing myMacro. On the IfA cluster, my macro that does these things is called thus:
    405 
     451{{{
    406452 input /home/panstarrs/jester/IPP/macros/inject.pro
    407453 injectmine
    408 
     454}}}
    409455Note that it is possible to 'controller add' the same host multiple times, and it will get multiple shares of the load.
    410456
     
    412458
    413459All the reduction steps are just switches in the pantasks.pro module; they can be run simply by turning them on, e.g.
    414 
     460{{{
    415461 chip.on
    416462 camera.on
    417 
     463}}}
    418464runs psphot.
    419465
     
    429475
    430476Then
    431 
     477{{{
    432478 warp.on
    433479 run
    434 
     480}}}
    435481will run the actual warping. To see what's going on, say
    436 
     482{{{
    437483 status
    438 
     484}}}
    439485for a general job count, and
    440 
     486{{{
    441487 status -taskstats
    442 
     488}}}
    443489to see statistics on execution times.
    444490
     
    446492
    447493Now that everything is warped, we could stack it. For this, we need to define a 'stack run' with stacktool.
    448 
     494{{{
    449495 stacktool -definerun -workdir path://S82/run_ipp -skycell_id skycell.0472823 -warp_id 1 -warp_id 2 -warp_id 5 -tess_id Skycells
    450 
     496}}}
    451497This tells IPP to stack things in the skycell given and include the pictures from the warp runs listed. The tess_id is defined in the TESSELLATIONS METADATA in camera.config, and points to the same path that I used to set up the tessellation [wiki:#Set_up_a_grid_of_skycells_to_which_the_output_will_be_warped above]
    452498
    453499At the moment, you need to figure out yourself which skycells and warp_ids to use. I do this:
    454 
     500{{{
    455501 # First, connect to the database
    456502 mysql -h alala -u ipp -p jester
     
    462508    group by skycell_id having count(distinct warp_id) > 1)
    463509 order by skycell_id, warp_id;
    464 
     510}}}
    465511The inner query shows you how many warp runs overlap a given skycell:
    466 
     512{{{
    467513 select skycell_id, count(distinct warp_id) as N_warp, count(*) as N_img
    468514 from warpSkyCellMap
    469515 group by skycell_id having N_img  > 1
    470516 order by skycell_id ;
    471 
     517}}}
    472518Conversely, you can find out how many skycells each of your images was split into:
    473 
     519{{{
    474520 select cam_id, class_id, warp_id,  count(distinct skycell_id)
    475521 from warpSkyCellMap
    476522 group by class_id, warp_id, cam_id
    477523 order by cam_id, class_id, warp_id;
    478 
     524}}}
    479525If something fails, the way to get IPP to stop trying is
    480 
     526{{{
    481527 stacktool -updaterun -stack_id 2 -state stop
    482 
     528}}}
    483529== Diffing ==
    484530
     
    502548
    503549Start with fresh jester_s82 reduction database:
     550{{{
    504551 pxadmin -recreate -dbname jester_s82
    505 
     552}}}
    506553or create a new one for a new run:
     554{{{
    507555 ippadmin project aida77 ipp jester_s82_20080912
    508556 pxadmin -create -dbname jester_s82_20080912
     557}}}
    509558
    510559== Injecting ==
     
    512561Normally I'd want to inject the bad pixel masks as described above, but I'm skipping that for now. Instead, go straight to injection, for now just with all the fields from 2 runs to see that it works:
    513562
     563{{{
    514564 ipp_serial_inject_split.pl --telescope SDSS --camera SDSSmosaic --reduction SDSSphotast \
    515565 --workdir path://S82TEST/run_ipp --dbname jester_s82_20080912 --tess_id S82CELLS --dvodb S82TESTCATDIR  \
    516566 /IPP/data/SDSS/stripe82/coadd/input/i/{1056,1755}-*/
     567}}}
    517568
    518569or for everything:
    519570
     571{{{
    520572 ipp_serial_inject_split.pl --telescope SDSS --camera SDSSmosaic --reduction SDSSphotast \
    521573 --workdir path://S82PROD/run_ipp --dbname jester_s82 --tess_id S82CELLS --dvodb S82PRODCATDIR  \
    522574 /IPP/data/SDSS/stripe82/coadd/input/?/*/
    523 
     575}}}
    524576The symbolic names like S82TEST are defined in <code>~/.ipprc</code> or <code>/IPP/site.config</code> (or another site config file pointed to by your <code>~/.ipprc</code>).
    525577
     
    527579
    528580At some point, IPP allowed using recipes also for psphot, which are in sdssmosaic/psphot.config and sdssmosaic/reductionClasses.mdc For these, use things like
    529 
     581{{{
    530582 pxadmin -recreate -dbname jester_s82_20081217_ap3
    531583
     
    537589 --dvodb S82AP3CAT_20081217  \
    538590 /IPP/data/SDSS/stripe82/coadd/input/i/{1056,1755}-*/
    539 
     591}}}
    540592This recipe turns on both aperture corrections and spatially variable PSF fits.
    541593
     
    543595
    544596Then start jobs in pantasks:
    545 
     597{{{
    546598 pantasks
    547599 # If it's not in your ~/.pantasksrc
     
    591643 status -taskstats
    592644 # includes information on how long each job ran
    593 
     645}}}
    594646NB: with
    595 
     647{{{
    596648 $VERBOSE = 2
    597 
     649}}}
    598650in pantasks, you see the commands as they're issued, which is useful for diagnosing problems. You can also simply re-run the command that's announced as failing, or look at the log file indicated. Normally, to re-run without generating further error messages, you need to remove the <code>--log path://datata</code> argument to see the output (which otherwise goes into a log file), and add <code>--no-update</code> so that the database isn't affected by the manual repeat.
    599651
    600652Once the camera-stage processing is finished, there's a dvo catalog with the outputs in S82PRODCATDIR. This needs to be sorted:
     653{{{
    601654 cd `ipp_datapath.pl path://S82PRODCATDIR`
    602655 addstar -D CATDIR . -resort
    603656 relphot -D CATDIR . -averages
    604 
     657}}}
    605658The resorted version is available for download at [http://www.mpia.de/homes/jester/IPPstripe82_catdir_20080815.tgz http://www.mpia.de/homes/jester/IPPstripe82_catdir_20080815.tgz] - a tarfile of about 250 MB that expands into a directory of about 500 MB. I have asked our computer people also to make available all the IPP outputs directly; however, those are 250 GB (no compression) so they need to figure out a way to host those. The input fpC*.fits images from SDSS are another ~50 GB. Here is the [[Image(htdocs:/images/README_IPPstripe82_20080815.txt)]].tgz