IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2009, 12:08:50 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
6 deleted
20 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/Ohana

  • branches/cnb_branches/cnb_branch_20090301/Ohana/Makefile.in

    r19682 r23352  
    7575        mkdir -p $(DESTLIB)
    7676        mkdir -p $(DESTBIN)
    77         for i in $(LIBS); do make $$i.install || exit; done
     77        for i in $(LIBS); do make $$i.install || exit 1; done
    7878        chmod +x ohana-config
    7979        cp -f ohana-config $(DESTBIN)/
     
    8383
    8484all:
    85         make libs || exit
    86         for i in $(PROGRAM); do make $$i || exit; done
     85        make libs || exit 1
     86        for i in $(PROGRAM); do make $$i || exit 1; done
    8787
    8888extras:
    89         for i in $(EXTRAS); do make $$i || exit; done
     89        for i in $(EXTRAS); do make $$i || exit 1; done
    9090
    9191pantasks:
    92         make libs || exit
    93         cd src/opihi; make pclient.install && exit
    94         cd src/opihi; make pcontrol.install && exit
    95         cd src/opihi; make pantasks.install && exit
     92        make libs || exit 1
     93        cd src/opihi; make pclient.install && exit 1
     94        cd src/opihi; make pcontrol.install && exit 1
     95        cd src/opihi; make pantasks.install && exit 1
    9696
    9797mana:
    9898        make libs
    9999        make kapa2.install
    100         cd src/opihi; make mana.install && exit
     100        cd src/opihi; make mana.install && exit 1
    101101
    102102dvoshell:
    103103        make libs
    104104        make kapa2.install
    105         cd src/opihi; make dvo.install && exit
     105        cd src/opihi; make dvo.install && exit 1
    106106
    107107clean:
    108108        @if [ "$(ARCH)" = "" ]; then echo ""; echo " *** please define ARCH ***"; echo; exit 1; fi
    109         for i in $(LIBS); do make $$i.clean || exit; done
    110         for i in $(PROGRAM); do make $$i.clean || exit; done
    111         for i in $(EXTRAS); do make $$i.clean || exit; done
     109        for i in $(LIBS); do make $$i.clean || exit 1; done
     110        for i in $(PROGRAM); do make $$i.clean || exit 1; done
     111        for i in $(EXTRAS); do make $$i.clean || exit 1; done
    112112        @rm -f `find . -name .mana`
    113113        @rm -f `find . -name .dvo`
     
    116116dist:
    117117        @if [ "$(ARCH)" = "" ]; then echo ""; echo " *** please define ARCH ***"; echo; exit 1; fi
    118         for i in $(LIBS); do make $$i.dist || exit; done
    119         for i in $(PROGRAM); do make $$i.dist || exit; done
     118        for i in $(LIBS); do make $$i.dist || exit 1; done
     119        for i in $(PROGRAM); do make $$i.dist || exit 1; done
    120120        @echo -n -e "\0033]0; *** Ohana: done $@ *** \0007" \
    121121
    122122install:
    123123        @if [ "$(ARCH)" = "" ]; then echo ""; echo " *** please define ARCH ***"; echo; exit 1; fi
    124         for i in $(LIBS); do make $$i.install || exit; done
    125         for i in $(PROGRAM); do make $$i.install || exit; done
     124        for i in $(LIBS); do make $$i.install || exit 1; done
     125        for i in $(PROGRAM); do make $$i.install || exit 1; done
    126126        @echo -n -e "\0033]0; *** Ohana: done $@ *** \0007" \
    127127
    128128install.extras:
    129         for i in $(EXTRAS); do make $$i.install || exit; done
     129        for i in $(EXTRAS); do make $$i.install || exit 1; done
    130130        @echo -n -e "\0033]0; *** Ohana: done $@ *** \0007" \
    131131
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/addstar/include/skycells.h

    r21508 r23352  
    1212# include <glob.h>
    1313
    14 enum {SQUARES, TRIANGLES, LOCAL};
     14enum {SQUARES, TRIANGLES, LOCAL, RINGS};
    1515enum {TETRAHEDRON, CUBE, OCTOHEDRON, DODECAHEDRON, ICOSAHEDRON};
    1616
     
    6767double SCALE;
    6868double PADDING;
     69double CELLSIZE;
    6970int    LEVEL;
    7071
     
    8485int          sky_tessellation               PROTO((FITS_DB *db, int level, int Nmax, int mode, double scale));
    8586int          sky_tessellation_init          PROTO((double scale));
     87
    8688int          sky_tessellation_local         PROTO((FITS_DB *db, int level, int Nmax));
    8789int          sky_tessellation_triangles     PROTO((FITS_DB *db, int level, int Nmax));
    8890int          sky_tessellation_squares       PROTO((FITS_DB *db, int level, int Nmax));
     91int          sky_tessellation_rings         PROTO((FITS_DB *db, int level, int Nmax));
     92
    8993int          sky_triangle_to_image          PROTO((Image *image, SkyTriangle *triangle));
    9094int          sky_triangle_to_rectangle      PROTO((SkyRectangle *image, SkyTriangle *triangle));
     95
    9196int          sky_rectangle_local            PROTO((SkyRectangle *rectangle));
    9297int          sky_subdivide_image            PROTO((Image *output, SkyRectangle *input, int Nx, int Ny));
    9398int          sky_triangle_coords            PROTO((SkyTriangle *triangle));
     99
     100SkyRectangle *sky_rectangle_ring            PROTO((float dec, float dDEC, int *nring));
     101
    94102SkyTriangle *sky_divide_triangles           PROTO((SkyTriangle *in, int *ntriangles));
    95103SkyTriangle *sky_base_triangles             PROTO((int *ntriangles));
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/addstar/src/args_skycells.c

    r21048 r23352  
    3535      MODE = LOCAL;
    3636    }
     37    if (!strcasecmp (argv[N], "rings")) {
     38      MODE = RINGS;
     39    }
    3740    remove_argument (N, &argc, argv);
    3841  }
     
    140143
    141144  LEVEL = 8;
    142   if ((MODE != LOCAL) && (N = get_argument (argc, argv, "-level"))) {
    143     remove_argument (N, &argc, argv);
    144     LEVEL = strtol (argv[N], &ptr, 10);
    145     remove_argument (N, &argc, argv);
    146     if ((*ptr != 0) || (LEVEL < 0)) {
    147       fprintf (stderr, "-level requires an integer (>= 0) argument\n");
     145  if ((MODE == SQUARES) || (MODE == TRIANGLES)) {
     146    if ((N = get_argument (argc, argv, "-level"))) {
     147      remove_argument (N, &argc, argv);
     148      LEVEL = strtol (argv[N], &ptr, 10);
     149      remove_argument (N, &argc, argv);
     150      if ((*ptr != 0) || (LEVEL < 0)) {
     151        fprintf (stderr, "-level requires an integer (>= 0) argument\n");
     152        help ();
     153      } 
     154    }
     155  }
     156
     157  CELLSIZE = 4.0;
     158  if ((MODE == RINGS) && (N = get_argument (argc, argv, "-cellsize"))) {
     159    remove_argument (N, &argc, argv);
     160    CELLSIZE = strtod (argv[N], &ptr);
     161    if ((*ptr != 0) || (CELLSIZE < 0.0)) {
     162      fprintf (stderr, "-level requires a floating-point argument\n");
    148163      help ();
    149164    } 
     165    remove_argument (N, &argc, argv);
    150166  }
    151167
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/addstar/src/get2mass_full.c

    r21508 r23352  
    11# include "addstar.h"
    22# include "2mass.h"
     3
     4// XXX check to see if desired output format is PS1_V1 or later?  (use 16bit version if not?)
    35
    46// fill in the data for a JHK triplet star.  takes a pointer to the start of the line the
     
    171173
    172174  switch (qual) {
    173     case 'X': star[0].measure.photFlags |= 0x0000; break;
    174     case 'U': star[0].measure.photFlags |= 0x0001; break;
    175     case 'F': star[0].measure.photFlags |= 0x0002; break;
    176     case 'E': star[0].measure.photFlags |= 0x0003; break;
    177     case 'A': star[0].measure.photFlags |= 0x0004; break;
    178     case 'B': star[0].measure.photFlags |= 0x0005; break;
    179     case 'C': star[0].measure.photFlags |= 0x0006; break;
    180     case 'D': star[0].measure.photFlags |= 0x0007; break;
     175    case 'A': star[0].measure.photFlags |= 0x00000001; break; // was: 0x0004
     176    case 'B': star[0].measure.photFlags |= 0x00000002; break; // was: 0x0005
     177    case 'C': star[0].measure.photFlags |= 0x00000004; break; // was: 0x0006
     178    case 'D': star[0].measure.photFlags |= 0x00000008; break; // was: 0x0007
     179    case 'E': star[0].measure.photFlags |= 0x00000010; break; // was: 0x0003
     180    case 'F': star[0].measure.photFlags |= 0x00000020; break; // was: 0x0002
     181    case 'U': star[0].measure.photFlags |= 0x00000040; break; // was: 0x0001
     182    case 'X': star[0].measure.photFlags |= 0x00000080; break; // was: 0x0000
    181183    default:
    182184      fprintf (stderr, "error!\n");
     
    189191
    190192  switch (qual) {
    191     case '0': star[0].measure.photFlags |= 0x0000; break;
    192     case '1': star[0].measure.photFlags |= 0x0010; break;
    193     case '2': star[0].measure.photFlags |= 0x0020; break;
    194     case '3': star[0].measure.photFlags |= 0x0030; break;
    195     case '4': star[0].measure.photFlags |= 0x0040; break;
    196     case '6': star[0].measure.photFlags |= 0x0050; break;
    197     case '9': star[0].measure.photFlags |= 0x0060; break;
     193    case '0': star[0].measure.photFlags |= 0x00000100; break; // was: 0x0000
     194    case '1': star[0].measure.photFlags |= 0x00000200; break; // was: 0x0010
     195    case '2': star[0].measure.photFlags |= 0x00000400; break; // was: 0x0020
     196    case '3': star[0].measure.photFlags |= 0x00000800; break; // was: 0x0030
     197    case '4': star[0].measure.photFlags |= 0x00001000; break; // was: 0x0040
     198    case '6': star[0].measure.photFlags |= 0x00002000; break; // was: 0x0050
     199    case '9': star[0].measure.photFlags |= 0x00004000; break; // was: 0x0060
    198200    default:
    199201      fprintf (stderr, "error!\n");
     
    206208
    207209  switch (qual) {
    208     case 'p': star[0].measure.photFlags |= 0x0000; break;
    209     case 'c': star[0].measure.photFlags |= 0x0100; break;
    210     case 'd': star[0].measure.photFlags |= 0x0200; break;
    211     case 's': star[0].measure.photFlags |= 0x0300; break;
    212     case 'b': star[0].measure.photFlags |= 0x0400; break;
    213     case '0': star[0].measure.photFlags |= 0x0500; break;
     210    case 'p': star[0].measure.photFlags |= 0x00010000; break; // was: 0x0000
     211    case 'c': star[0].measure.photFlags |= 0x00020000; break; // was: 0x0100
     212    case 'd': star[0].measure.photFlags |= 0x00040000; break; // was: 0x0200
     213    case 's': star[0].measure.photFlags |= 0x00080000; break; // was: 0x0300
     214    case 'b': star[0].measure.photFlags |= 0x00010000; break; // was: 0x0400
     215    case '0': star[0].measure.photFlags |= 0x00020000; break; // was: 0x0500
    214216    default:
    215217      fprintf (stderr, "error!\n");
     
    222224
    223225  switch (qual) {
    224     case '0': star[0].measure.photFlags &= ~0x0008; break;
    225     case '1': star[0].measure.photFlags &= ~0x0008; break;
    226     default:  star[0].measure.photFlags |=  0x0008; break;
     226    case '0': star[0].measure.photFlags &= ~0x00300000; break; // was: ~0x0008
     227    case '1': star[0].measure.photFlags |=  0x00100000; break; // was: ~0x0008
     228    default:  star[0].measure.photFlags |=  0x00200000; break; // was:  0x0008
    227229  }     
    228230  return (TRUE);
     
    232234
    233235  switch (qual) {
    234     case '0': star[0].measure.photFlags &= ~0x0080; break;
    235     case '1': star[0].measure.photFlags &= ~0x0080; break;
    236     default: 
    237       star[0].measure.photFlags |= 0x0080;
     236    case '0': star[0].measure.photFlags &= ~0x00c00000; break; // was: ~0x0080
     237    case '1': star[0].measure.photFlags |=  0x00400000; break; // was: ~0x0080
     238    default:  star[0].measure.photFlags |=  0x00800000;        // was:  0x0080
    238239      star[0].measure.extNsigma = 100.0;
    239240      break;
     
    245246
    246247  switch (qual) {
    247     case '0': star[0].measure.photFlags &= ~0x0800; break;
    248     case '1': star[0].measure.photFlags &= ~0x0800; break;
    249     default:  star[0].measure.photFlags |=  0x0800; break;
     248    case '0': star[0].measure.photFlags &= ~0x03000000; break; // was: ~0x0800
     249    case '1': star[0].measure.photFlags |=  0x01000000; break; // was: ~0x0800
     250    default:  star[0].measure.photFlags |=  0x02000000; break; // was:  0x0800
    250251  }     
    251252  return (TRUE);
     
    255256
    256257  switch (qual) {
    257     case '0': star[0].measure.photFlags &= ~0x1000; break;
    258     case '1': star[0].measure.photFlags &= ~0x1000; break;
    259     default:  star[0].measure.photFlags |=  0x1000; break;
     258    case '0': star[0].measure.photFlags &= ~0x0c000000; break; // was: ~0x1000
     259    case '1': star[0].measure.photFlags |=  0x04000000; break; // was: ~0x1000
     260    default:  star[0].measure.photFlags |=  0x08000000; break; // was:  0x1000
    260261  }     
    261262  return (TRUE);
     
    265266
    266267  switch (qual) {
    267     case '0': star[0].measure.photFlags &= ~0x2000; break;
    268     case '1': star[0].measure.photFlags |=  0x2000; break;
     268    case '0': star[0].measure.photFlags &= ~0x10000000; break; // was: ~0x2000
     269    case '1': star[0].measure.photFlags |=  0x10000000; break; // was:  0x2000
    269270    default:  abort();
    270271  }     
     
    272273}
    273274
     275// unused photFlags:
     276// 0x0000.8000
     277// 0x0004.0000
     278// 0x0008.0000
     279// 0x2000.0000
     280// 0x4000.0000
     281// 0x8000.0000
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/addstar/src/sky_tessalation.c

    r21508 r23352  
    1111  sky_tessellation_init (scale);
    1212
    13   if (mode == SQUARES) {
    14     sky_tessellation_squares (db, level, Nmax);
    15     return TRUE;
    16   }
    17 
    18   if (mode == TRIANGLES) {
    19     sky_tessellation_triangles (db, level, Nmax);
    20     return TRUE;
    21   }
    22 
    23   if (mode == LOCAL) {
    24     sky_tessellation_local (db, level, Nmax);
    25     return TRUE;
     13  switch (mode) {
     14    case SQUARES:
     15      sky_tessellation_squares (db, level, Nmax);
     16      return TRUE;
     17    case TRIANGLES:
     18      sky_tessellation_triangles (db, level, Nmax);
     19      return TRUE;
     20    case LOCAL:
     21      sky_tessellation_local (db, level, Nmax);
     22      return TRUE;
     23    case RINGS:
     24      sky_tessellation_rings (db, level, Nmax);
     25      return TRUE;
     26    default:
     27      break;
    2628  }
    2729
     
    222224
    223225  free (image);
     226  return (TRUE);
     227}
     228
     229// the RINGS tessellation uses the declination zones proposed by Tamas Budavari
     230// we generate projects on uniform rings of constant dec height
     231int sky_tessellation_rings (FITS_DB *db, int level, int Nmax) {
     232
     233  int j, nDEC, Nimage, Nring;
     234  float dec, dDEC;
     235  SkyRectangle *ring;
     236  Image *image;
     237
     238  // The tessellation has one input parameter: the approximate cell size.  Starting with
     239  // the cell size, determine the optimal projection cell height (dDEC) that results in an
     240  // integer number of dec zones between -90 and +90
     241
     242  // in fact, we place a single image on each pole, so the real range of dec is 180.0 - CELLSIZE:
     243
     244  nDEC = (180.0 - CELLSIZE) / CELLSIZE;
     245  dDEC = (180.0 - CELLSIZE) / nDEC;
     246  nDEC += 2;
     247
     248  // a test
     249  // for (dec = 0.0 + 0.5*dDEC; dec < +90.0; dec += dDEC) {
     250
     251  // generate the a collection of rectangles for each ring
     252  for (dec = -90.0; dec < +90.0 + 0.5*dDEC; dec += dDEC) {
     253
     254    ring = sky_rectangle_ring (dec, dDEC, &Nring);
     255    if (!ring) continue;
     256
     257    // subdivide each image (Nx x Ny subcells)
     258    Nimage = NX_SUB*NY_SUB*Nring;
     259    ALLOCATE (image, Image, Nimage);
     260    for (j = 0; j < Nring; j++) {
     261      // convert the SkyRectangles to Images for output
     262      sky_subdivide_image (&image[j*NX_SUB*NY_SUB], &ring[j], NX_SUB, NY_SUB);
     263    }
     264
     265    /* add the new images and save */
     266    dvo_image_addrows (db, image, Nimage);
     267    SetProtect (TRUE);
     268    dvo_image_update (db, VERBOSE);
     269    SetProtect (FALSE);
     270    dvo_image_clear_vtable (db);
     271   
     272    free (ring);
     273    free (image);
     274  }   
    224275  return (TRUE);
    225276}
     
    480531
    481532  return (TRUE);
     533}
     534
     535// define the parameters of a single sky projection center
     536SkyRectangle *sky_rectangle_ring (float dec, float dDEC, int *nring) {
     537
     538  int i, NX, NY, nRA;
     539  SkyRectangle *ring;
     540  float theta, dRA;
     541
     542  // 'dec' is a guess at the center of the cell; in fact, we need to choose decLower and
     543  // decUpper to ensure complete overlap of the cells
     544
     545  // we can determine the 'lower' bound (bound closest to the equator):
     546  float decLower = (dec > 0.0) ? dec - 0.5*dDEC : dec + 0.5*dDEC;
     547
     548  // solve for actual cellsize (\theta):  tan(\delta_{n+1} - \theta/2) = tan(\delta_n + \theta/2)cos(\alpha_n / 2)
     549  float decUpper = (dec > 0.0) ? dec + dDEC : dec - dDEC;
     550
     551  if (fabs(dec) + 0.5*dDEC > 90.0) {
     552    // onPole = TRUE;
     553    theta = dDEC;
     554    nRA = 1;
     555    dRA = theta / cos(decLower*RAD_DEG); // make a square at the pole
     556  } else {
     557    // onPole = FALSE;
     558    // Subdivide the 'lower' bound into an integer number of segments:
     559    nRA = cos(RAD_DEG*decLower) * 360.0 / CELLSIZE; // CELLSIZE is a projection size
     560    dRA = 360.0 / nRA;                         // dRA is a size in RA degrees == \alpha_n
     561
     562    // tan(decUpper - theta/2) = tan(dec + theta/2) cos(dRA / 2);
     563
     564    // we solve this equation for theta (fairly ugly: expand the tangents into sin/cos, expand the
     565    // sum-of-angle sine and cosine, multiply through, convert via half-angle formulae and write
     566    // as a quadratic expression in sine(theta/2)
     567 
     568    float sd1 = sin(RAD_DEG*decUpper);
     569    float cd1 = cos(RAD_DEG*decUpper);
     570    float sd2 = sin(RAD_DEG*dec);
     571    float cd2 = cos(RAD_DEG*dec);
     572    float   k = cos(RAD_DEG*dRA/2.0);
     573
     574    float c1 =  (sd1*cd2 + sd2*cd1)*(1.0 - k);
     575    float c2 =  (sd1*cd2 - sd2*cd1)*(1.0 + k);
     576    float c3 = -(sd1*sd2 + cd1*cd2)*(1.0 + k);
     577
     578    float A = SQ(c3) + SQ(c2);
     579    float B = 2*c1*c3;
     580    float C = SQ(c1) - SQ(c2);
     581
     582    float arg = SQ(B) - 4.0*A*C;
     583
     584    float root;
     585
     586    if (dec >= 0.0) {
     587      root = (-B + sqrt (arg)) / (2.0*A);
     588      theta = +DEG_RAD*asin(root);
     589    } else {
     590      root = (-B - sqrt (arg)) / (2.0*A);
     591      theta = -DEG_RAD*asin(root);
     592    }
     593
     594    // the negative solution yields a negative cellsize
     595    // float root2 = (-B - sqrt (arg)) / (2.0*A);
     596    // float theta2 = DEG_RAD*asin(root2);
     597
     598    // test lines:
     599    // float r1 = tan(RAD_DEG*(decUpper - 0.5*theta1));
     600    // float r2 = tan(RAD_DEG*(dec + 0.5*theta1));
     601    // fprintf (stdout, "%f %f  %f  %f  %f %f  %f %f  %f %f %f\n", dec, decUpper, dRA, arg, root1, root2, theta1, theta2, r1, r2, k*r2);
     602  }
     603  fprintf (stdout, "%f %f  %f x %f (%d)\n", dec, decUpper, dRA, theta, nRA);
     604
     605  // I think we need to return the value of dec for the next ring, but I am not sure...
     606
     607  ALLOCATE (ring, SkyRectangle, nRA);
     608
     609  for (i = 0; i < nRA; i++) {
     610    memset (&ring[i], 0, sizeof(SkyRectangle));
     611    memset (&ring[i].coords, 0, sizeof(Coords));
     612    ring[i].coords.crval1 = i*dRA;
     613    ring[i].coords.crval2 = dec;
     614
     615    ring[i].coords.pc1_1 = +1.0;
     616    ring[i].coords.pc1_2 = +0.0;
     617    ring[i].coords.pc2_1 = -0.0;
     618    ring[i].coords.pc2_2 = +1.0;
     619 
     620    // range values are in projected degrees
     621    NX = cos(decLower*RAD_DEG) * dRA   * 3600.0 / SCALE;
     622    NY =                         theta * 3600.0 / SCALE;
     623
     624    // crpix1,crpix2 is the projection center
     625    ring[i].coords.crpix1 = 0.5*NX;
     626    ring[i].coords.crpix2 = 0.5*NY;
     627
     628    ring[i].coords.cdelt1 = SCALE / 3600.0;
     629    ring[i].coords.cdelt2 = SCALE / 3600.0;
     630
     631    strcpy (ring[i].coords.ctype, "DEC--TAN");
     632
     633    ring[i].NX = NX;
     634    ring[i].NY = NY;
     635    ring[i].photcode = 1; // this needs to be set more sensibly
     636
     637
     638    // fprintf (stderr, "%f %f  : %f %f\n",
     639    // ring[i].coords.crval1, ring[i].coords.crval2,
     640    // ring[i].coords.crpix1, ring[i].coords.crpix2);
     641  }
     642
     643  *nring = nRA;
     644  return (ring);
    482645}
    483646
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/libdvo

    • Property svn:ignore
      •  

        old new  
        1 lib
         1
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/libdvo/lib

    • Property svn:ignore
      •  

        old new  
        1 *.linux
        2 *.lin64
        3 *.sol
        4 *.sun
        5 *.sid
        6 *.hp
        7 *.irix
        8 *.darwin.dylib
        9 *.darwin_x86.dylib
         1*.a
         2*.so
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/libfits/lib

    • Property svn:ignore
      •  

        old new  
        1 *.linux
        2 *.lin64
        3 *.sol
        4 *.sun
        5 *.sid
        6 *.hp
        7 *.irix
        8 *.darwin.dylib
        9 *.darwin_x86.dylib
         1*.a
         2*.so
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/libkapa/lib

    • Property svn:ignore
      •  

        old new  
        1 *.linux
        2 *.lin64
        3 *.sol
        4 *.sun
        5 *.sid
        6 *.hp
        7 *.irix
        8 *.darwin.dylib
        9 *.darwin_x86.dylib
         1*.a
         2*.so
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/libohana/lib

    • Property svn:ignore
      •  

        old new  
        1 *.linux
        2 *.lin64
        3 *.sol
        4 *.sun
        5 *.sid
        6 *.hp
        7 *.irix
        8 *.darwin.dylib
        9 *.darwin_x86.dylib
         1*.a
         2*.so
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/libohana/src/CommOps.c

    r8385 r23352  
    1414    return (status);
    1515  }
     16  // fprintf (stderr, "resp: %s\n", command.buffer);
    1617
    1718  /* buffer contains an EOL NULL, we can just sscan it */
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/libtap/lib

    • Property svn:ignore
      •  

        old new  
        1 *.linux
        2 *.lin64
        3 *.sol
        4 *.sun
        5 *.sid
        6 *.hp
        7 *.irix
        8 *.darwin.dylib
        9 *.darwin_x86.dylib
         1*.a
         2*.so
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/dimm/Analysis.c

    r2598 r23352  
    8686        }
    8787
     88/* find contiguous trigger pixels in row from starting point */
     89
     90int fillrow (float *buffer, int Nx, int offset, int sx, int *xs, int *xe) {
     91
     92  trigger = FALSE;
     93  for (i = sx, pix = offset + i; buffer[pix] && (i < Nx); i++, pix++) {
     94    addpix (pix);
     95    buffer[pix] = 0;
     96    trigger = TRUE;
     97    *xe = i;
     98  }
     99  for (i = sx - 1, pix = offset + i; (i >= 0) && buffer[pix]; i--, pix--) {
     100    addpix (pix);
     101    buffer[pix] = 0;
     102    trigger = TRUE;
     103    *xs = i;
     104  }
     105  return (trigger);
     106}
     107
     108static int Npix = 0;
     109static int *Pix = (int *) NULL;
     110
     111addpix (int pix) {
     112  Npix ++;
     113  if (Pix == (int *) NULL) {
     114    ALLOCATE (Pix, int, MAX (1, Npix));
     115  } else {
     116    REALLOCATE (Pix, int, MAX (1, Npix));
     117  }   
     118  Pix[Npix - 1] = pix;
     119}
     120
     121clearpix () {
     122  Npix = 0;
     123  REALLOCATE (Pix, int, 1);
     124}
     125
     126statpix (double *x, double *y, float *buffer, int Nx) {
     127
     128  int X, Y;
     129  double Sx, Sy, So;
     130
     131  So = Sx = Sy = 0;
     132  for (i = 0; i < Npix; i++) {
     133    Y = pix / Nx;
     134    X = pix % Nx;
     135    So += buffer[pix];
     136    Sx += X * buffer[pix];
     137    Sy += Y * buffer[pix];
     138  }
     139  *x = Sx / So;
     140  *y = Sy / So;
     141}
     142
     143/* find stars:
     144   - binarize @ threshold
     145   - find all contiguous blobs
     146   - find geom center of each blob
     147*/
     148
     149
     150
     151/*
     152
     153.....................
     154....x................
     155...xxx...............
     156..........xxx..........
     157.........xx..........
     158.....................
     159.....................
     160.....................
     161.....................
     162.....................
     163
     164
     165 */
     166
    88167# endif
    89168
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/dimm/Makefile

    r17283 r23352  
    2626$(SRC)/init.$(ARCH).o                   \
    2727$(SRC)/dimm.$(ARCH).o                   \
    28 $(SRC)/camera.$(ARCH).o         \
     28$(SRC)/camera_cmds.$(ARCH).o            \
    2929$(SRC)/findstars.$(ARCH).o              \
    30 $(SRC)/telescope.$(ARCH).o   \
     30$(SRC)/telescope_cmds.$(ARCH).o   \
    3131$(SRC)/version.$(ARCH).o
    3232
     
    6464.PHONY: dimm
    6565
    66 # are these used or replaced?
    67 # $(SRC)/analysis.$(ARCH).o             \
     66# these have not been finished: should be used for analysis of the extracted images
    6867# $(SRC)/Analysis.$(ARCH).o            \
    6968# $(SRC)/Image.$(ARCH).o                \
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/dimm/camera_cmds.c

  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/dimm/telescope_cmds.c

  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/lib

    • Property svn:ignore set to
      *.a
      *.so
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/pantasks/CheckTasks.c

    r15872 r23352  
    4848    // add random offset between 0 and 5% of exec_period
    4949    // XXX this should be optional
    50     fuzz = 0.05*task[0].exec_period*drand48() + 1e-6*task[0].last.tv_usec;
     50    fuzz = 0.1*task[0].exec_period*drand48();
    5151    task[0].last.tv_usec = 1e6*(fuzz - (int)fuzz);
    5252    task[0].last.tv_sec += (int) fuzz;
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/pantasks/task_threads.c

    r15791 r23352  
    22
    33/** things related to CheckTasks **/
     4void ResetTaskTimers ();
    45
    56static int CheckTasksRun = FALSE;
    67
    78void CheckTasksSetState (int state) {
     9  if (state && !CheckTasksRun) {
     10    ResetTaskTimers ();
     11  }
    812  CheckTasksRun = state;
    913}
     
    5155// timeout.  this enforces a certain granularity in the task creation, but prevents the task
    5256// thread from driving the load up to silly levels.
     57
     58// reset all of the task timers, with a bit of fuzz.  this is called
     59// whenever we transition from 'stop' to 'run'
     60void ResetTaskTimers () {
     61
     62  Task *task;
     63  struct timeval now;
     64  float fuzz;
     65
     66  // get the current time
     67  gettimeofday (&now, NULL);
     68
     69  // check all tasks
     70  while ((task = NextTask ()) != NULL) {
     71    task[0].last.tv_usec = now.tv_usec;
     72    task[0].last.tv_sec  = now.tv_sec;
     73
     74    // add random offset between 0 and 10% of exec_period
     75    // XXX this should be optional
     76    fuzz = task[0].exec_period*drand48();
     77    task[0].last.tv_usec += 1e6*(fuzz - (int)fuzz);
     78    task[0].last.tv_sec += (int) fuzz;
     79
     80    // gprint (GP_LOG, "fuzz: %f, last: %d %d\n", fuzz, task[0].last.tv_sec, task[0].last.tv_usec);
     81  }
     82  return;
     83}
  • branches/cnb_branches/cnb_branch_20090301/Ohana/src/opihi/pcontrol/CheckIdleHost.c

    r22675 r23352  
    4040    host[0].job = (struct Job *) job;
    4141
    42     if (logfile) fprintf (logfile, "start needhost %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]);
     42    // if (logfile) fprintf (logfile, "start needhost %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]);
    4343
    4444    /* take the job off the stack and unlock the stack */
     
    6060    host[0].job = (struct Job *) job;
    6161
    62     if (logfile) fprintf (logfile, "start wanthost %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]);
     62    // if (logfile) fprintf (logfile, "start wanthost %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]);
    6363
    6464    /* take the job off the stack and unlock the stack */
     
    7878    host[0].job = (struct Job *) job;
    7979
    80     if (logfile) fprintf (logfile, "start  anyhost %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]);
     80    // if (logfile) fprintf (logfile, "start  anyhost %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]);
    8181
    8282    /* take the job off the stack and unlock the stack */
Note: See TracChangeset for help on using the changeset viewer.