IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34342


Ignore:
Timestamp:
Aug 23, 2012, 10:04:31 AM (14 years ago)
Author:
eugene
Message:

merge changes from eam_branches/ipp-20120805

Location:
trunk/Ohana/src/opihi
Files:
7 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi

  • trunk/Ohana/src/opihi/cmd.astro

  • trunk/Ohana/src/opihi/cmd.astro/Makefile

    r33963 r34342  
    4343$(SRC)/galsectors.$(ARCH).o        \
    4444$(SRC)/galprofiles.$(ARCH).o       \
     45$(SRC)/getcoords.$(ARCH).o         \
    4546$(SRC)/elliprofile.$(ARCH).o       \
    4647$(SRC)/ringflux.$(ARCH).o          \
  • trunk/Ohana/src/opihi/cmd.astro/csystem.c

    r20936 r34342  
    1111  CoordTransform *transform;
    1212
    13   if (argc != 5) {
    14     gprint (GP_ERR, "USAGE: csystems [C/G/E/H] [C/G/E/H] X Y\n");
    15     return (FALSE);
    16   }
     13  if (argc != 5) goto syntax;
    1714
    1815  switch (argv[1][0]) {
     
    2017    case 'G': input = COORD_GALACTIC; break;
    2118    case 'E': input = COORD_ECLIPTIC; break;
    22     default: abort();
     19    default: goto syntax;
    2320  }
    2421
     
    2724    case 'G': output = COORD_GALACTIC; break;
    2825    case 'E': output = COORD_ECLIPTIC; break;
    29     default: abort();
     26    default: goto syntax;
    3027  }
    3128
     
    6663  return (TRUE);
    6764
     65syntax:
     66  gprint (GP_ERR, "USAGE: csystems [C/G/E/H] [C/G/E/H] X Y\n");
     67  return (FALSE);
    6868}
  • trunk/Ohana/src/opihi/cmd.astro/init.c

    r33963 r34342  
    2929int galradius               PROTO((int, char **));
    3030int galradbins              PROTO((int, char **));
     31int getcoords               PROTO((int, char **));
    3132int elliprofile             PROTO((int, char **));
    3233int ringflux                PROTO((int, char **));
     
    8687  {1, "galradius",   galradius,    "generate radial vectors with interpolation along paths"},
    8788  {1, "galradbins",  galradbins,   "generate radial vectors with interpolation along paths"},
     89  {1, "getcoords",   getcoords,    "generate images containing the RA,DEC coord for each pixel"},
    8890  {1, "elliprofile", elliprofile,  "generate radial vectors with interpolation along paths"},
    8991  {1, "ringflux",    ringflux,     "mean flux in a ring"},
  • trunk/Ohana/src/opihi/cmd.basic/fprintf.c

    r29540 r34342  
    4545      case 'F':
    4646      case 'G':
    47         sprintf (tmp, fmt, atof(argv[i]));
     47        sprintf (tmp, fmt, strtod (argv[i], NULL));
    4848        break;
    4949      case 's':
     
    5757      case 'x':
    5858      case 'X':
    59         sprintf (tmp, fmt, atoi(argv[i]));
     59        sprintf (tmp, fmt, strtol(argv[i], NULL, 0));
    6060        break;
    6161      default:
  • trunk/Ohana/src/opihi/lib.shell/stack_math.c

    r30614 r34342  
    8686    case '*': VV_FUNC('s', *M1 * *M2);
    8787    case '/': VV_FUNC('S', *M1 / (opihi_flt) *M2);
    88     case '%': VV_FUNC('s', (int)*M1 % (int)*M2);
     88    case '%': VV_FUNC('s', (long long)*M1 % (long long)*M2);
    8989    case '^': VV_FUNC('S', pow (*M1, *M2));
    9090    case '@': VV_FUNC('S', DEG_RAD*atan2 (*M1, *M2));
     
    9393    case '<': VV_FUNC('s', (*M1 < *M2) ? 1 : 0);
    9494    case '>': VV_FUNC('s', (*M1 > *M2) ? 1 : 0);
    95     case '&': VV_FUNC('s', ((int)*M1 & (int)*M2));
    96     case '|': VV_FUNC('s', ((int)*M1 | (int)*M2));
     95    case '&': VV_FUNC('s', ((long long)*M1 & (long long)*M2));
     96    case '|': VV_FUNC('s', ((long long)*M1 | (long long)*M2));
    9797    case 'E': VV_FUNC('s', (*M1 == *M2) ? 1 : 0);
    9898    case 'N': VV_FUNC('s', (*M1 != *M2) ? 1 : 0);
     
    196196    case '*': SV_FUNC('s', M1 * *M2);
    197197    case '/': SV_FUNC('S', M1 / (opihi_flt) *M2);
    198     case '%': SV_FUNC('s', (int) M1 % (int) *M2);
     198    case '%': SV_FUNC('s', (long long) M1 % (long long) *M2);
    199199    case '^': SV_FUNC('S', pow (M1, *M2));
    200200    case '@': SV_FUNC('S', DEG_RAD*atan2 (M1, *M2));
     
    203203    case '<': SV_FUNC('s', (M1 < *M2) ? 1 : 0);
    204204    case '>': SV_FUNC('s', (M1 > *M2) ? 1 : 0);
    205     case '&': SV_FUNC('s', ((int)M1 & (int)*M2));
    206     case '|': SV_FUNC('s', ((int)M1 | (int)*M2));
     205    case '&': SV_FUNC('s', ((long long)M1 & (long long)*M2));
     206    case '|': SV_FUNC('s', ((long long)M1 | (long long)*M2));
    207207    case 'E': SV_FUNC('s', (M1 == *M2) ? 1 : 0);
    208208    case 'N': SV_FUNC('s', (M1 != *M2) ? 1 : 0);
     
    302302    case '*': VS_FUNC('s', *M1 * M2);
    303303    case '/': VS_FUNC('S', *M1 / (opihi_flt) M2);
    304     case '%': VS_FUNC('s', (int) *M1 % (int) M2);
     304    case '%': VS_FUNC('s', (long long) *M1 % (long long) M2);
    305305    case '^': VS_FUNC('S', pow (*M1, M2));
    306306    case '@': VS_FUNC('S', DEG_RAD*atan2 (*M1, M2));
     
    309309    case '<': VS_FUNC('s', (*M1 < M2) ? 1 : 0);
    310310    case '>': VS_FUNC('s', (*M1 > M2) ? 1 : 0);
    311     case '&': VS_FUNC('s', ((int)*M1 & (int)M2));
    312     case '|': VS_FUNC('s', ((int)*M1 | (int)M2));
     311    case '&': VS_FUNC('s', ((long long)*M1 & (long long)M2));
     312    case '|': VS_FUNC('s', ((long long)*M1 | (long long)M2));
    313313    case 'E': VS_FUNC('s', (*M1 == M2) ? 1 : 0);
    314314    case 'N': VS_FUNC('s', (*M1 != M2) ? 1 : 0);
     
    392392    case '*': MV_FUNC(*M1 * *M2);
    393393    case '/': MV_FUNC(*M1 / (opihi_flt) *M2);
    394     case '%': MV_FUNC((int) *M1 % (int) *M2);
     394    case '%': MV_FUNC((long long) *M1 % (long long) *M2);
    395395    case '^': MV_FUNC(pow (*M1, *M2));
    396396    case '@': MV_FUNC(DEG_RAD*atan2 (*M1, *M2));
     
    399399    case '<': MV_FUNC((*M1 < *M2) ? 1 : 0);
    400400    case '>': MV_FUNC((*M1 > *M2) ? 1 : 0);
    401     case '&': MV_FUNC(((int)*M1 & (int)*M2));
    402     case '|': MV_FUNC(((int)*M1 | (int)*M2));
     401    case '&': MV_FUNC(((long long)*M1 & (long long)*M2));
     402    case '|': MV_FUNC(((long long)*M1 | (long long)*M2));
    403403    case 'E': MV_FUNC((*M1 == *M2) ? 1 : 0);
    404404    case 'N': MV_FUNC((*M1 != *M2) ? 1 : 0);
     
    484484    case '*': VM_FUNC(*M1 * *M2);
    485485    case '/': VM_FUNC(*M1 / (opihi_flt) *M2);
    486     case '%': VM_FUNC((int) *M1 % (int) *M2);
     486    case '%': VM_FUNC((long long) *M1 % (long long) *M2);
    487487    case '^': VM_FUNC(pow (*M1, *M2));
    488488    case '@': VM_FUNC(DEG_RAD*atan2 (*M1, *M2));
     
    491491    case '<': VM_FUNC((*M1 < *M2) ? 1 : 0);
    492492    case '>': VM_FUNC((*M1 > *M2) ? 1 : 0);
    493     case '&': VM_FUNC(((int)*M1 & (int)*M2));
    494     case '|': VM_FUNC(((int)*M1 | (int)*M2));
     493    case '&': VM_FUNC(((long long)*M1 & (long long)*M2));
     494    case '|': VM_FUNC(((long long)*M1 | (long long)*M2));
    495495    case 'E': VM_FUNC((*M1 == *M2) ? 1 : 0);
    496496    case 'N': VM_FUNC((*M1 != *M2) ? 1 : 0);
     
    564564    case '*': MM_FUNC(*M1 * *M2);
    565565    case '/': MM_FUNC(*M1 / (float) *M2);
    566     case '%': MM_FUNC((int) *M1 % (int) *M2);
     566    case '%': MM_FUNC((long long) *M1 % (long long) *M2);
    567567    case '^': MM_FUNC(pow (*M1, *M2));
    568568    case '@': MM_FUNC(DEG_RAD*atan2 (*M1, *M2));
     
    571571    case '<': MM_FUNC((*M1 < *M2) ? 1 : 0);
    572572    case '>': MM_FUNC((*M1 > *M2) ? 1 : 0);
    573     case '&': MM_FUNC(((int)*M1 & (int)*M2));
    574     case '|': MM_FUNC(((int)*M1 | (int)*M2));
     573    case '&': MM_FUNC(((long long)*M1 & (long long)*M2));
     574    case '|': MM_FUNC(((long long)*M1 | (long long)*M2));
    575575    case 'E': MM_FUNC((*M1 == *M2) ? 1 : 0);
    576576    case 'N': MM_FUNC((*M1 != *M2) ? 1 : 0);
     
    649649    case '*': MS_FUNC(*M1 * M2);
    650650    case '/': MS_FUNC(*M1 / (float) M2);
    651     case '%': MS_FUNC((int) *M1 % (int) M2);
     651    case '%': MS_FUNC((long long) *M1 % (long long) M2);
    652652    case '^': MS_FUNC(pow (*M1, M2));
    653653    case '@': MS_FUNC(DEG_RAD*atan2 (*M1, M2));
     
    656656    case '<': MS_FUNC((*M1 < M2) ? 1 : 0);
    657657    case '>': MS_FUNC((*M1 > M2) ? 1 : 0);
    658     case '&': MS_FUNC(((int)*M1 & (int)M2));
    659     case '|': MS_FUNC(((int)*M1 | (int)M2));
     658    case '&': MS_FUNC(((long long)*M1 & (long long)M2));
     659    case '|': MS_FUNC(((long long)*M1 | (long long)M2));
    660660    case 'E': MS_FUNC((*M1 == M2) ? 1 : 0);
    661661    case 'N': MS_FUNC((*M1 != M2) ? 1 : 0);
     
    725725    case '*': SM_FUNC(M1 * *M2);
    726726    case '/': SM_FUNC(M1 / (float) *M2);
    727     case '%': SM_FUNC((int) M1 % (int) *M2);
     727    case '%': SM_FUNC((long long) M1 % (long long) *M2);
    728728    case '^': SM_FUNC(pow (M1, *M2));
    729729    case '@': SM_FUNC(DEG_RAD*atan2 (M1, *M2));
     
    732732    case '<': SM_FUNC((M1 < *M2) ? 1 : 0);
    733733    case '>': SM_FUNC((M1 > *M2) ? 1 : 0);
    734     case '&': SM_FUNC(((int)M1 & (int)*M2));
    735     case '|': SM_FUNC(((int)M1 | (int)*M2));
     734    case '&': SM_FUNC(((long long)M1 & (long long)*M2));
     735    case '|': SM_FUNC(((long long)M1 | (long long)*M2));
    736736    case 'E': SM_FUNC((M1 == *M2) ? 1 : 0);
    737737    case 'N': SM_FUNC((M1 != *M2) ? 1 : 0);
     
    806806    case '*': SS_FUNC('s', M1 * M2);
    807807    case '/': SS_FUNC('S', M1 / (opihi_flt) M2);
    808     case '%': SS_FUNC('s', (int) M1 % (int) M2);
     808    case '%': SS_FUNC('s', (long long) M1 % (long long) M2);
    809809    case '^': SS_FUNC('S', pow (M1, M2));
    810810    case '@': SS_FUNC('S', DEG_RAD*atan2 (M1, M2));
     
    813813    case '<': SS_FUNC('s', (M1 < M2) ? 1 : 0);
    814814    case '>': SS_FUNC('s', (M1 > M2) ? 1 : 0);
    815     case '&': SS_FUNC('s', ((int)M1 & (int)M2));
    816     case '|': SS_FUNC('s', ((int)M1 | (int)M2));
     815    case '&': SS_FUNC('s', ((long long)M1 & (long long)M2));
     816    case '|': SS_FUNC('s', ((long long)M1 | (long long)M2));
    817817    case 'E': SS_FUNC('s', (M1 == M2) ? 1 : 0);
    818818    case 'N': SS_FUNC('s', (M1 != M2) ? 1 : 0);
     
    916916  if (!strcmp (op, "="))      S_FUNC(M1, 's');
    917917  if (!strcmp (op, "abs"))    S_FUNC(fabs(M1), 's');
    918   if (!strcmp (op, "int"))    S_FUNC((int)(M1), 's');
     918  if (!strcmp (op, "int"))    S_FUNC((long long)(M1), 's');
    919919  if (!strcmp (op, "exp"))    S_FUNC(exp (M1), 'S');
    920920  if (!strcmp (op, "ten"))    S_FUNC(pow (10.0,M1), 'S');
     
    995995  if (!strcmp (op, "="))      V_FUNC(*M1, 's');
    996996  if (!strcmp (op, "abs"))    V_FUNC(fabs(*M1), 's');
    997   if (!strcmp (op, "int"))    V_FUNC((int)(*M1), 's');
     997  if (!strcmp (op, "int"))    V_FUNC((long long)(*M1), 's');
    998998  if (!strcmp (op, "exp"))    V_FUNC(exp(*M1), 'S');
    999999  if (!strcmp (op, "ten"))    V_FUNC(pow(10.0,*M1), 'S');
     
    10661066  if (!strcmp (op, "="))     { }
    10671067  if (!strcmp (op, "abs"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = fabs(*M1);         }}
    1068   if (!strcmp (op, "int"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = (opihi_flt)(int)(*M1); }}
     1068  if (!strcmp (op, "int"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = (opihi_flt)(long long)(*M1); }}
    10691069  if (!strcmp (op, "exp"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = exp(*M1);          }}
    10701070  if (!strcmp (op, "ten"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = pow(10.0,*M1);     }}
Note: See TracChangeset for help on using the changeset viewer.