Changeset 39288 for trunk/Ohana/src/uniphot/src/dcr_correction.c
- Timestamp:
- Dec 17, 2015, 8:53:56 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/uniphot/src/dcr_correction.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/uniphot/src/dcr_correction.c
r37807 r39288 26 26 27 27 char type[16]; 28 char extname[80];29 28 30 29 Header header; … … 67 66 if (!gfits_fread_ftable_data (f, &ftable, FALSE)) return (FALSE); 68 67 69 if (!gfits_scan (&theader, "EXTNAME", "%s", 1, extname)) return (FALSE); 68 char word[80]; 69 if (!gfits_scan (&theader, "EXTNAME", "%s", 1, word)) return (FALSE); 70 char *extname = strcreate(word); 70 71 71 72 // figure out the filter and direction from the EXTNAME 73 // EXTNAME is of the form DCR.[grizy].dP[xy] 72 74 73 // EXTNAME is of the form [grizy].[xy].v0 where 74 char filtname = extname[0]; 75 char *ptr = NULL; 76 char *w0 = strtok_r (extname, ".", &ptr); myAssert (w0, "invalid dcr file"); 77 char *w1 = strtok_r (NULL, ".", &ptr); myAssert (w1, "invalid dcr file"); 78 char *w2 = strtok_r (NULL, ".", &ptr); myAssert (w2, "invalid dcr file"); 79 80 myAssert (!strcmp(w0, "DCR"), "invalid dcr file"); 81 82 char filtname = w1[0]; 75 83 int filtnum = -1; 76 84 switch (filtname) { … … 86 94 87 95 int dir = -1; 88 if ( extname[2] == 'x') {96 if (w2[2] == 'x') { 89 97 dir = 0; 90 98 } 91 if ( extname[2] == 'y') {99 if (w2[2] == 'y') { 92 100 dir = 1; 93 101 }
Note:
See TracChangeset
for help on using the changeset viewer.
