- Timestamp:
- Mar 14, 2012, 9:23:58 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/tools/dlapstacks (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/dlapstacks
r33521 r33522 24 24 use IPC::Cmd 0.36 qw( can_run run ); 25 25 26 27 26 my $ipprc = PS::IPP::Config->new(); 28 27 my $dbh = getDBHandle(); 29 28 30 29 my ($requested_filter, $no_display, $skycell_id, $verbose, $ra, $dec, $convolved); 31 my ($singleframe, $fitToFrame, $deasin, $save_temps );30 my ($singleframe, $fitToFrame, $deasin, $save_temps, $data_group); 32 31 33 32 my $temproot = '/local/ipp/tmp'; 34 33 my $outdir; 35 34 36 37 35 GetOptions( 38 36 'filter|f=s' => \$requested_filter, # restrict to a single filter 39 'skycell_id|s=s'=> \$skycell_id, # don't bother with37 'skycell_id|s=s'=> \$skycell_id, # specificly sset skycell_id of interest 40 38 'convolved|c' => \$convolved, # display convolved stack images instead of unconvolved 41 'fit' => \$fitToFrame, 42 'deasin|d' => \$deasin, 39 'fit' => \$fitToFrame, # scale the images to fit the ds9 frame 40 'single' => \$singleframe, # set ds9 to singleframe mode 41 'deasin|d' => \$deasin, # run ppstamp to remove the ASIN scaling from the stacks 43 42 'label|l=s' => \$label, # use a different label (careful!) 44 ' tess_id|t=s' => \$tess_id, #45 ' outdir|o=s' => \$outdir,46 ' no-display|n' => \$no_display, # don't run ds9 just print the filenames47 ' single' => \$singleframe,48 'save-temps' => \$save_temps, 49 'verbose|v' => \$verbose, 43 'data_group=s' => \$data_group, # select stacks by data_group 44 'tess_id|t=s' => \$tess_id, # set tess_id 45 'outdir|o=s' => \$outdir, # if deasin save de-asined images to given directory 46 'no-display|n' => \$no_display, # don't run ds9 just print the nebulous pathnames 47 'save-temps' => \$save_temps, # save temporary files 48 'verbose|v' => \$verbose, # print lots of information 50 49 ) or pod2usage( 2 ); 51 50 … … 58 57 pod2usage( -msg => 'if ra is suplied <dec> must be supplied as well', -exitval => 2) 59 58 if (defined $ra and ! defined $dec); 59 60 if ($skycell_id and !($skycell_id =~ /^skycell/)) { 61 if (length($skycell_id) < 3) { 62 # two character skycell_id NM should probably be 0NM 63 $skycell_id = "0$skycell_id"; 64 } 65 $skycell_id = "skycell.$skycell_id"; 66 } 60 67 61 68 my $missing_tools; … … 78 85 # don't allow MD label unless it's a refstack. 79 86 # Nightly stacks have too many images 80 if (($label =~ /MD/) and !(uc($label) =~ /REF/)) { 81 die "cannot use this program for label $label because we will probably too many matches. Talk to Bill\n"; 87 if (($data_group && ($data_group =~ /MD/)) or ($label =~ /^MD/)) { 88 unless ($data_group or uc($label) =~ /REF/) { 89 die "cannot use this program for label $label without data_group because that will most likely select nightly stacks and we will match an unreasonably large number of matches. Talk to Bill\n"; 90 } 91 # if tess_id hasn't been set to an MD field, guess that it's a V3 stack 92 unless ($tess_id =~ /MD/) { 93 my $tag = $data_group ? $data_group : $label; 94 my $field = substr $tag, 0, 4; 95 $tess_id = "$field.V3"; 96 print "Setting tess_id to $tess_id\n"; 97 } 82 98 } 83 99 … … 100 116 my $query = "SELECT skycell_id, filter, stack_id, quality, state, path_base 101 117 FROM stackRun join stackSumSkyfile USING(stack_id) 102 WHERE stackRun.state ='full' AND label = '$label' AND skycell_id = ?"; 118 WHERE stackRun.state ='full' AND skycell_id = ?"; 119 if ($data_group) { 120 $query .= " AND data_group = '$data_group'"; 121 } else { 122 $query .= " AND label = '$label'"; 123 } 103 124 104 125 if ($requested_filter) { … … 281 302 } 282 303 304 __END__ 305 306 =pod 307 =head1 NAME 308 dlapstacks - display stack images from the PS1 first Grand Reprocessing (LAP) 309 310 =head1 SYNOPSIS 311 312 dlapstacks <ra> <decl> [options] 313 dlapstacks --skycell_id <skycell_id> [<ra> <decl>] [options] 314 315 316 =head1 DESCRIPTION 317 318 Query the gpc1 database to find stacks containing a given RA and DEC or for a specific skycell_id. 319 Display the images using ds9. If coordinates are supplied the display is centered there. 320 321 =head1 OPTIONS 322 323 =over 4 324 325 =item * -s, --skycell_id <skycell_id> 326 327 The skycell_id to display. Note if skycell_id does not begin with "skycell", "skycell" is prepended to the supplied value before querying the database. 328 329 330 =item * <ra> 331 332 Right Ascension. Format: decimal degrees or HH:MM:SS 333 Required unless skycell_id is supplied 334 335 336 =item * <decl> 337 338 Declination. Format: decimal degrees or DD:MM:SS 339 Required unless skycell_id is supplied 340 341 =item * -f, --filter <filter> 342 343 Only display images for the given filter. The SQL wild card character '%' is appended to single character values. 344 345 =item * -c, --convolved 346 347 Display convolved stacks. Default is to display unconvolved stack images. 348 349 =item * --fit 350 351 Instruct ds9 to fit the image to the frame. 352 353 =item * --single 354 355 Set ds9 to single frame mode 356 357 =item * -d, --deasin 358 359 Display images tha have had the ASIN scaling removed. 360 361 =item *-o, --outdir <outdir> 362 363 If --deasin is selected the unscaled images are preserved in the provided directory. 364 The directory created if it does not exist. 365 366 =item * -l, --label <label> 367 368 Chose stacks with the provided label. The default is LAP.ThreePi.20110809. 369 NOTE: If the label begins with MD and --data_group is not provided the label must contain "ref" or "REF". This prevents 370 users from selecting the hundreds of nightly stack images. 371 372 =item * --data_group <data_group> 373 374 Select stacks with the provided data_group. By default stacks are selected by label. 375 376 377 =item * -t, --tess_id <tess_id> 378 379 Set the tessellation that skycells are selected from. Default RINGS.V3. Note if data_group or label begins with MDnn tess_id is set to MDnn.V3 by 380 default. 381 382 =item * -n, --no-display 383 384 Look up the stack images using the provided parameters but rather than displaying them with ds9 print out some information about the stacks. 385 386 =item * --save-temps 387 388 For debugging deasin mode do not delete temporary images. Ignored if --deasin is not supplied or if --outdir is supplied. 389 390 =item * -v, --verbose 391 392 Print information about the progress of the program. 393 394 =cut
Note:
See TracChangeset
for help on using the changeset viewer.
