Changeset 33138
- Timestamp:
- Jan 23, 2012, 9:40:03 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/Ohana/src/addstar
- Files:
-
- 2 edited
-
src/mkcmf.c (modified) (4 diffs)
-
test/relphot.flatcorr.dvo (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/addstar/src/mkcmf.c
r33135 r33138 74 74 } 75 75 76 double CRPIX1 = 0.0; 77 double CRPIX2 = 0.0; 78 if ((N = get_argument (argc, argv, "-crpix"))) { 79 remove_argument (N, &argc, argv); 80 CRPIX1 = atof (argv[N]); 81 remove_argument (N, &argc, argv); 82 CRPIX2 = atof (argv[N]); 83 remove_argument (N, &argc, argv); 84 } 85 86 int NX = 0; 87 int NY = 0; 88 if ((N = get_argument (argc, argv, "-size"))) { 89 remove_argument (N, &argc, argv); 90 NX = atof (argv[N]); 91 remove_argument (N, &argc, argv); 92 NY = atof (argv[N]); 93 remove_argument (N, &argc, argv); 94 } 95 76 96 // add support for all cmf types 77 97 static char *type = "PS1_V2"; … … 105 125 coords.crval1 = RA; 106 126 coords.crval2 = DEC; 107 coords.crpix1 = 0.0;108 coords.crpix2 = 0.0;127 coords.crpix1 = CRPIX1; 128 coords.crpix2 = CRPIX2; 109 129 110 130 coords.cdelt1 = 0.25/3600.0; … … 157 177 Nstars ++; 158 178 } 179 if (NX && NY) { 180 Xmax = NX; 181 Ymax = NY; 182 } 159 183 160 184 // create primary header … … 166 190 167 191 // XXX add minimum needed header fields 168 gfits_print (&header, "IMNAXIS1", "%d", 1, (int)(Xmax + 50));169 gfits_print (&header, "IMNAXIS2", "%d", 1, (int)(Ymax + 50));192 gfits_print (&header, "IMNAXIS1", "%d", 1, (int)(Xmax)); 193 gfits_print (&header, "IMNAXIS2", "%d", 1, (int)(Ymax)); 170 194 171 195 gfits_modify (&header, "NSTARS", "%d", 1, Nstars); -
branches/eam_branches/ipp-20111122/Ohana/src/addstar/test/relphot.flatcorr.dvo
r33136 r33138 69 69 70 70 macro go 71 if ($0 != 3) 72 echo "go (fileroot) (catdir)" 73 break 74 end 75 76 exec rm -rf $2 77 71 78 init 72 79 mkzptfile … … 74 81 75 82 mkdir testdata 76 mksequence testdata/t1 83 mksequence $1 $2 84 end 85 86 macro ckexposure 87 88 # assume we still have stars_ra, stars_dec, stars_mag in hand 89 catdir catdir.test 90 region $RA_CENTER $DEC_CENTER 0.2 91 images 92 pmeasure -all -m 15 20 93 mextract -region ra dec mag 94 95 match2d -closest ra dec stars_ra stars_dec 0.001 -index1 index1 -index2 index2 96 97 reindex stars_ra_m = stars_ra using index1 98 reindex stars_dec_m = stars_dec using index1 99 reindex stars_mag_m = stars_mag using index1 100 set dr = 3600*(ra - stars_ra_m) 101 set dd = 3600*(dec - stars_dec_m) 102 set dm = mag - stars_mag_m 103 lim mag dm; clear; box; plot mag dm 77 104 end 78 105 79 106 macro mksequence 80 if ($0 != 2)81 echo "mksequence (fileroot) "107 if ($0 != 3) 108 echo "mksequence (fileroot) (catdir)" 82 109 break 83 110 end … … 86 113 87 114 # we have defined a set of images by mjd and zero point 88 for i 0 mjd[] 89 mkexposure $1.$i $RA_CENTER $DEC_CENTER zpt[$i] mjd[$i] g 115 # for i 0 mjd[] 116 for i 0 1 117 mkexposure $1.$i $RA_CENTER $DEC_CENTER zpt[$i] mjd[$i] g $2 90 118 end 91 119 end 92 120 93 121 macro mkexposure 94 if ($0 != 7)95 echo "mkexposure (fileroot) (ra) (dec) (zpt) (mjd) (filter) "122 if ($0 != 8) 123 echo "mkexposure (fileroot) (ra) (dec) (zpt) (mjd) (filter) (catdir)" 96 124 break 97 125 end … … 119 147 $ra = $RAo - $dx / 3600.0 / dcos($DECo) 120 148 $dec = $DECo - $dy / 3600.0 149 echo $ra $dec $dx $dy 121 150 mkinput test.in.txt $ra $dec $ZPT 122 123 # make a GPC1-style chip124 # XX exec mkcmf test.in.txt $ROOT.$ix.$iy.cmf -date $date -time $time -radec $ra $dec -type PS1_V2 -coords -photcode GPC1.$FILTER.XY$ix\$iy125 # XX echo mkcmf test.in.txt $ROOT.$ix.$iy.cmf -date $date -time $time -radec $ra $dec -type PS1_V2 -coords -photcode GPC1.$FILTER.XY$ix\$iy126 127 exec mkcmf test.in.txt $ROOT.$ix.$iy.cmf -mjd $MJD -radec $ra $dec -type PS1_V2 -coords -photcode GPC1.$FILTER.XY$ix\$iy -no-noise128 echo mkcmf test.in.txt $ROOT.$ix.$iy.cmf -mjd $MJD -radec $ra $dec -type PS1_V2 -coords -photcode GPC1.$FILTER.XY$ix\$iy -no-noise129 151 130 exec addstar $ROOT.$ix.$iy.cmf -D CATDIR catdir.test -D CAMERA gpc1 152 # ra,dec is the center of this chip 153 exec mkcmf test.in.txt $ROOT.$ix.$iy.cmf -mjd $MJD -radec $ra $dec -type PS1_V2 -coords -photcode GPC1.$FILTER.XY$ix\$iy -no-noise -size $CHIP_DX $CHIP_DY -crpix {0.5*$CHIP_DX} {0.5*$CHIP_DY} 154 echo mkcmf test.in.txt $ROOT.$ix.$iy.cmf -mjd $MJD -radec $ra $dec -type PS1_V2 -coords -photcode GPC1.$FILTER.XY$ix\$iy -no-noise -size $CHIP_DX $CHIP_DY -crpix {0.5*$CHIP_DX} {0.5*$CHIP_DY} 155 156 exec addstar $ROOT.$ix.$iy.cmf -D CATDIR $7 -D CAMERA gpc1 131 157 end 132 158 end … … 141 167 142 168 # chip coordinate of the stars 143 set stars_X = (stars_ra - $2) * 3600.0 * dcos($3) / $PLATE_SCALE 144 set stars_Y = (stars_dec - $3) * 3600.0 / $PLATE_SCALE 169 # ra,dec is at the chip center, which corresponds to pixel (CHIP_DX,CHIP_DY)/2 170 set stars_X = (stars_ra - $2) * 3600.0 * dcos($3) / $PLATE_SCALE + $CHIP_DX*0.5 171 set stars_Y = (stars_dec - $3) * 3600.0 / $PLATE_SCALE + $CHIP_DY*0.5 145 172 set stars_M = (stars_mag - $4) 146 173 … … 213 240 # create 9 exposures, 3 per season 214 241 create imageID 0 9 215 set zpt = imageID*0.0050 - 0.0025242 set zpt = 25.0 + imageID*0.0050 - 0.0025 216 243 set mjd = zero(zpt) 217 244 mjd[0] = 55000.01
Note:
See TracChangeset
for help on using the changeset viewer.
