IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 12, 2006, 11:18:48 AM (21 years ago)
Author:
drobbin
Message:

Expanded table parser to allow inclusion of error columns

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/psTableParse.c

    r5969 r5970  
    77 *  @author Dave Robbins, MHPCC
    88 *
    9  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-01-12 20:40:12 $
     9 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-01-12 21:18:48 $
    1111 *
    1212 *  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
     
    3636        printf("\n 4)X (Bull B)     5)Y (Bull B)     6)dX (Bull A)");
    3737        printf("\n 7)dY (Bull A)    8)dX (Bull B)    9)dY (Bull B)");
    38         printf("\n 10)UT1-UTC (Bull A)      11)UT1-UTC (Bull B)\n");
     38        printf("\n 10)UT1-UTC (Bull A)       11)UT1-UTC (Bull B)");
     39        printf("\n 12)Error in X (Bull A)    13)Error in Y (Bull A)");
     40        printf("\n 14)Error in dX (Bull A)   15)Error in dY (Bull A)    ");
     41        printf("\n 16)Error in UT1-UTC (Bull A)\n\n");
    3942        return 0;
    4043    }
     
    7881            fprintf(output, "UT1-UTC (B)  ");
    7982        }
     83        if(!strncmp(argv[i], "12", 2)) {
     84            fprintf(output, " xErr (A)  ");
     85        }
     86        if(!strncmp(argv[i], "13", 2)) {
     87            fprintf(output, " yErr (A)  ");
     88        }
     89        if(!strncmp(argv[i], "14", 2)) {
     90            fprintf(output, " dXErr (A) ");
     91        }
     92        if(!strncmp(argv[i], "15", 2)) {
     93            fprintf(output, " dYErr (A) ");
     94        }
     95        if(!strncmp(argv[i], "16", 2)) {
     96            fprintf(output, "UT1-UTC Err");
     97        }
    8098    }
    8199    fprintf(output, "\n#\n#\n");
     
    231249                        }
    232250                        if (i == 156) {
     251                            if (data2[i] == ' ' && data2[i+1] == '.') {
     252                                fprintf(output, "0");
     253                                i++;
     254                            }
     255                        }
     256                        fprintf(output, "%c", data2[i]);
     257                    }
     258                }
     259            }
     260            if(!strncmp(argv[j], "12", 2) ) {
     261                if (data2[32] == ' ') {
     262                    fprintf(output, "    0.000 ");
     263                } else {
     264                    for (i = 27; i <= 35; i++) {
     265                        if (i == 27 && data2[i+1] == '-' && data2[i+2] == '.') {
     266                            fprintf(output, "-0.");
     267                            i = 30;
     268                        }
     269                        if (i == 28) {
     270                            if (data2[i] == ' ' && data2[i+1] == '.') {
     271                                fprintf(output, "0");
     272                                i++;
     273                            }
     274                        }
     275                        fprintf(output, "%c", data2[i]);
     276                    }
     277                }
     278            }
     279            if(!strncmp(argv[j], "13", 2) ) {
     280                if (data2[51] == ' ') {
     281                    fprintf(output, "     0.000 ");
     282                } else {
     283                    for (i = 46; i <= 54; i++) {
     284                        if (i == 46 && data2[i+1] == '-' && data2[i+2] == '.') {
     285                            fprintf(output, "-0.");
     286                            i = 49;
     287                        }
     288                        if (i == 47) {
     289                            if (data2[i] == ' ' && data2[i+1] == '.') {
     290                                fprintf(output, "0");
     291                                i++;
     292                            }
     293                        }
     294                        fprintf(output, "%c", data2[i]);
     295                    }
     296                }
     297            }
     298            if(!strncmp(argv[j], "14", 2) ) {
     299                if (data2[111] == ' ') {
     300                    fprintf(output, "    0.000 ");
     301                } else {
     302                    for (i = 106; i <= 114; i++) {
     303                        if (i == 106 && data2[i+1] == '-' && data2[i+2] == '.') {
     304                            fprintf(output, "-0.");
     305                            i = 109;
     306                        }
     307                        if (i == 107) {
     308                            if (data2[i] == ' ' && data2[i+1] == '.') {
     309                                fprintf(output, "0");
     310                                i++;
     311                            }
     312                        }
     313                        fprintf(output, "%c", data2[i]);
     314                    }
     315                }
     316            }
     317            if(!strncmp(argv[j], "15", 2) ) {
     318                if (data2[131] == ' ') {
     319                    fprintf(output, "     0.000 ");
     320                } else {
     321                    for (i = 125; i <= 133; i++) {
     322                        if (i == 125 && data2[i+1] == '-' && data2[i+2] == '.') {
     323                            fprintf(output, "-0.");
     324                            i = 128;
     325                        }
     326                        if (i == 126) {
     327                            if (data2[i] == ' ' && data2[i+1] == '.') {
     328                                fprintf(output, "0");
     329                                i++;
     330                            }
     331                        }
     332                        fprintf(output, "%c", data2[i]);
     333                    }
     334                }
     335            }
     336            if(!strncmp(argv[j], "16", 2) ) {
     337                if (data2[73] == ' ') {
     338                    fprintf(output, "     0.000 ");
     339                } else {
     340                    for (i = 68; i <= 77; i++) {
     341                        if (i == 155 && data2[i+1] == '-' && data2[i+2] == '.') {
     342                            fprintf(output, "-0.");
     343                            i = 71;
     344                        }
     345                        if (i == 69) {
    233346                            if (data2[i] == ' ' && data2[i+1] == '.') {
    234347                                fprintf(output, "0");
Note: See TracChangeset for help on using the changeset viewer.