DVO Shell User's Guide by via28446

VIEWS: 2 PAGES: 14

									Eugene Magnier                             Astro 734 : Lecture 11




                 DVO Shell User's Guide




                                          Eugene Magnier
                                          Astronomy 734
                                          Spring 2006
Eugene Magnier                             Astro 734 : Lecture 11


Lecture Overview
   ●   DVO Shell Basics
   ●   DVO Vector Math
   ●   DVO Sky and Database interactions
Eugene Magnier                                                              Astro 734 : Lecture 11


DVO Shell Basics                       dvo: $name = a long string
                                       dvo: echo $name
   ●   simple variables                a long string

         – $name = value               dvo: $name = a long    string
                                       dvo: echo $name
         – may be a string             a long string
         – may be a math expresion
                                       dvo: $name = "a long    string"
   ●   double quotes protect strings   dvo: echo $name
   ●   single quotes do not protect    a long string

   ●   semi-colons separate commands   dvo: $a = word; $b = more $a
                                       dvo: echo $a
   ●   {} expand math expressions      word
                                       dvo: echo $b
                                       more word

                                       dvo: $value = 5*ten(3) + 2*dcos(45) + 3^3
                                       dvo: echo $value
                                       5028.4140625

                                       dvo: echo {5*6 + 32}
                                       62
Eugene Magnier                                                             Astro 734 : Lecture 11


DVO Shell Basics                         dvo: list name
                                         >> line 1
   ●   list variables                    >> another line
                                         >> word
         – convenient for in-line data   >> end
                                         dvo: echo $name:n
         – may use to split strings      3
         – may load from commands        dvo: echo $name:1
                                         another line

                                         dvo: list word -split “$name:1”
                                         dvo: echo $word:0
                                         another

                                         dvo: list name -x "ls"
                                         dvo: for i 0 $name:n
                                         >> echo $name:$i
                                         >> end
                                         Ifa.2006A.txt
                                         astro.734.01
                                         astro.734.02
                                         astro.734.03
                                         astro.734.04
                                         astro.734.05
                                         astro.734.06
                                         astro.734.07
                                         astro.734.08
                                         astro.734.09
                                         astro.734.10
                                         astro.734.11
Eugene Magnier                                              Astro 734 : Lecture 11


DVO Shell Basics                        dvo: for i 0 3
                                        >> echo $i
   ●   UNIX shell interactions          >> end
                                        0
        – exec : run a UNIX command     1
                                        2
             ● $STATUS

        – variables from command:       dvo: macro test
                                        > echo $0
             ● $name = `UNIX command`   > echo $1
        – list from command             > end
                                        dvo: test foo bar
             ● list name -x command     3
                                        foo
   ●   Loop, macros and conditions
        – for loops                     if ($i < 10)
                                          echo lo
        – if / else                     else
                                          echo hi
        – macro (name)
                                        end
Eugene Magnier                                                                  Astro 734 : Lecture 11


DVO Shell Basics                              #!/usr/bin/env dvo

   ●   other simple commands                  echo Nargs: $argv:n
        – ? : list all commands               echo $argv:0

        – ?? : list all variables             if ($argv:n != 2)
        – echo                                    echo “USAGE: script (foo) (bar)”
                                                  exit 2
        – input (file) : load from a file
                                              end
        – cd, pwd
   ●   running DVO as a script:               echo first is $argv:0
                                              echo next is $argv:1
        – like other shell-script languages   exit 0
        – arguments to script in argv list    -----------------------
                                              alala: script.dvo
        – exit status is passed to shell      Nargs: 0
                                              USAGE: script (foo) (bar)
                                              alala: echo $status
                                              2

                                              alala: script.dvo first second
                                              Nargs: 2
                                              first is first
                                              next is second
                                              alala: echo $status
                                              0
Eugene Magnier                                                              Astro 734 : Lecture 11


DVO Vectors and Graphs       dvo: create x 0 100 0.1
                             dvo: set y = 10*sin(x/5) + (x/10)^2
   ●   create vectors        dvo: lim x y; clear; box; plot x y
   ●   perform vector math   dvo: label -x "X axis_subscript| normal"
                             dvo: label -y "Y with &s greek &h helvetica"
   ●   read/write vectors
                             dvo: write test.dat x y
                             dvo: data test.dat
                             dvo: read x 1 y 2
Eugene Magnier                                                         Astro 734 : Lecture 11

                          section a 0.0 0.0 1.0 0.5
DVO plotting styles       style -x 2 -pt 2 -c red -lw 0 -sz 1.0
   ●   connection types   lim x y; box; plot x y
                          plot -c blue -pt 7 x z
   ●   point types        plot -c black -x 1 -lw 2 x t
   ●   colors             section b 0.0 0.5 0.5 0.5
                          lim x z; box; plot x z
   ●   line weight        label +x "little box"
   ●   line style         section c 0.5 0.5 0.5 0.5
                          lim 0 20 0 1; box
                          plot x y -x 2 -lw 0 -c green -pt 0 -sz 2.0
Eugene Magnier                                                   Astro 734 : Lecture 11

                             gaussdev y 10000 5.0 2.0
DVO vectors and statistics   vstat y
   ●   gaussian deviates     echo $MEAN $MEDIAN $SIGMA

   ●   vector statistics     create x 0 y[]
   ●   histograms            histogram y Ny -5.0 15.0 0.25
                             create dy -5.0 15.0 0.25

                             clear
                             section a 0.0 0.0 1.0 0.5
                             lim x y; box; plot -x 2 -pt 2 x y
                             section b 0.0 0.5 1.0 0.5
                             lim dy Ny; box; plot -x 1 dy Ny
Eugene Magnier                                                     Astro 734 : Lecture 11

                             dvo: rd a m31ccd13.fits
DVO image display            dvo: wd a test.fits -bitpix -32
   ●   read / write images   dvo: keyword a EXPTIME
                             EXPTIME: 400.17
   ●   display               dvo: stats a - - - -
   ●   image statistics      ...
   ●   etc                   dvo: tv a 3000 1000
                             dvo: tv a {$MEDIAN-$SIGMA} {$3*$SIGMA}

                             dvo: cursor
                             dvo: cut a x y x {$X1-50} $Y1 100 1
                             dvo: lim x y; clear; box; plot x y
                             dvo: jpeg -name cut.png
Eugene Magnier                                                                   Astro 734 : Lecture 11


DVO Sky and Database
   ●   region     dvo: region 13.9 0.9 0.4; images
   ●   images     dvo: style -c blue -pt 7; pmeasure -all -m 13 18
                  dvo: style -c red -lw 2; images -time 2001/11/16,06:15:05 1s
   ●   pmeasure
Eugene Magnier                                                    Astro 734 : Lecture 11


DVO shell : other sky interactions

  ●   region projections : sin, tan, ait, gls
  ●   cgrid
  ●   pcat
  ●   precess (from) (to) RA DEC
  ●   csystems (from) (to) X Y
         region -25.5 -12.8 6.0
         style -c blue; pcat -all
         style -c black; images




                                                region 0.0 25.0 90.0 sin
                                                style -c red; cgrid
                                                style -c black; images
                                                plot-landolt
                                                plot-sdss
Eugene Magnier                                        Astro 734 : Lecture 11


DVO low level extractions
   ●   extract from tables to vectors:
        – imextract (vector)
        – avextract (vector)
        – mextract (vector)
   ●   defaults to displayed region
   ●   accepts various filters: photcode, time, etc
   ●   extract combinations:
        – cmd I - J_2MASS : J_2MASS
        – ccd I - J_2MASS : J_2MASS - K_2MASS
        – dmagmeas I - J_2MASS : time
        – dmagaves I - J : ra
        – dmags I:rel - R:inst : J_2MASS
        – ddmags I:rel - R:inst : R:rel - J_2MASS
Eugene Magnier                                                                                 Astro 734 : Lecture 11


DVO quick selections
   ●   gimage
   ●   gstar



 dvo: gimages $Ri $Di
 reading images (mode DVO_MODE_RAW)
  0 573105o03.cmp 24.7509 29.8360 2001/02/20,06:32:07 503 403 2.12 0.000 0.000 300.000     0

 dvo: gimages $Ri $Di -pix
 reading images (mode DVO_MODE_RAW)
  0 573105o03.cmp 1130.0 2378.9 2001/02/20,06:32:07 503 403 2.12 0.000 0.000 300.000   0

 dvo: gstar $Ri $Di {1/3600}
  13.81413 0.75195 36 of 38 0.2 0
 BVRIZ
 32.767 32.767 32.767 18.151 32.767
 32.767 32.767 32.767 0.022 32.767
 NaN NaN NaN 0.708 NaN
 18.140 18.140 0.032 1999/09/09,15:22:33   -0.27   0.32   1   0 402 CFH12K.I.02
 17.967 17.967 0.034 1999/09/09,15:25:57    0.71   0.34   1   2 405 CFH12K.I.05
 18.204 18.204 0.024 2000/09/18,11:55:43    0.00   0.00   1   0 408 CFH12K.I.08
 18.216 18.216 0.055 2000/09/18,14:52:34    0.01   0.00   1   0 408 CFH12K.I.08
 18.177 18.177 0.016 2000/09/20,11:15:14    0.02   0.00   1   0 408 CFH12K.I.08
 18.104 18.104 0.011 2000/09/30,09:12:24    0.00   0.10   1   0 404 CFH12K.I.04
 18.208 18.208 0.018 2000/10/03,12:09:44    0.08   0.00   1   0 408 CFH12K.I.08
 18.237 18.237 0.012 2000/10/03,12:11:13    0.03   0.00   1   0 408 CFH12K.I.08

								
To top