- Timestamp:
- Jul 2, 2013, 9:09:29 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/ImageSubset.c
r35104 r35734 63 63 GET_COLUMN (map, "PHOTOM_MAP", int); 64 64 GET_COLUMN (flags, "FLAGS", int); 65 GET_COLUMN (projID, "PROJ_ID", int); 66 GET_COLUMN (skycellID, "SKYCELL_ID", int); 65 67 GET_COLUMN (tzero, "TZERO", int); 66 68 GET_COLUMN (trate, "TRATE", short); … … 76 78 image[i].photom_map_id = map[i]; 77 79 image[i].flags = flags[i]; 80 image[i].projID = projID[i]; 81 image[i].skycellID = skycellID[i]; 78 82 image[i].tzero = tzero[i]; 79 83 image[i].trate = trate[i]; … … 87 91 free (map); 88 92 free (flags); 93 free (projID); 94 free (skycellID); 89 95 free (tzero); 90 96 free (trate); … … 124 130 gfits_define_bintable_column (&theader, "J", "FLAGS", "flags", NULL, 1.0, 1.0*0x8000); 125 131 132 gfits_define_bintable_column (&theader, "J", "PROJ_ID", "ID", NULL, 1.0, 0.0); 133 gfits_define_bintable_column (&theader, "J", "SKYCELL_ID", "ID", NULL, 1.0, 0.0); 134 126 135 gfits_define_bintable_column (&theader, "J", "TZERO", "exposure start", NULL, 1.0, 1.0*0x8000); 127 136 gfits_define_bintable_column (&theader, "I", "TRATE", "tti rate", NULL, 1.0, 0.0); … … 134 143 float *Mcal, *dMcal; 135 144 unsigned int *imageID, *map, *flags, *tzero; 145 int *projID, *skycellID; 136 146 unsigned short *trate; 137 147 short *ucdist; 138 148 139 149 // create intermediate storage arrays 140 ALLOCATE (Mcal, float, Nimage); 141 ALLOCATE (dMcal, float, Nimage); 142 ALLOCATE (imageID, unsigned int, Nimage); 143 ALLOCATE (map, unsigned int, Nimage); 144 ALLOCATE (flags, unsigned int, Nimage); 145 ALLOCATE (tzero, unsigned int, Nimage); 146 ALLOCATE (trate, unsigned short, Nimage); 147 ALLOCATE (ucdist, short, Nimage); 150 ALLOCATE (Mcal, float, Nimage); 151 ALLOCATE (dMcal, float, Nimage); 152 ALLOCATE (imageID, unsigned int, Nimage); 153 ALLOCATE (map, unsigned int, Nimage); 154 ALLOCATE (flags, unsigned int, Nimage); 155 ALLOCATE (projID, int, Nimage); 156 ALLOCATE (skycellID, int, Nimage); 157 ALLOCATE (tzero, unsigned int, Nimage); 158 ALLOCATE (trate, unsigned short, Nimage); 159 ALLOCATE (ucdist, short, Nimage); 148 160 149 161 // assign the storage arrays … … 157 169 trate[i] = image[i].trate; 158 170 ucdist[i] = image[i].ubercalDist; 171 172 projID[i] = -1; 173 skycellID[i] = -1; 174 if (!strncmp (image[i].name, "RINGS.V3.skycell", strlen("RINGS.V3.skycell"))) { 175 projID[i] = atoi(&image[i].name[18]); 176 skycellID[i] = atoi(&image[i].name[23]); 177 } 159 178 } 160 179 161 180 // add the columns to the output array 162 gfits_set_bintable_column (&theader, &ftable, "MCAL", Mcal, Nimage); 163 gfits_set_bintable_column (&theader, &ftable, "MCAL_ERR", dMcal, Nimage); 164 gfits_set_bintable_column (&theader, &ftable, "IMAGE_ID", imageID, Nimage); 165 gfits_set_bintable_column (&theader, &ftable, "PHOTOM_MAP", map, Nimage); 166 gfits_set_bintable_column (&theader, &ftable, "FLAGS", flags, Nimage); 167 gfits_set_bintable_column (&theader, &ftable, "TZERO", tzero, Nimage); 168 gfits_set_bintable_column (&theader, &ftable, "TRATE", trate, Nimage); 169 gfits_set_bintable_column (&theader, &ftable, "UBERCAL_DIST", ucdist, Nimage); 181 gfits_set_bintable_column (&theader, &ftable, "MCAL", Mcal, Nimage); 182 gfits_set_bintable_column (&theader, &ftable, "MCAL_ERR", dMcal, Nimage); 183 gfits_set_bintable_column (&theader, &ftable, "IMAGE_ID", imageID, Nimage); 184 gfits_set_bintable_column (&theader, &ftable, "PHOTOM_MAP", map, Nimage); 185 gfits_set_bintable_column (&theader, &ftable, "FLAGS", flags, Nimage); 186 gfits_set_bintable_column (&theader, &ftable, "PROJ_ID", projID, Nimage); 187 gfits_set_bintable_column (&theader, &ftable, "SKYCELL_ID", skycellID, Nimage); 188 gfits_set_bintable_column (&theader, &ftable, "TZERO", tzero, Nimage); 189 gfits_set_bintable_column (&theader, &ftable, "TRATE", trate, Nimage); 190 gfits_set_bintable_column (&theader, &ftable, "UBERCAL_DIST", ucdist, Nimage); 170 191 171 192 free (Mcal); … … 174 195 free (map); 175 196 free (flags); 197 free (projID); 198 free (skycellID); 176 199 free (tzero); 177 200 free (trate);
Note:
See TracChangeset
for help on using the changeset viewer.
