IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39134


Ignore:
Timestamp:
Nov 13, 2015, 12:11:58 PM (11 years ago)
Author:
eugene
Message:

use sas40 inv.cmf / cmf files for diff test; use str(foo) to match column names

Location:
trunk/ippToPsps
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/diffbatch.py

    r39123 r39134  
    775775            for table in tables:
    776776                # check for AP_NPIX columns: missing for SAS39
    777                 if table.name == "SkyChip_psf":
     777                self.logger.debugPair("checking table", table.name)
     778                if table.name == "SkyChip.psf":
    778779                    columns = table.columns()
    779                     if 'AP_NPIX' in columns:
    780                         self.haveApNpix[num] = 1
    781                     if 'PSF_FWHM_MAJ' in columns:
    782                         self.havePsfFwhm[num] = 1
    783                     if 'SRC_CHIP_X' in columns:
    784                         self.haveSrcPos[num] = 1
    785 
     780                    for column in columns:
     781                        columnString = str(column)
     782                        if columnString == 'AP_NPIX':
     783                            self.haveApNpix[num] = 1
     784                            self.logger.debugPair("found AP_NPIX in file", fileNamePos)
     785                        if columnString == 'PSF_FWHM_MAJ':
     786                            self.havePsfFwhm[num] = 1
     787                            self.logger.debugPair("found PSF_FWHM_MAG in file", fileNamePos)
     788                        if columnString == 'SRC_CHIP_X':
     789                            self.haveSrcPos[num] = 1
     790                            self.logger.debugPair("found SRC_CHIP_X in file", fileNamePos)
    786791
    787792                myTable = table.name.replace(".","_") + "_" + str(num)
  • trunk/ippToPsps/jython/testCode.py

    r39103 r39134  
    9696        print "words[1]: " + words[1]
    9797
     98        myList = ["word1", "word2", "word3"]
     99        if "word1" in myList:
     100            print "found word1"
     101
     102        if 'word1' in myList:
     103            print "alt word1"
    98104       
    99105
  • trunk/ippToPsps/test/mksasdata.dvo

    r39105 r39134  
    2222list expfiles -glob sasdata.v39/*.smf
    2323list wrpfiles -glob sasdata.v39/*.wrp.*ff*.cmf
    24 list diffiles -glob sasdata.v39/*.WS.dif.*.cmf
     24# list diffiles -glob sasdata.v39/*.WS.dif.*.cmf
     25list diffiles -glob sasdata.v40/*.WS.dif.*.inv.cmf
    2526list stkfiles -glob sasdata.v39/*skycal*.cmf
    2627
     
    192193
    193194# create a populated catdir with a set of cmf files, save the filenames in list for use by insert.exp
    194 macro mkcatdir.dif
    195   if ($0 != 1)
    196     echo "mkcatdir.dif"
     195macro mkcatdir.dif.old
     196  if ($0 != 1)
     197    echo "mkcatdir.dif.old"
    197198    break
    198199  end
    199200
    200201  for i 0 $diffiles:n
    201     $diffile = $diffiles:$i
     202    $difffile = $diffiles:$i
    202203    echo addstar -D SKY_DEPTH 4 -D CATDIR $catdir_diff -D CATFORMAT PS1_V5 -D CAMERA gpc1 -update $diffile -D ZERO_POINT_OPTION CHIP_HEADER -accept-astrom -D ZERO_POINT_KEYWORD FPA.ZP
    203204    exec addstar -D SKY_DEPTH 4 -D CATDIR $catdir_diff -D CATFORMAT PS1_V5 -D CAMERA gpc1 -update $diffile -D ZERO_POINT_OPTION CHIP_HEADER -accept-astrom -D ZERO_POINT_KEYWORD FPA.ZP
     205    # echo addstar -D CAMERA gpc1 -D CATDIR $catdir -D CATFORMAT PS1_V5 $stkfile -update -quick-airmass -D ZERO_POINT_OPTION CHIP_HEADER
     206  end
     207end
     208
     209# create a populated catdir with a set of cmf files, save the filenames in list for use by insert.exp
     210macro mkcatdir.dif
     211  if ($0 != 1)
     212    echo "mkcatdir.dif"
     213    break
     214  end
     215
     216  for i 0 $diffiles:n
     217    $negfile = $diffiles:$i
     218    strsub $negfile inv.cmf cmf -var posfile
     219    exec rm -f diff.list.txt
     220    output diff.list.txt
     221    echo $posfile
     222    echo $negfile
     223    output stdout
     224    echo addstar -D SKY_DEPTH 4 -D CATDIR $catdir_diff -D CATFORMAT PS1_V5 -D CAMERA gpc1 -update -list diff.list.txt -D ZERO_POINT_OPTION CHIP_HEADER -accept-astrom -D ZERO_POINT_KEYWORD FPA.ZP -diff-inv
     225    exec addstar -D SKY_DEPTH 4 -D CATDIR $catdir_diff -D CATFORMAT PS1_V5 -D CAMERA gpc1 -update -list diff.list.txt -D ZERO_POINT_OPTION CHIP_HEADER -accept-astrom -D ZERO_POINT_KEYWORD FPA.ZP -diff-inv
    204226    # echo addstar -D CAMERA gpc1 -D CATDIR $catdir -D CATFORMAT PS1_V5 $stkfile -update -quick-airmass -D ZERO_POINT_OPTION CHIP_HEADER
    205227  end
     
    380402
    381403  for i 0 $diffiles:n
    382     $filename = $diffiles:$i
    383     strlen $filename Nchar
    384     substr $filename 0 {$Nchar - 4} path_base; # the database needs the path without the extension (.smf/.cmf)
    385 
    386     $diffSkyfileID = `echo $filename | fields IMAGEID | prcol 2`
     404    $negfile = $diffiles:$i
     405    strsub $negfile inv.cmf cmf -var posfile
     406    strlen $posfile Nchar
     407    substr $posfile 0 {$Nchar - 4} path_base; # the database needs the path without the extension (.smf/.cmf)
     408
     409    $diffSkyfileID = `echo $posfile | fields IMAGEID | prcol 2`
    387410    $skycell = "skycell.1315.090"
    388     $filter  = `echo $filename | fields FPA.FILTERID | prcol 2`
    389     $mjd     = `echo $filename | fields MJD-OBS | prcol 2`
     411    $filter  = `echo $posfile | fields FPA.FILTERID | prcol 2`
     412    $mjd     = `echo $posfile | fields MJD-OBS | prcol 2`
    390413   
    391414    $wrpID = $i
Note: See TracChangeset for help on using the changeset viewer.