IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14590


Ignore:
Timestamp:
Aug 21, 2007, 2:10:20 PM (19 years ago)
Author:
eugene
Message:

convert str_to_time and related functions to ohana_...; various cleanups for -Wall -Werror

Location:
trunk/Ohana/src
Files:
135 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/LoadStars.c

    r12332 r14590  
    9797  } else {
    9898    double jd;
    99     jd = sec_to_jd (image[0].tzero);
     99    jd = ohana_sec_to_jd (image[0].tzero);
    100100    image[0].sidtime  = ohana_lst (jd, Longitude);
    101101  }
  • trunk/Ohana/src/addstar/src/ReadImageHeader.c

    r12840 r14590  
    126126  } else {
    127127    double jd;
    128     jd = sec_to_jd (image[0].tzero);
     128    jd = ohana_sec_to_jd (image[0].tzero);
    129129    image[0].sidtime  = ohana_lst (jd, Longitude);
    130130  }
  • trunk/Ohana/src/addstar/src/args.c

    r13324 r14590  
    9191    time_t tmp;
    9292    remove_argument (N, &argc, argv);
    93     if (!str_to_time (argv[N], &tmp)) {
     93    if (!ohana_str_to_time (argv[N], &tmp)) {
    9494      fprintf (stderr, "syntax error in time\n");
    9595      exit (1);
  • trunk/Ohana/src/addstar/src/args_client.c

    r7691 r14590  
    5454    time_t tmp;
    5555    remove_argument (N, &argc, argv);
    56     if (!str_to_time (argv[N], &tmp)) {
     56    if (!ohana_str_to_time (argv[N], &tmp)) {
    5757      fprintf (stderr, "syntax error in time\n");
    5858      exit (1);
  • trunk/Ohana/src/addstar/src/calibrate.c

    r13141 r14590  
    127127      SaveCalibration (Mcal, new[0].dM, CalM0, dCalM, Minst, Nstar);
    128128      if ((DUMP != NULL) && !strcmp (DUMP, "cal")) {
    129         fprintf (stdout, "cal-match : %10.6f %10.6f : %7.4f %6.4f  %7.4f %6.4f   %7.4f : %7.4f %7.4f\n", average[0].R, average[0].D, Mcal, new[0].dM, CalM0, dCalM, Minst, airmass, color);
     129        fprintf (stdout, "cal-match : %10.6f %10.6f : %7.4f %6.4f  %7.4f %6.4f   %7.4f : %7.4f %7.4f\n", average[0].R, average[0].D, Mcal, new[0].dM, CalM0, dCalM, Minst, new[0].airmass, color);
    130130      }
    131131      return;
  • trunk/Ohana/src/addstar/src/get2mass_ops.c

    r12732 r14590  
    148148  if (end == NULL) Shutdown ("format error in 2mass");
    149149  *end = 0;
    150   time = date_to_sec (ptr);
     150  time = ohana_date_to_sec (ptr);
    151151  *end = '|';
    152152
     
    167167  *end = 0;
    168168  jd = strtod (p, NULL);
    169   time = jd_to_sec (jd);
     169  time = ohana_jd_to_sec (jd);
    170170  *end = '|';
    171171
  • trunk/Ohana/src/addstar/src/gettycho.c

    r14401 r14590  
    5353  ALLOCATE (buffer, char, NITEM*NBYTE);
    5454
    55   TychoEpoch = date_to_sec ("1991/04/02,07:30:00");
     55  TychoEpoch = ohana_date_to_sec ("1991/04/02,07:30:00");
    5656
    5757  for (i = 0; i < skylist[0].Nregions; i++) {
  • trunk/Ohana/src/addstar/src/getusnob.c

    r8518 r14590  
    108108    }
    109109
    110     USNOepoch = date_to_sec ("2000/01/01,00:00:00");
     110    USNOepoch = ohana_date_to_sec ("2000/01/01,00:00:00");
    111111
    112112    buf = buffer;
  • trunk/Ohana/src/delstar/src/args.c

    r4864 r14590  
    6161    remove_argument (N, argc, argv);
    6262
    63     if (!str_to_time (argv[N], &START)) usage ();
     63    if (!ohana_str_to_time (argv[N], &START)) usage ();
    6464    remove_argument (N, argc, argv);
    6565
    6666    /* interpret second value */
    67     if (str_to_dtime (argv[N], &trange)) {
     67    if (ohana_str_to_dtime (argv[N], &trange)) {
    6868      if (trange < 0) {
    6969        END = START;
     
    7575      goto goodtime;
    7676    }
    77     if (str_to_time (argv[N], &END)) {
     77    if (ohana_str_to_time (argv[N], &END)) {
    7878      if (START > END) {
    7979        tmp   = START;
  • trunk/Ohana/src/delstar/src/delete_imagename.c

    r12725 r14590  
    8383  gfits_modify (&db[0].header, "NIMAGES", "%d", 1, Noutimage);
    8484  db[0].theader.Naxis[1] = Noutimage;
    85   db[0].ftable.buffer = outimage;
     85  db[0].ftable.buffer = (char *) outimage;
    8686
    8787  dvo_image_save (db, VERBOSE);
  • trunk/Ohana/src/gastro/include/gastro.h

    r8514 r14590  
    11# include <ohana.h>
    22# include <dvo.h>
     3# include <kapa.h>
    34
    45double DEFAULT_RADIUS;
     
    4748double ASEC_PIX;
    4849char ROUGH_ASTROMETRY[64];
    49 
    50 typedef struct {
    51   double xmin, xmax, ymin, ymax;
    52   int style, ptype, ltype, etype, color;
    53   double lweight, size;
    54 } Graphdata;
    5550
    5651/* simple structure to carry around data on an array of stars */
  • trunk/Ohana/src/gastro/src/gstars.c

    r7080 r14590  
    8282        exit (1);
    8383      }
    84       dms_to_ddd (&coords[0].crval1, line);
     84      ohana_dms_to_ddd (&coords[0].crval1, line);
    8585      coords[0].crval1 = coords[0].crval1 * 15.0;
    8686
     
    9090        exit (1);
    9191      }
    92       dms_to_ddd (&coords[0].crval2, line);
     92      ohana_dms_to_ddd (&coords[0].crval2, line);
    9393    }
    9494  }
  • trunk/Ohana/src/gastro/src/plotstuff.c

    r13479 r14590  
    4646void PlotVector (int Npts, float *vect, int mode, int N) {
    4747
    48   int Nbytes;
    49 
    5048  if (Npts < 1) return;
    5149  active = N;
    52   KapaPlotVector (Xgraph[N], Npts, vect);
     50
     51  switch (mode) {
     52    case 0:
     53      KapaPlotVector (Xgraph[N], Npts, vect, "x");
     54      break;
     55    case 1:
     56      KapaPlotVector (Xgraph[N], Npts, vect, "y");
     57      break;
     58    default:
     59      abort();
     60  }
    5361}
    5462
  • trunk/Ohana/src/gastro2/include/gastro2.h

    r8513 r14590  
    11# include <ohana.h>
    22# include <dvo.h>
     3# include <kapa.h>
    34
    45typedef struct {
     
    123124char LONEOS_REGION_FILE[256];
    124125
    125 typedef struct {
    126   double xmin, xmax, ymin, ymax;
    127   int style, ptype, ltype, etype, ebar, color;
    128   double lweight, size;
    129 } Graphdata;
    130 
    131126StarData *rtext (FILE *f, int *nstars);
    132127StarData *rfits (FILE *f, int *nstars);
  • trunk/Ohana/src/gastro2/src/gstars2.c

    r7962 r14590  
    7272    FoundAstrom = TRUE;
    7373    FoundAstrom &= gfits_scan (&Target[0].header, "RA", "%s", 1, line);
    74     dms_to_ddd (&Target[0].coords.crval1, line);
     74    ohana_dms_to_ddd (&Target[0].coords.crval1, line);
    7575    Target[0].coords.crval1 = Target[0].coords.crval1 * 15.0;
    7676    FoundAstrom &= gfits_scan (&Target[0].header, "DEC", "%s", 1, line);
    77     dms_to_ddd (&Target[0].coords.crval2, line);
     77    ohana_dms_to_ddd (&Target[0].coords.crval2, line);
    7878  }
    7979
  • trunk/Ohana/src/gastro2/src/plotstuff.c

    r13479 r14590  
    4646void PlotVector (int Npts, float *vect, int mode, int N) {
    4747
    48   int Nbytes;
    49 
    5048  if (Npts < 1) return;
    5149  active = N;
    52   KapaPlotVector (Xgraph[N], Npts, vect);
     50
     51  switch (mode) {
     52    case 0:
     53      KapaPlotVector (Xgraph[N], Npts, vect, "x");
     54      break;
     55    case 1:
     56      KapaPlotVector (Xgraph[N], Npts, vect, "y");
     57      break;
     58    default:
     59      abort();
     60  }
    5361}
    5462
  • trunk/Ohana/src/getstar/include/dvoImageOverlaps.h

    r14496 r14590  
    3636int GetFileMode (Header *header);
    3737int edge_check (double *x1, double *y1, double *x2, double *y2);
     38double opening_angle (double x1, double y1, double x2, double y2, double x3, double y3);
  • trunk/Ohana/src/getstar/src/MatchImages.c

    r13825 r14590  
    77int *MatchImage (Image *dbImages, int NdbImages, Image *image, int *Nmatch) {
    88 
    9   int i, j, k, N, addtolist, status;
     9  int i, j, N, addtolist, status;
    1010  int NMATCH, nmatch, *match;
    1111  Coords tcoords;
    12   double r, d, x, y;
     12  double r, d;
    1313  double Xi[4], Yi[4], Xo[4], Yo[4];  /* image and original corners */
    1414  double Xmin, Xmax, Ymin, Ymax;
  • trunk/Ohana/src/getstar/src/ReadImageFiles.c

    r13890 r14590  
    44
    55  int i, j, N, Nfile, Nheader, NHEADER, Nimage, NIMAGE;
    6   int Nskip, Nhead, Ndata, done, status, mode, NinStars;
     6  int Nskip, Nhead, Ndata, done, status, mode;
    77  char **file, *name;
    88  FILE *f;
  • trunk/Ohana/src/getstar/src/ReadImageHeader.c

    r14574 r14590  
    44int ReadImageHeader (Header *header, Image *image) {
    55
    6   int Nastro, ccdnum, hour, min, Nx, Ny;
    7   double tmp, sec, Cerror;
    8   char *c, photname[64], line[80];
     6  int Nastro, Nx, Ny;
     7  double tmp;
    98
    109  /* get astrometry information */
  • trunk/Ohana/src/getstar/src/SelectImages.c

    r12840 r14590  
    44int *SelectImages (char *filename, Image *images, int Nimages, int *Nmatch) {
    55 
    6   int i, Nchar, status;
     6  int i, Nchar;
    77  int NMATCH, nmatch, *match;
    88
  • trunk/Ohana/src/getstar/src/WriteImageFITS.c

    r13093 r14590  
    88  int Nstars;
    99  Header header;
    10   Matrix matrix;
    1110  Header theader;
    1211  FTable table;
  • trunk/Ohana/src/getstar/src/WriteImages.c

    r12840 r14590  
    44int WriteImages (char *filename, Image *images, int Nimages, int *matches, int Nmatches) {
    55 
    6   int i, N, status;
    7   int NMATCH, nmatch, *match;
     6  int i, N;
    87  int nWRP, newWRP, isWRP;
    98  FILE *f;
  • trunk/Ohana/src/getstar/src/args.c

    r9630 r14590  
    5959    remove_argument (N, &argc, argv);
    6060    if (argc != 5) help();
    61     str_to_radec (&R, &D, argv[N+0], argv[N+1]);
     61    ohana_str_to_radec (&R, &D, argv[N+0], argv[N+1]);
    6262    REGION.Rmin = R;
    6363    REGION.Dmin = D;
     
    6565    remove_argument (N, &argc, argv);
    6666
    67     str_to_radec (&R, &D, argv[N+0], argv[N+1]);
     67    ohana_str_to_radec (&R, &D, argv[N+0], argv[N+1]);
    6868    REGION.Rmax = R;
    6969    REGION.Dmax = D;
     
    8787    remove_argument (N, &argc, argv);
    8888    if (argc != 4) help();
    89     str_to_radec (&R, &D, argv[N+0], argv[N+1]);
     89    ohana_str_to_radec (&R, &D, argv[N+0], argv[N+1]);
    9090    radius = atof(argv[N+2]);
    9191    REGION.Rmin = R - radius / cos(D*RAD_DEG);
  • trunk/Ohana/src/getstar/src/dvoImageExtract.c

    r12840 r14590  
    33int main (int argc, char **argv) {
    44
    5   int i, Nimages, status;
     5  int Nimages, status;
    66  int Nmatches, *matches;
    77  Image *images;
    8   Catalog catalog;
    98  FITS_DB db;
    109
  • trunk/Ohana/src/getstar/src/dvoImageOverlaps.c

    r12774 r14590  
    66  int Nmatches, *matches;
    77  Image *images, *dbImages;
    8   Catalog catalog;
    98  FITS_DB db;
    109
  • trunk/Ohana/src/imregister/base/misc.c

    r12332 r14590  
    3535   
    3636    /* tstart */
    37     if (!str_to_time (argv[Na], &tstart[N])) {
     37    if (!ohana_str_to_time (argv[Na], &tstart[N])) {
    3838      return (FALSE);
    3939    }
     
    4141    /* interpret second value */
    4242    remove_argument (Na, argc, argv);
    43     if (str_to_dtime (argv[Na], &trange)) {
     43    if (ohana_str_to_dtime (argv[Na], &trange)) {
    4444      if (trange < 0) {
    4545        tstop[N]  = tstart[N];
     
    5151      goto goodvalue;
    5252    }
    53     if (str_to_time (argv[Na], &tstop[N])) {
     53    if (ohana_str_to_time (argv[Na], &tstop[N])) {
    5454      if (tstart[N] > tstop[N]) {
    5555        tmp     = tstart[N];
  • trunk/Ohana/src/imregister/base/parse_time.c

    r3509 r14590  
    1515    uppercase (JDKeyword);
    1616    warn_scan (header, JDKeyword, "%lf", 1, &jd);
    17     Nsec = jd_to_sec (jd);
     17    Nsec = ohana_jd_to_sec (jd);
    1818    return (Nsec);
    1919  }
     
    2323    uppercase (MJDKeyword);
    2424    warn_scan (header, MJDKeyword, "%lf", 1, &jd);
    25     Nsec = mjd_to_sec (jd);
     25    Nsec = ohana_mjd_to_sec (jd);
    2626    return (Nsec);
    2727  }
  • trunk/Ohana/src/imregister/detrend/args.detregister.c

    r6706 r14590  
    1818  if ((N = get_argument (argc, argv, "-time"))) {
    1919    remove_argument (N, &argc, argv);
    20     if (!str_to_time (argv[N], &descriptor[0].tstart)) {
     20    if (!ohana_str_to_time (argv[N], &descriptor[0].tstart)) {
    2121      fprintf (stderr, "syntax error\n");
    2222      return (FALSE);
    2323    }
    2424    remove_argument (N, &argc, argv);
    25     if (!str_to_time (argv[N], &descriptor[0].tstop)) {
     25    if (!ohana_str_to_time (argv[N], &descriptor[0].tstop)) {
    2626      fprintf (stderr, "syntax error\n");
    2727      return (FALSE);
  • trunk/Ohana/src/imregister/detrend/args.detsearch.c

    r12332 r14590  
    101101    remove_argument (N, &argc, argv);
    102102    bad  = get_argument (argc, argv, "-trange");
    103     bad &= str_to_time (argv[N], &base.tstart);
     103    bad &= ohana_str_to_time (argv[N], &base.tstart);
    104104    if (bad) {
    105105      fprintf (stderr, "ERROR: syntax error in -time\n");
     
    302302  valid_entry:
    303303    if (!strcasecmp (output.ModifyEntry, "tstart") || !strcasecmp (output.ModifyEntry, "tstop")) {
    304       if (!str_to_time (output.ModifyValue, &output.TimeValue)) {
     304      if (!ohana_str_to_time (output.ModifyValue, &output.TimeValue)) {
    305305        fprintf (stderr, "ERROR: invalid time %s\n", output.ModifyValue);
    306306        exit (1);
  • trunk/Ohana/src/imregister/detrend/imdef.c

    r7080 r14590  
    8888      exit (1);
    8989    }
    90     if (!str_to_time (line, &descriptor[0].tstart)) {
     90    if (!ohana_str_to_time (line, &descriptor[0].tstart)) {
    9191      fprintf (stderr, "ERROR: invalid time %s\n", line);
    9292      exit (1);
     
    9797      exit (1);
    9898    }
    99     if (!str_to_time (line, &descriptor[0].tstop)) {
     99    if (!ohana_str_to_time (line, &descriptor[0].tstop)) {
    100100      fprintf (stderr, "ERROR: invalid time %s\n", line);
    101101      exit (1);
  • trunk/Ohana/src/imregister/detrend/output.c

    r12332 r14590  
    8383     
    8484  /* add current date/time to header */
    85   str_to_time ("now", &tsecond);
    86   datestr = sec_to_date (tsecond);
     85  ohana_str_to_time ("now", &tsecond);
     86  datestr = ohana_sec_to_date (tsecond);
    8787  gfits_modify (&header,  "DATE", "%s", 1, datestr);
    8888  gfits_modify (&theader, "DATE", "%s", 1, datestr);
     
    151151    if ((p = strrchr (key, '.')) != (char *) NULL) *p = 0;
    152152
    153     startstr = sec_to_date (newdata[0].tstart);
    154     stopstr  = sec_to_date (newdata[0].tstop);
    155     regstr   = sec_to_date (newdata[0].treg);
     153    startstr = ohana_sec_to_date (newdata[0].tstart);
     154    stopstr  = ohana_sec_to_date (newdata[0].tstop);
     155    regstr   = ohana_sec_to_date (newdata[0].treg);
    156156    typestr  = get_type_name(newdata[0].type);
    157157    modestr  = get_mode_name(newdata[0].mode);
     
    212212    switch (output.TimeMode) {
    213213    case START:
    214       timestr = sec_to_date (detdata[i].tstart);
     214      timestr = ohana_sec_to_date (detdata[i].tstart);
    215215      break;
    216216    case STOP:
    217       timestr = sec_to_date (detdata[i].tstop);
     217      timestr = ohana_sec_to_date (detdata[i].tstop);
    218218      break;
    219219    case REG:
    220       timestr = sec_to_date (detdata[i].treg);
     220      timestr = ohana_sec_to_date (detdata[i].treg);
    221221      break;
    222222    default:
     
    275275
    276276  for (i = 0; i < Ncriteria; i++) {
    277     start = sec_to_date (criteria[i].tstart);
    278     stop  = sec_to_date (criteria[i].tstop);
     277    start = ohana_sec_to_date (criteria[i].tstart);
     278    stop  = ohana_sec_to_date (criteria[i].tstop);
    279279   
    280280    fprintf (stdout, "%19s %19s %7s %6s %s %6.1f\n",
  • trunk/Ohana/src/imregister/imphot/dumpfits.c

    r12332 r14590  
    7272
    7373  /* add current date/time to header */
    74   str_to_time ("now", &tsecond);
    75   datestr = sec_to_date (tsecond);
     74  ohana_str_to_time ("now", &tsecond);
     75  datestr = ohana_sec_to_date (tsecond);
    7676  gfits_modify (&header,  "DATE", "%s", 1, datestr);
    7777  gfits_modify (&theader, "DATE", "%s", 1, datestr);
     
    112112  for (i = 0; i < Nmatch; i++) {
    113113    subset   = &image[match[i]];
    114     startstr = sec_to_date (subset[0].tzero);
     114    startstr = ohana_sec_to_date (subset[0].tzero);
    115115    filtstr  = GetPhotcodeNamebyCode (subset[0].photcode);
    116116    zp       = subset[0].Mcal;
  • trunk/Ohana/src/imregister/imphot/output.c

    r12332 r14590  
    3232     
    3333    /* convert UNIX time to Elixir-style date string */
    34     timestr = sec_to_date (image[i].tzero);
     34    timestr = ohana_sec_to_date (image[i].tzero);
    3535     
    3636    /* convert photcode to filter name */
  • trunk/Ohana/src/imregister/imreg/cadc.c

    r12332 r14590  
    4747     
    4848  /* add current date/time to header */
    49   str_to_time ("now", &tsecond);
    50   datestr = sec_to_date (tsecond);
     49  ohana_str_to_time ("now", &tsecond);
     50  datestr = ohana_sec_to_date (tsecond);
    5151  gfits_modify (&header,  "DATE", "%s", 1, datestr);
    5252  gfits_modify (&theader, "DATE", "%s", 1, datestr);
  • trunk/Ohana/src/imregister/imreg/iminfo.c

    r7080 r14590  
    106106    if (RASexigKeyword[0] & DECSexigKeyword[0]) {
    107107      gfits_scan (&header, RASexigKeyword,  "%s", 1, line);
    108       dms_to_ddd (&tmp, line);
     108      ohana_dms_to_ddd (&tmp, line);
    109109      image[0].ra = 15*tmp;
    110110      gfits_scan (&header, DECSexigKeyword, "%s", 1, &line);
    111       dms_to_ddd (&tmp, line);
     111      ohana_dms_to_ddd (&tmp, line);
    112112      image[0].dec = tmp;
    113113    }
  • trunk/Ohana/src/imregister/imreg/output.c

    r12332 r14590  
    112112     
    113113  /* add current date/time to header */
    114   str_to_time ("now", &tsecond);
    115   datestr = sec_to_date (tsecond);
     114  ohana_str_to_time ("now", &tsecond);
     115  datestr = ohana_sec_to_date (tsecond);
    116116  gfits_modify (&header,  "DATE", "%s", 1, datestr);
    117117  gfits_modify (&theader, "DATE", "%s", 1, datestr);
     
    152152  for (i = 0; i < Nmatch; i++) {
    153153    subset = &image[match[i]];
    154     obsstr   = sec_to_date (subset[0].obstime);
    155     regstr   = sec_to_date (subset[0].regtime);
     154    obsstr   = ohana_sec_to_date (subset[0].obstime);
     155    regstr   = ohana_sec_to_date (subset[0].regtime);
    156156    typestr  = get_type_name(subset[0].type);
    157157    modestr  = get_mode_name(subset[0].mode);
     
    197197    modestr = get_mode_name (image[i].mode);
    198198    typestr = get_type_name (image[i].type);
    199     timestr = RegTimeMode ? sec_to_date (image[i].regtime) : sec_to_date (image[i].obstime);
     199    timestr = RegTimeMode ? ohana_sec_to_date (image[i].regtime) : ohana_sec_to_date (image[i].obstime);
    200200
    201201    if (CCDSeq) {
  • trunk/Ohana/src/imregister/photreg/output.c

    r12332 r14590  
    9999   
    100100  /* add current date/time to header */
    101   str_to_time ("now", &tsecond);
    102   datestr = sec_to_date ((unsigned int) tsecond);
     101  ohana_str_to_time ("now", &tsecond);
     102  datestr = ohana_sec_to_date ((unsigned int) tsecond);
    103103  gfits_modify (&header,  "DATE", "%s", 1, datestr);
    104104  gfits_modify (&theader, "DATE", "%s", 1, datestr);
     
    158158  for (i = 0; i < Nkeep; i++) {
    159159    newdata = &photdata[index[i]];
    160     startstr = sec_to_date (newdata[0].tstart);
    161     stopstr = sec_to_date (newdata[0].tstop);
     160    startstr = ohana_sec_to_date (newdata[0].tstart);
     161    stopstr = ohana_sec_to_date (newdata[0].tstop);
    162162    code    = GetPhotcodeNamebyCode (newdata[0].photcode);
    163163    photsys = GetPhotcodeNamebyCode (newdata[0].refcode);
     
    207207   
    208208    /* convert UNIX time to Elixir-style date string */
    209     timestr = sec_to_date (photdata[i].tstart);
     209    timestr = ohana_sec_to_date (photdata[i].tstart);
    210210   
    211211    if (output.photcodenames) {
  • trunk/Ohana/src/imregister/spreg/output.c

    r12332 r14590  
    101101  for (i = 0; i < Nmatch; i++) {
    102102    subset = &spectrum[match[i]];
    103     obsstr = sec_to_date (subset[0].obstime);
    104     regstr = sec_to_date (subset[0].regtime);
     103    obsstr = ohana_sec_to_date (subset[0].obstime);
     104    regstr = ohana_sec_to_date (subset[0].regtime);
    105105
    106106    /* we should get an error here if we don't construct this line correctly */
     
    119119
    120120  /* add current date/time to header */
    121   str_to_time ("now", &tsecond);
    122   datestr = sec_to_date (tsecond);
     121  ohana_str_to_time ("now", &tsecond);
     122  datestr = ohana_sec_to_date (tsecond);
    123123  gfits_modify (&header,  "DATE", "%s", 1, datestr);
    124124  gfits_modify (&theader, "DATE", "%s", 1, datestr);
     
    150150    i = match[j];
    151151   
    152     timestr = RegTimeMode ? sec_to_date (spectrum[i].regtime) : sec_to_date (spectrum[i].obstime);
     152    timestr = RegTimeMode ? ohana_sec_to_date (spectrum[i].regtime) : ohana_sec_to_date (spectrum[i].obstime);
    153153
    154154    /* predefined subset of values */
  • trunk/Ohana/src/imregister/spreg/showinfo.c

    r2768 r14590  
    2424  fprintf (stderr, "Nspec: %d\n", spec[0].Nspec);
    2525
    26   obstime = sec_to_date (spec[0].obstime);
    27   regtime = sec_to_date (spec[0].regtime);
     26  obstime = ohana_sec_to_date (spec[0].obstime);
     27  regtime = ohana_sec_to_date (spec[0].regtime);
    2828
    2929  fprintf (stderr, "obstime: %s\n", obstime);
  • trunk/Ohana/src/imregister/spreg/spinfo.c

    r7080 r14590  
    7373      /* expect RA & DEC in hh:mm:ss, dd:mm:ss */
    7474      warn_scan (&header, RASexigKeyword,  "%s", 1, line);
    75       dms_to_ddd (&tmp, line);
     75      ohana_dms_to_ddd (&tmp, line);
    7676      spectrum[0].ra = 15*tmp;
    7777      warn_scan (&header, DECSexigKeyword, "%s", 1, &line);
    78       dms_to_ddd (&tmp, line);
     78      ohana_dms_to_ddd (&tmp, line);
    7979      spectrum[0].dec = tmp;
    8080    }
  • trunk/Ohana/src/imregister/src/showiminfo.c

    r3606 r14590  
    11# include "imregister.h"
    22# include "imreg.h"
    3 static char *version = "showiminfo $Revision: 3.1 $";
     3static char *version = "showiminfo $Revision: 3.2 $";
    44
    55int main (int argc, char **argv) {
     
    2828  fprintf (stderr, "ra: %f, dec: %f, rotangle: %f\n", im.ra, im.dec, im.rotangle);
    2929
    30   obstime = sec_to_date (im.obstime);
    31   regtime = sec_to_date (im.regtime);
     30  obstime = ohana_sec_to_date (im.obstime);
     31  regtime = ohana_sec_to_date (im.regtime);
    3232
    3333  fprintf (stderr, "obstime: %s\n", obstime);
  • trunk/Ohana/src/kapa2/include/icons.h

    r13320 r14590  
     1
     2#define icon_width 29
     3#define icon_height 29
     4static unsigned char icon_bits[] = {
     5   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07,
     6   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
     7   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
     8   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
     9   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
     10   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
     11   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
     12   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
     13   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
     14   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
     15
     16/* *** icons for buttons, not used ***
    117#define arrow_width 6
    218#define arrow_height 9
     
    1935   0xfc, 0x0f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x0f, 0xfc, 0x03, 0xfc, 0x00,
    2036   0x3c, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00};
    21 #define icon_width 29
    22 #define icon_height 29
    23 static unsigned char icon_bits[] = {
    24    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07,
    25    0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
    26    0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
    27    0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
    28    0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
    29    0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
    30    0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
    31    0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
    32    0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
    33    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
    3437#define stop_width 16
    3538#define stop_height 16
     
    3841   0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f,
    3942   0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
     43*/
  • trunk/Ohana/src/kapa2/include/prototypes.h

    r14500 r14590  
    2323void          NameWindow          PROTO((Graphic *graphic, char *name));
    2424void          MapWindow           PROTO((Graphic *graphic));
     25void CheckVisual (Graphic *graphic, int *argc, char **argv);
    2526
    2627/* X drawing utilities */
     
    8586int           SetActiveSectionByNumber PROTO((int N));
    8687int           ListSection         PROTO((int sock));
     88void SetSectionSizes (Section *section);
    8789
    8890KapaGraphWidget *InitGraph        PROTO(());
     
    188190int           Overlay3            PROTO((Graphic *graphic, KapaImageWidget *image));
    189191int           PSfunction          PROTO((Graphic *graphic, KapaImageWidget *image));
     192
     193/* misc functions */
     194void SetToolbox (int sock);
     195int EraseOverlay (int sock);
     196int LoadOverlay (int sock);
     197int SaveOverlay (int sock);
     198int CSaveOverlay (int sock);
     199int JPEGit24 (int sock);
     200
     201int UpdatePointer (Graphic *graphic, XMotionEvent *event);
     202int InterpretPresses (Graphic *graphic, XButtonEvent *event);
     203int InterpretKeys (Graphic *graphic, XKeyEvent *event);
     204void InitPipe (char *namedSocket);
     205void EraseGraph (KapaGraphWidget *graph);
     206void StatusBox (Graphic *graphic, KapaImageWidget *image);
     207
     208void CreatePicture (KapaImageWidget *image, Graphic *graphic);
     209void CreateColorbar (KapaImageWidget *image, Graphic *graphic);
     210void CreateZoom (KapaImageWidget *image, Graphic *graphic, double x, double y);
     211void UpdateStatusBox (Graphic *graphic, KapaImageWidget *image, double x, double y, double z, int mode);
     212
     213void CreateZoom8  (KapaImageWidget *image, Graphic *graphic, double x, double y);
     214void CreateZoom16 (KapaImageWidget *image, Graphic *graphic, double x, double y);
     215void CreateZoom24 (KapaImageWidget *image, Graphic *graphic, double x, double y);
     216void CreateZoom32 (KapaImageWidget *image, Graphic *graphic, double x, double y);
     217
     218int GetActiveSocket ();
     219void InvertButton (Graphic *graphic, Button *button);
     220void bDrawOverlay (KapaImageWidget *image, int N);
  • trunk/Ohana/src/kapa2/include/structures.h

    r14498 r14590  
    1313  Cursor         cursor;
    1414  int            x,  y;
    15   int            dx, dy;
     15  unsigned int   dx, dy;
    1616  XColor         cmap[256];
    1717  Colormap       colormap;
  • trunk/Ohana/src/kapa2/src/CheckGeometry.c

    r13320 r14590  
    44void CheckGeometry (Graphic *graphic, int *argc, char **argv) {
    55
    6   int status, x, y, N;
    7   unsigned int dx, dy;
    8   int X, Y, dX, dY;
     6  int status, N;
    97  char *temp_name;
    108 
  • trunk/Ohana/src/kapa2/src/CheckPipe.c

    r14500 r14590  
    186186 
    187187  if (!strcmp (word, "TOOL")) {
    188     status = SetToolbox (sock);
     188    SetToolbox (sock);
    189189    KiiSendCommand (sock, 4, "DONE");
    190190    FINISHED (TRUE);
  • trunk/Ohana/src/kapa2/src/CreateZoom8.c

    r13479 r14590  
    6868  if ((i_end - i_start) % expand_out == 0) dropback = 0;
    6969
    70   out_pix = (char *) image[0].zoom.data;
     70  out_pix = (unsigned char *) image[0].zoom.data;
    7171  imdata  = (float *) image[0].matrix.buffer;
    7272  in_pix  = &imdata[DX*(int)MAX(Ry,0) + (int)MAX(Rx,0)];
  • trunk/Ohana/src/kapa2/src/DefineSection.c

    r13479 r14590  
    44int DefineSection (int sock) {
    55 
    6   int i, N, MoveSection;
     6  int N, MoveSection;
    77  char name[128];
    88  double x, y, dx, dy;
  • trunk/Ohana/src/kapa2/src/DrawButton.c

    r13320 r14590  
    22
    33void DrawButton (Graphic *graphic, Button *button) {
    4  
    5   int y, dX;
    64 
    75  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back);
  • trunk/Ohana/src/kapa2/src/EraseImage.c

    r13479 r14590  
    33int EraseImage () {
    44
    5   char buffer[256];
    6   int i, status, N;
    75  Graphic *graphic;
    86  Section *section;
  • trunk/Ohana/src/kapa2/src/EraseOverlay.c

    r13479 r14590  
    33int EraseOverlay (int sock) {
    44
    5   char buffer[256];
    6   int i, status, N;
     5  int i, N;
    76  Graphic *graphic;
    87  Section *section;
  • trunk/Ohana/src/kapa2/src/EventLoop.c

    r13331 r14590  
    5050    if (LastEvent (display, MotionNotify,    &event)) UpdatePointer (graphic, (XMotionEvent *) &event);
    5151    if (LastEvent (display, ButtonPress,     &event)) InterpretPresses (graphic, (XButtonEvent *) &event);
    52     if (LastEvent (display, KeyPress,        &event)) InterpretKeys (graphic, &event);
     52    if (LastEvent (display, KeyPress,        &event)) InterpretKeys (graphic, (XKeyEvent *) &event);
    5353
    5454    /* drop and ignore the following StructureNotifyMask events */
  • trunk/Ohana/src/kapa2/src/GetPixelCount.c

    r13479 r14590  
    33int GetPixelCount (int sock) {
    44 
    5   int i;
    6   double xmin, xmax, ymin, ymax;
    75  Graphic *graphic;
    86
  • trunk/Ohana/src/kapa2/src/InterpretKeys.c

    r13479 r14590  
    66  double           X, Y, Z, R, D, offset;
    77  int              sock, DX, DY, modstate;
    8   char            *name, string[16], line[40];
     8  char            *name, string[16];
    99  KeySym           keysym;
    1010  XComposeStatus   composestatus;
     
    134134    case XK_Tab:
    135135      image[0].MovePointer = image[0].MovePointer ^ TRUE;
    136       if (image[0].MovePointer) UpdatePointer (graphic, image, (XMotionEvent *)event);
     136      if (image[0].MovePointer) UpdatePointer (graphic, (XMotionEvent *)event);
    137137      break;
    138138  }
  • trunk/Ohana/src/kapa2/src/InterpretPresses.c

    r13479 r14590  
    33int InterpretPresses (Graphic *graphic, XButtonEvent *event) {
    44
    5   int              sock, DX, DY, status, done, this_button, old_cursor;
    6   char             name[16], line[40];
     5  int              sock, DX, DY, status, done, this_button;
     6  char             name[16];
    77  double           X, Y, Z, R, D;
    88  float           *imdata;
    9   KeySym           keysym;
    109  Button          *button;
    1110  Section         *section;
  • trunk/Ohana/src/kapa2/src/JPEGit24.c

    r13479 r14590  
    3333  int dropback;  /* this is a bit of a kludge... */
    3434  int dx, dy, DX, DY, pixelN;
    35   int status, Nbytes, quality;
     35  int quality;
    3636  int expand_in, expand_out;
    3737  double expand, Rx, Ry, X, Y;
  • trunk/Ohana/src/kapa2/src/LoadFrame.c

    r13479 r14590  
    33int LoadFrame (int sock) {
    44 
    5   int i, status;
     5  int i;
    66  char Axis[16], Labels[16], Ticks[16];
    77  Section *section;
  • trunk/Ohana/src/kapa2/src/LoadObject.c

    r13479 r14590  
    123123  }
    124124  if (Nbytes_send != Npts_send*sizeof(float)) {
    125     fprintf (stderr, "Kapa Communication error: unexpected data size %d vs %d\n", Nbytes_send, Npts_send*sizeof(float));
     125    fprintf (stderr, "Kapa Communication error: unexpected data size %d vs %ld\n", Nbytes_send, Npts_send*sizeof(float));
    126126  }
    127127
  • trunk/Ohana/src/kapa2/src/LoadOverlay.c

    r13479 r14590  
    44 
    55  int i, j, Ntotal, Nbytes, Nread, Nfound, Ntext, Nobjects, overnum;
    6   int Noverlay, NOVERLAY, Ntextdata;
     6  int Noverlay, Ntextdata;
    77  char *textdata, *buffer, *p, *q;
    88  Section *section;
  • trunk/Ohana/src/kapa2/src/SetImageData.c

    r14500 r14590  
    33int SetImageData (int sock) {
    44 
    5   int i;
    6   double xmin, xmax, ymin, ymax;
    75  Graphic *graphic;
    86  Section *section;
     
    5553int SetImageCoords (int sock) {
    5654 
    57   int i;
    58   double xmin, xmax, ymin, ymax;
    5955  Graphic *graphic;
    6056  Section *section;
  • trunk/Ohana/src/kapa2/src/SetImageSize.c

    r14500 r14590  
    77void SetImageSize (Section *section) {
    88
    9   int Xs, Ys, Xe, Ye, dX, dY;
     9  int Xs, Ys, dX, dY;
    1010  int textpad, textdY, WdY;
    1111  KapaImageWidget *image;
  • trunk/Ohana/src/libdvo/src/SavePhotcodesFITS.c

    r12332 r14590  
    77
    88  PhotCodeData *table = NULL;
    9   PhotCode *photcode;
    109  FITS_DB db;
    11 
    12   int i, code, Ncode, Nsec;
    1310
    1411  table = GetPhotcodeTable ();
  • trunk/Ohana/src/libdvo/src/SavePhotcodesText.c

    r12332 r14590  
    22# define SCALE 0.001
    33
    4 static char *PHOT_PRI_NAME = "pri";
    54static char *PHOT_SEC_NAME = "sec";
    65static char *PHOT_ALT_NAME = "alt";
     
    1413
    1514  PhotCodeData *table = NULL;
    16   PhotCode *photcode;
    1715  struct stat filestat;
    1816  char *type;
     
    7674      fprintf (f, " %f,", table[0].code[i].X[j]);
    7775    }
    78     fprintf (f, "%f %f ", table[0].code[i].X[j], table[0].code[i].dX);
     76    fprintf (f, "%f %d ", table[0].code[i].X[j], table[0].code[i].dX);
    7977    PrintPhotcodeNamebyCode (f, "%5d ", table[0].code[i].equiv);
    8078    fprintf (f, "\n");
  • trunk/Ohana/src/libdvo/src/coordops.c

    r14288 r14590  
    735735    case PROJ_PAR:
    736736      return PROJ_MODE_PSEUDOCYL;
    737     default: PROJ_MODE_NONE;
     737    default:
     738      return PROJ_MODE_NONE;
    738739  }
    739740  return PROJ_MODE_NONE;
  • trunk/Ohana/src/libdvo/src/dvo_catalog_create.c

    r8429 r14590  
    9797
    9898  /* write creation date in header */
    99   str_to_time ("now", &now);
    100   line = sec_to_date (now);
     99  ohana_str_to_time ("now", &now);
     100  line = ohana_sec_to_date (now);
    101101  gfits_modify (&catalog[0].header, "DATE", "%s", 1, line);
    102102  free (line);
  • trunk/Ohana/src/libkapa/include/kapa.h

    r14500 r14590  
    163163int KapaSendTextline (int fd, char *string, float x, float y, float angle);
    164164int KapaSetLimits (int fd, Graphdata *graphmode);
     165int KapaGetLimits (int fd, float *dx, float *dy);
    165166int KapaSetSection (int fd, KapaSection *section);
    166167int KapaSelectSection (int fd, char *name);
     
    171172int KapaSetImageData (int fd, KapaImageData *graphmode);
    172173int KapaGetImageData (int fd, KapaImageData *graphmode);
     174int KapaSetToolbox (int fd, int location);
    173175
    174176/* KapaColors */
  • trunk/Ohana/src/libkapa/src/KapaOpen.c

    r13899 r14590  
    123123int KapaDefineValidIP (char *ipstring) {
    124124
    125   int i, NVALID, ip1, ip2, ip3, ip4, test, status;
     125  int ip1, ip2, ip3, ip4, test, status;
    126126  char string[80];
    127127
  • trunk/Ohana/src/libkapa/src/KiiOverlay.c

    r13479 r14590  
    131131  // we could break this into segments if we want to trap an interrupt, but why bother?
    132132  Nchar = write (fd, buffer, Noverlay*sizeof(KiiOverlayBase));
    133   fprintf (stderr, "sent %d of %d bytes\n", Nchar, Noverlay*sizeof(KiiOverlayBase));
     133  fprintf (stderr, "sent %d of %ld bytes\n", Nchar, Noverlay*sizeof(KiiOverlayBase));
    134134  KiiWaitAnswer (fd, "DONE");
    135135
  • trunk/Ohana/src/libkapa/src/KiiPicture.c

    r14500 r14590  
    33int KiiNewPicture1D (int fd, KiiImage *image, KapaImageData *data, Coords *coords) {
    44
    5   int i;
    6   int Npix, Ncolors, NNcolors, size;
     5  int Npix, Ncolors, size;
    76  float *in, min, max;
    8   char *out, *outbuffer;
    9   double a1, a2;
    107
    118  Npix = image[0].Nx*image[0].Ny;
  • trunk/Ohana/src/libohana/include/ohana.h

    r14448 r14590  
    187187enum {TIME_NONE, TIME_DATE, TIME_DAYS, TIME_HOURS, TIME_MINUTES, TIME_SECONDS, TIME_JD, TIME_MJD};
    188188
    189 int     chk_time               PROTO((char *line));
    190 time_t  date_to_sec            PROTO((char *date));
    191 int     dms_to_ddd             PROTO((double *Value, char *string));
    192 time_t  jd_to_sec              PROTO((double jd));
    193 char   *sec_to_date            PROTO((time_t second));
    194 double  sec_to_jd              PROTO((time_t second));
    195 int     str_to_dtime           PROTO((char *line, double *second));
    196 int     str_to_time            PROTO((char *line, time_t *second));
    197 double  sec_to_mjd             PROTO((time_t second));
    198 time_t  mjd_to_sec             PROTO((double mjd));
     189int     ohana_chk_time         PROTO((char *line));
     190time_t  ohana_date_to_sec      PROTO((char *date));
     191int     ohana_dms_to_ddd       PROTO((double *Value, char *string));
     192time_t  ohana_jd_to_sec        PROTO((double jd));
     193time_t  ohana_mjd_to_sec       PROTO((double mjd));
     194char   *ohana_sec_to_date      PROTO((time_t second));
     195double  ohana_sec_to_jd        PROTO((time_t second));
     196int     ohana_str_to_dtime     PROTO((char *line, double *second));
     197int     ohana_str_to_time      PROTO((char *line, time_t *second));
     198double  ohana_sec_to_mjd       PROTO((time_t second));
    199199double  ohana_lst              PROTO((double jd, double longitude));
     200int     ohana_str_to_radec     PROTO((double *ra, double *dec, char *str1, char *str2));
    200201
    201202int     hstgsc_hms_to_deg      PROTO((double *h0, double *h1, double *d0, double *d1, char *string));
    202 int     str_to_radec           PROTO((double *ra, double *dec, char *str1, char *str2));
    203203
    204204/* IO Buffer functions */
  • trunk/Ohana/src/libohana/src/time.c

    r8385 r14590  
    22
    33/***** convert [-]00:00:00 to 0.0000 ****/
    4 int dms_to_ddd (double *Value, char *string) {
     4int ohana_dms_to_ddd (double *Value, char *string) {
    55 
    66  int valid, neg, status;
     
    5858
    5959/**********/
    60 int str_to_radec (double *ra, double *dec, char *str1, char *str2) {
     60int ohana_str_to_radec (double *ra, double *dec, char *str1, char *str2) {
    6161
    6262  double Ra, Dec;
    6363
    6464  *ra = *dec = 0;
    65   switch (dms_to_ddd (&Ra, str1)) {
     65  switch (ohana_dms_to_ddd (&Ra, str1)) {
    6666    case 0:
    6767      fprintf (stderr, "syntax error in RA\n");
     
    7373      break;
    7474  }
    75   switch (dms_to_ddd (&Dec, str2)) {
     75  switch (ohana_dms_to_ddd (&Dec, str2)) {
    7676    case 0:
    7777      fprintf (stderr, "syntax error in DEC\n");
     
    8787
    8888/**********/
    89 int chk_time (char *line) {
     89int ohana_chk_time (char *line) {
    9090
    9191  char *p1, *p2;
     
    120120
    121121/**********/
    122 int str_to_time (char *line, time_t *second) {
     122int ohana_str_to_time (char *line, time_t *second) {
    123123 
    124124  char *tmpline;
     
    141141      gmt   = gmtime (&tsec);
    142142      sprintf (tmpline, "%04d/%02d/%02d,%s", 1900 + gmt[0].tm_year, gmt[0].tm_mon+1, gmt[0].tm_mday, &line[6]);
    143       *second = date_to_sec (tmpline);
     143      *second = ohana_date_to_sec (tmpline);
    144144      free (tmpline);
    145145      return (TRUE);
     
    150150  }
    151151   
    152   switch (chk_time (line)) {
     152  switch (ohana_chk_time (line)) {
    153153    case 0:
    154154      return (FALSE);
    155155    case TIME_DATE:
    156       *second = date_to_sec (line);
     156      *second = ohana_date_to_sec (line);
    157157      return (TRUE);
    158158    case TIME_DAYS:
     
    170170    case TIME_JD:
    171171      jd = strtod (line, 0);
    172       *second = jd_to_sec (jd);
     172      *second = ohana_jd_to_sec (jd);
    173173      return (TRUE);
    174174    case TIME_MJD:
    175175      jd = strtod (line, 0);
    176       *second = mjd_to_sec (jd);
     176      *second = ohana_mjd_to_sec (jd);
    177177      return (TRUE);
    178178  }
     
    182182
    183183/**********/
    184 int str_to_dtime (char *line, double *second) {
    185  
    186   switch (chk_time (line)) {
     184int ohana_str_to_dtime (char *line, double *second) {
     185 
     186  switch (ohana_chk_time (line)) {
    187187    case 0:
    188188    case TIME_JD:
     
    207207
    208208/**********/
    209 double sec_to_jd (time_t second) {
     209double ohana_sec_to_jd (time_t second) {
    210210
    211211  double jd;
     
    216216
    217217/**********/
    218 time_t jd_to_sec (double jd) {
     218time_t ohana_jd_to_sec (double jd) {
    219219
    220220  time_t second;
     
    225225
    226226/**********/
    227 double sec_to_mjd (time_t second) {
     227double ohana_sec_to_mjd (time_t second) {
    228228
    229229  double mjd;
     
    234234
    235235/**********/
    236 time_t mjd_to_sec (double mjd) {
     236time_t ohana_mjd_to_sec (double mjd) {
    237237
    238238  time_t second;
     
    243243
    244244/**********/
    245 char *sec_to_date (time_t second) {
     245char *ohana_sec_to_date (time_t second) {
    246246 
    247247  struct tm *gmt;
     
    256256
    257257/***** date in format yyyy/mm/dd,hh:mm:ss *****/
    258 time_t date_to_sec (char *date) {
     258time_t ohana_date_to_sec (char *date) {
    259259 
    260260  time_t second;
  • trunk/Ohana/src/misc/src/mkfringetable.c

    r7080 r14590  
    22# include <gfitsio.h>
    33
    4 static char *version = "mkfringetable $Revision: 1.8 $";
     4static char *version = "mkfringetable $Revision: 1.9 $";
    55
    66void get_version (int argc, char **argv, char *version);
     
    7373    struct timeval now;
    7474    gettimeofday (&now, (struct timezone *) NULL);
    75     datestr = sec_to_date (now.tv_sec);
     75    datestr = ohana_sec_to_date (now.tv_sec);
    7676  }
    7777
  • trunk/Ohana/src/nightd/src/ConfigInit.c

    r3466 r14590  
    8888   
    8989  ScanConfig (config, "NIGHT_START",            "%s", 0, line);
    90   if (!dms_to_ddd (&tmp, line)) {
     90  if (!ohana_dms_to_ddd (&tmp, line)) {
    9191    fprintf (LogFile, "format error in NIGHT_START\n");
    9292    exit (2);
     
    9999  }
    100100  ScanConfig (config, "NIGHT_STOP",             "%s", 0, line);
    101   if (!dms_to_ddd (&tmp, line)) {
     101  if (!ohana_dms_to_ddd (&tmp, line)) {
    102102    fprintf (LogFile, "format error in NIGHT_STOP\n");
    103103    exit (2);
  • trunk/Ohana/src/nightd/src/misc.c

    r12332 r14590  
    77
    88char **getargs (char *);
    9 
    10 /***** convert [-]00:00:00 to 0.0000 ****/
    11 int dms_to_ddd (double *Value, char *string) {
    12  
    13   int valid, neg, status;
    14   double tmp, value;
    15   char *p1, *p2, *px;
    16 
    17   valid = FALSE;
    18   neg = FALSE;
    19   stripwhite (string);
    20   p1 = string;
    21   px = string + strlen(string);
    22 
    23   if (string[0] == '-') {
    24     valid = TRUE;
    25     neg = TRUE;
    26     p1 = &string[1];
    27   }
    28   if (string[0] == '+') {
    29     valid = TRUE;
    30     neg = FALSE;
    31     p1 = &string[1];
    32   }
    33   if (isdigit(string[0])) {
    34     valid = TRUE;
    35     p1 = &string[0];
    36   }
    37   if (!valid) { return (FALSE); }
    38 
    39   status = 1;
    40   tmp = strtod (p1, &p2);
    41   if (p2 == p1) return (FALSE); /* entry not a number: +fred */
    42   value = tmp;
    43   if (p2 == px) goto escape;    /* entry only number: +1.0 */
    44   p1 = p2 + 1;
    45 
    46   tmp = strtod (p1, &p2);
    47   if (p2 == p1) goto escape;    /* entry not a number: +1:fred */
    48   status = 2;
    49   value += tmp / 60.0;
    50   if (p2 == px) goto escape;    /* entry only number: +1:1 */
    51   p1 = p2 + 1;
    52 
    53   tmp = strtod (p1, &p2);
    54   if (p2 == p1) goto escape;    /* entry not a number: +1:1:fred */
    55   value += tmp / 3600.0;
    56 
    57  escape:
    58   if (neg) {
    59     value *= -1;
    60   }
    61   *Value = value;
    62 
    63   return (status);
    64 }
    659
    6610/* SetPID is always called outside of daemon loop, send errors to stderr */
  • trunk/Ohana/src/opihi/cmd.astro/ctimes.c

    r7917 r14590  
    2929    value = atof (argv[2]);
    3030    time = TimeRef (value, TimeReference, TimeFormat);
    31     date = sec_to_date (time);
     31    date = ohana_sec_to_date (time);
    3232   
    3333    if (Variable != (char *) NULL) {
     
    4848    }
    4949
    50     if (!str_to_time (argv[2], &time)) {
     50    if (!ohana_str_to_time (argv[2], &time)) {
    5151      gprint (GP_ERR, "syntax error\n");
    5252      return (FALSE);
  • trunk/Ohana/src/opihi/cmd.astro/getlst.c

    r7964 r14590  
    1616  if (argc != 3) goto syntax;
    1717
    18   if (!str_to_time (argv[1], &time)) {
     18  if (!ohana_str_to_time (argv[1], &time)) {
    1919      if (Variable != NULL) free (Variable);
    2020      return (FALSE);
     
    2323  longitude = atof (argv[2]);
    2424
    25   jd = sec_to_jd (time);
     25  jd = ohana_sec_to_jd (time);
    2626  fprintf (stderr, "jd: %f\n", jd);
    2727
  • trunk/Ohana/src/opihi/cmd.astro/region.c

    r14501 r14590  
    5858  }
    5959 
    60   if (!str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
     60  if (!ohana_str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
    6161  Radius = atof (argv[3]);
    6262  strcpy (graphmode.coords.ctype, "RA---TAN");
  • trunk/Ohana/src/opihi/cmd.astro/sexigesimal.c

    r7917 r14590  
    2323
    2424  if (HMS) {
    25     if (!dms_to_ddd (&value, argv[1])) {
     25    if (!ohana_dms_to_ddd (&value, argv[1])) {
    2626      gprint (GP_ERR, "syntax error in input\n");
    2727      return (FALSE);
  • trunk/Ohana/src/opihi/cmd.data/close.c

    r13479 r14590  
    33int close_device (int argc, char **argv) {
    44
    5   int N, kapa, IsImage;
     5  int N, kapa;
    66  char *name;
    77  /* close current graphics device */
  • trunk/Ohana/src/opihi/cmd.data/dbconnect.c

    r13615 r14590  
    88int dbconnect (int argc, char **argv) {
    99 
    10   char c;
    11   int i;
    12   int Nrows;
    1310  char query[256];
    1411  char password[1024];
    1512  MYSQL_RES *result;
    16   MYSQL_ROW row;
    1713
    1814  if (argc != 4) {
     
    2521
    2622# if (0)
     23  int i;
     24  char c;
     25
    2726  initscr();
    2827  noecho();
     
    6564   
    6665# if (0)
     66  int Nrows;
     67  MYSQL_ROW row;
     68
    6769  sprintf (query, "select @@interactive_timeout");
    6870  if (mysql_query (connection, query)) {
  • trunk/Ohana/src/opihi/cmd.data/device.c

    r13479 r14590  
    33int device (int argc, char **argv) {
    44
    5   int N, kapa, IsImage;
     5  int N, kapa;
    66  char *name;;
    77  /* set / get current graphics device */
     
    1818    if (name == NULL) {
    1919      gprint (GP_ERR, "no device defined\n");
    20       return (NULL);
     20      return (FALSE);
    2121    }
    2222  } else {
  • trunk/Ohana/src/opihi/cmd.data/jpeg.c

    r13479 r14590  
    44
    55  char filename[1024];
    6   int N, kapa, IsImage, IsPNG, IsPPM;
     6  int N, kapa, IsPNG, IsPPM;
    77  char *name;
    88 
  • trunk/Ohana/src/opihi/cmd.data/ps.c

    r13479 r14590  
    44
    55  char filename[1024], pagename[1024], *name;
    6   int N, kapa, scaleMode, pageMode, IsImage;
     6  int N, kapa, scaleMode, pageMode;
    77 
    88  if ((N = get_argument (argc, argv, "--help"))) goto help;
  • trunk/Ohana/src/opihi/cmd.data/zplot.c

    r13479 r14590  
    33int zplot (int argc, char **argv) {
    44 
    5   int i, kapa, N, Npts;
     5  int i, kapa, Npts;
    66  float *in, *out;
    77  double min, range;
  • trunk/Ohana/src/opihi/dimm/Telescope.c

    r7917 r14590  
    3737  if (!status) return (FALSE);
    3838
    39   status = str_to_radec (r, d, rastr, decstr);
     39  status = ohana_str_to_radec (r, d, rastr, decstr);
    4040  if (!status) return (FALSE);
    4141
     
    207207
    208208  SerialCommand (":GA#", &answer, SER_TIMEOUT);
    209   dms_to_ddd (x, answer);
     209  ohana_dms_to_ddd (x, answer);
    210210  free (answer);
    211211
    212212  SerialCommand (":GZ#", &answer, SER_TIMEOUT);
    213   dms_to_ddd (y, answer);
     213  ohana_dms_to_ddd (y, answer);
    214214  free (answer);
    215215
     
    312312  /* : get latitude */
    313313  SerialCommand (":Gt#", &answer, SER_TIMEOUT);
    314   dms_to_ddd (lat, answer);
     314  ohana_dms_to_ddd (lat, answer);
    315315  free (answer);
    316316
    317317  /* : get longitude */
    318318  SerialCommand (":Gg#", &answer, SER_TIMEOUT);
    319   dms_to_ddd (lon, answer);
     319  ohana_dms_to_ddd (lon, answer);
    320320  free (answer);
    321321
    322322  /* : get LST */
    323323  SerialCommand (":GS#", &answer, SER_TIMEOUT);
    324   dms_to_ddd (lst, answer);
     324  ohana_dms_to_ddd (lst, answer);
    325325  free (answer);
    326326
  • trunk/Ohana/src/opihi/dvo/ImageOps.c

    r14401 r14590  
    2727
    2828  if (selection->useSkyregion) {
    29     get_skyregion (&patch.Rmin, &patch.Rmax, &patch.Dmin, &patch.Dmax);
     29    double Rs, Re, Ds, De;
     30    get_skyregion (&Rs, &Re, &Ds, &De);
     31    patch.Rmin = Rs;
     32    patch.Rmax = Re;
     33    patch.Dmin = Ds;
     34    patch.Dmax = De;
    3035    Rmin = patch.Rmin - 182.0;
    3136    Rmax = patch.Rmax + 182.0;
  • trunk/Ohana/src/opihi/dvo/ImageSelection.c

    r14401 r14590  
    1111int SetImageSelection (int mosaicMode, SkyRegionSelection *selection) {
    1212
    13   int Ngraph;
    1413  int TimeSelect;
    1514  time_t tzero, tend;
  • trunk/Ohana/src/opihi/dvo/avextract.c

    r14401 r14590  
    55  int i, j, n, m, N, Npts, NPTS, last, Nfields, Nreturn, Ncstack, Nstack;
    66  int Nsecfilt, mode, VERBOSE;
    7   char *p;
    87  char **cstack, name[1024];
    98  float *values;
     
    135134  return (TRUE);
    136135
    137  usage:
    138   gprint (GP_ERR, "USAGE: avextract (value) [options]\n");
    139   gprint (GP_ERR, "  value: average.parameter or photcode\n");
    140 
    141136 escape:
    142137  dbFreeFields (fields, Nfields);
  • trunk/Ohana/src/opihi/dvo/calextract.c

    r14401 r14590  
    55int calextract (int argc, char **argv) {
    66 
    7   int i, j, m, N, Nr, mode[2];
     7  int i, N, Nr, mode[2];
    88  int Nsecfilt, NSTAR;
    9   double M1, M2, dM2, color;
    109
    1110  PhotCode *code[2];
  • trunk/Ohana/src/opihi/dvo/calmextract.c

    r14401 r14590  
    66int calmextract (int argc, char **argv) {
    77 
    8   int i, j, k, m, N, N1, Nr, mode[2];
     8  int i, k, N, Nr, mode[2];
    99  int NSTAR, Nstar, Nsecfilt;
    10   double *M1, M2, dM2, color;
    1110
    1211  Catalog catalog;
  • trunk/Ohana/src/opihi/dvo/dbCmdlineFields.c

    r14401 r14590  
    44dbField *dbCmdlineFields (int argc, char **argv, int table, int *last, int *nfields) {
    55
    6   int i, j, status, Nfields, NFIELDS;
     6  int i, status, Nfields, NFIELDS;
    77  char *p, *q, *field;
    88  dbField *fields;
  • trunk/Ohana/src/opihi/dvo/dbExtractMeasures.c

    r14401 r14590  
    1212double dbExtractMeasures (Average *average, SecFilt *secfilt, Measure *measure, dbField *field) {
    1313
    14   int i, Nsec;
     14  int Nsec;
    1515  double value;
    1616  double ra, dec, x, y;
     
    116116      value = average[0].Nn;
    117117      break;
    118     case MEAS_NPHOT: /* OK */
    119       Nsec = f(measure[0].photcode);
    120       value = secfilt[Nsec].Nused;
    121       break;
    122     case MEAS_NCODE: /* OK */
    123       Nsec = f(measure[0].photcode);
    124       value = secfilt[Nsec].Ncode;
    125       break;
    126118    case MEAS_OBJFLAGS: /* OK */
    127119      value = average[0].code;
    128120      break;
    129 //    case MEAS_dMAG: /* OK */
    130 //      value = measure[0].dM;
    131 //      break;
    132121    // note that these represent the ra displacement relative to the average, not
    133122    // the error.
  • trunk/Ohana/src/opihi/dvo/dbFields.c

    r14401 r14590  
    122122  if (!strcasecmp (fieldName, "nmeas"))    ESCAPE (MEAS_NMEAS,          MAG_NONE);
    123123  if (!strcasecmp (fieldName, "nmiss"))    ESCAPE (MEAS_NMISS,          MAG_NONE);
    124   if (!strcasecmp (fieldName, "nphot"))    ESCAPE (MEAS_NPHOT,          MAG_NONE);
    125   if (!strcasecmp (fieldName, "ncode"))    ESCAPE (MEAS_NCODE,          MAG_NONE);
    126124  if (!strcasecmp (fieldName, "objflags")) ESCAPE (MEAS_OBJFLAGS,       MAG_NONE);
    127125  if (!strcasecmp (fieldName, "AIRMASS"))  ESCAPE (MEAS_AIRMASS,        MAG_NONE);
  • trunk/Ohana/src/opihi/dvo/detrend.c

    r7917 r14590  
    2727  if ((N = get_argument (argc, argv, "-time"))) {
    2828    remove_argument (N, &argc, argv);
    29     if (!str_to_time (argv[N], &tzero)) {
    30       gprint (GP_ERR, "syntax error\n");
    31       return (FALSE);
    32     }
    33     remove_argument (N, &argc, argv);
    34     if (!str_to_dtime (argv[N], &trange)) {
     29    if (!ohana_str_to_time (argv[N], &tzero)) {
     30      gprint (GP_ERR, "syntax error\n");
     31      return (FALSE);
     32    }
     33    remove_argument (N, &argc, argv);
     34    if (!ohana_str_to_dtime (argv[N], &trange)) {
    3535      gprint (GP_ERR, "syntax error\n");
    3636      return (FALSE);
     
    4545  if ((N = get_argument (argc, argv, "-trange"))) {
    4646    remove_argument (N, &argc, argv);
    47     if (!str_to_time (argv[N], &tzero)) {
    48       gprint (GP_ERR, "syntax error\n");
    49       return (FALSE);
    50     }
    51     remove_argument (N, &argc, argv);
    52     if (!str_to_time (argv[N], &tend)) {
     47    if (!ohana_str_to_time (argv[N], &tzero)) {
     48      gprint (GP_ERR, "syntax error\n");
     49      return (FALSE);
     50    }
     51    remove_argument (N, &argc, argv);
     52    if (!ohana_str_to_time (argv[N], &tend)) {
    5353      gprint (GP_ERR, "syntax error\n");
    5454      return (FALSE);
  • trunk/Ohana/src/opihi/dvo/dmt.c

    r13479 r14590  
    44int dmt (int argc, char **argv) {
    55 
     6  // XXX this needs to be fixed: how to access different graphs at once?
     7  gprint (GP_ERR, "ERROR: this function is currently disabled\n");
     8  return (FALSE);
     9
     10# if (0)
     11
    612  int i, m, k, N, kapa, SaveVectors;
    713  int Nsec, Nsecfilt, NPTS;
     
    3844  }
    3945
    40   // XXX this needs to be fixed: how to access different graphs at once?
    41   gprint (GP_ERR, "ERROR: this function is currently disabled\n");
    42   return (FALSE);
    4346  if (!GetGraphData (&graphsky, &kapa, NULL)) return (FALSE);
    4447  if (!GetGraph (&graphmode, NULL, NULL)) return (FALSE);
     
    151154  }
    152155  return (TRUE);
    153 
     156# endif
    154157}
  • trunk/Ohana/src/opihi/dvo/gimages.c

    r14497 r14590  
    3030  if ((N = get_argument (argc, argv, "-time"))) {
    3131    remove_argument (N, &argc, argv);
    32     if (!str_to_time (argv[N], &tzero)) {
     32    if (!ohana_str_to_time (argv[N], &tzero)) {
    3333      gprint (GP_ERR, "syntax error\n");
    3434      return (FALSE);
    3535    }
    3636    remove_argument (N, &argc, argv);
    37     if (!str_to_dtime (argv[N], &trange)) {
     37    if (!ohana_str_to_dtime (argv[N], &trange)) {
    3838      gprint (GP_ERR, "syntax error\n");
    3939      return (FALSE);
     
    5050    remove_argument (N, &argc, argv);
    5151
    52     if (!str_to_dtime (argv[N], &trange)) {
     52    if (!ohana_str_to_dtime (argv[N], &trange)) {
    5353      gprint (GP_ERR, "syntax error\n");
    5454      return (FALSE);
     
    8080  }
    8181
    82   if (!str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
     82  if (!ohana_str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
    8383
    8484  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
     
    8989  int TriangleUp   = wordhash ("TRP-");
    9090  int TriangleDn   = wordhash ("TRM-");
    91   int TrianglePts  = wordhash ("TRI-");
    9291
    9392  Nfound = 0;
     
    149148
    150149  got_spot:
    151     date = sec_to_date (image[i].tzero);
     150    date = ohana_sec_to_date (image[i].tzero);
    152151
    153152    if (PixelCoords) {
  • trunk/Ohana/src/opihi/dvo/gstar.c

    r12332 r14590  
    168168
    169169          if (GetMeasures && !QUIET) {
    170             date = sec_to_date (catalog.measure[m].t);
     170            date = ohana_sec_to_date (catalog.measure[m].t);
    171171            gprint (GP_LOG, "%6.3f %6.3f %5.3f  %20s  %5.2f %5.2f %2d %3x %3d %-20s\n",
    172172                     Mcat, Mrel, catalog.measure[m].dM,
  • trunk/Ohana/src/opihi/dvo/images.c

    r13479 r14590  
    6161  if ((N = get_argument (argc, argv, "-time"))) {
    6262    remove_argument (N, &argc, argv);
    63     if (!str_to_time (argv[N], &tzero)) {
    64       gprint (GP_ERR, "syntax error\n");
    65       return (FALSE);
    66     }
    67     remove_argument (N, &argc, argv);
    68     if (!str_to_dtime (argv[N], &trange)) {
     63    if (!ohana_str_to_time (argv[N], &tzero)) {
     64      gprint (GP_ERR, "syntax error\n");
     65      return (FALSE);
     66    }
     67    remove_argument (N, &argc, argv);
     68    if (!ohana_str_to_dtime (argv[N], &trange)) {
    6969      gprint (GP_ERR, "syntax error\n");
    7070      return (FALSE);
     
    7979  if ((N = get_argument (argc, argv, "-trange"))) {
    8080    remove_argument (N, &argc, argv);
    81     if (!str_to_time (argv[N], &tzero)) {
    82       gprint (GP_ERR, "syntax error\n");
    83       return (FALSE);
    84     }
    85     remove_argument (N, &argc, argv);
    86     if (!str_to_time (argv[N], &tend)) {
     81    if (!ohana_str_to_time (argv[N], &tzero)) {
     82      gprint (GP_ERR, "syntax error\n");
     83      return (FALSE);
     84    }
     85    remove_argument (N, &argc, argv);
     86    if (!ohana_str_to_time (argv[N], &tend)) {
    8787      gprint (GP_ERR, "syntax error\n");
    8888      return (FALSE);
  • trunk/Ohana/src/opihi/dvo/imdata.c

    r14401 r14590  
    2626  if ((N = get_argument (argc, argv, "-time"))) {
    2727    remove_argument (N, &argc, argv);
    28     if (!str_to_time (argv[N], &tzero)) {
     28    if (!ohana_str_to_time (argv[N], &tzero)) {
    2929      gprint (GP_ERR, "syntax error\n");
    3030      return (FALSE);
    3131    }
    3232    remove_argument (N, &argc, argv);
    33     if (!str_to_dtime (argv[N], &trange)) {
     33    if (!ohana_str_to_dtime (argv[N], &trange)) {
    3434      gprint (GP_ERR, "syntax error\n");
    3535      return (FALSE);
  • trunk/Ohana/src/opihi/dvo/imextract.c

    r14401 r14590  
    66 
    77  int i, j, Nimage, mode, N, PhotcodeSelect;
    8   int TimeSelect, RegionSelect, *subset, Nsubset, TimeFormat, FlagSelect, FlagValue;
     8  int TimeSelect, *subset, Nsubset, TimeFormat, FlagSelect, FlagValue;
    99  double x, y, ra, dec, t, trange;
    1010  time_t tzero, TimeReference;
     
    2727  if ((N = get_argument (argc, argv, "-time"))) {
    2828    remove_argument (N, &argc, argv);
    29     if (!str_to_time (argv[N], &tzero)) {
     29    if (!ohana_str_to_time (argv[N], &tzero)) {
    3030      gprint (GP_ERR, "syntax error\n");
    3131      return (FALSE);
    3232    }
    3333    remove_argument (N, &argc, argv);
    34     if (!str_to_dtime (argv[N], &trange)) {
     34    if (!ohana_str_to_dtime (argv[N], &trange)) {
    3535      gprint (GP_ERR, "syntax error\n");
    3636      return (FALSE);
  • trunk/Ohana/src/opihi/dvo/imlist.c

    r14401 r14590  
    2121  if ((N = get_argument (argc, argv, "-time"))) {
    2222    remove_argument (N, &argc, argv);
    23     if (!str_to_time (argv[N], &tzero)) {
     23    if (!ohana_str_to_time (argv[N], &tzero)) {
    2424      gprint (GP_ERR, "syntax error\n");
    2525      return (FALSE);
    2626    }
    2727    remove_argument (N, &argc, argv);
    28     if (!str_to_dtime (argv[N], &trange)) {
     28    if (!ohana_str_to_dtime (argv[N], &trange)) {
    2929      gprint (GP_ERR, "syntax error\n");
    3030      return (FALSE);
  • trunk/Ohana/src/opihi/dvo/imphot.c

    r14401 r14590  
    4040
    4141  /* load image(s) in time range given */
    42   if (!str_to_time (argv[1], &tzero)) {
     42  if (!ohana_str_to_time (argv[1], &tzero)) {
    4343    gprint (GP_ERR, "syntax error\n");
    4444    return (FALSE);
    4545  }
    46   if (!str_to_dtime (argv[2], &trange)) {
     46  if (!ohana_str_to_dtime (argv[2], &trange)) {
    4747    gprint (GP_ERR, "syntax error\n");
    4848    return (FALSE);
  • trunk/Ohana/src/opihi/dvo/imrough.c

    r7917 r14590  
    2323  if ((N = get_argument (argc, argv, "-time"))) {
    2424    remove_argument (N, &argc, argv);
    25     if (!str_to_time (argv[N], &tzero)) {
     25    if (!ohana_str_to_time (argv[N], &tzero)) {
    2626      gprint (GP_ERR, "syntax error\n");
    2727      return (FALSE);
    2828    }
    2929    remove_argument (N, &argc, argv);
    30     if (!str_to_dtime (argv[N], &trange)) {
     30    if (!ohana_str_to_dtime (argv[N], &trange)) {
    3131      gprint (GP_ERR, "syntax error\n");
    3232      return (FALSE);
     
    4141  if ((N = get_argument (argc, argv, "-trange"))) {
    4242    remove_argument (N, &argc, argv);
    43     if (!str_to_time (argv[N], &tzero)) {
     43    if (!ohana_str_to_time (argv[N], &tzero)) {
    4444      gprint (GP_ERR, "syntax error\n");
    4545      return (FALSE);
    4646    }
    4747    remove_argument (N, &argc, argv);
    48     if (!str_to_time (argv[N], &tend)) {
     48    if (!ohana_str_to_time (argv[N], &tend)) {
    4949      gprint (GP_ERR, "syntax error\n");
    5050      return (FALSE);
  • trunk/Ohana/src/opihi/dvo/imsearch.c

    r12332 r14590  
    2525  if ((N = get_argument (argc, argv, "-time"))) {
    2626    remove_argument (N, &argc, argv);
    27     if (!str_to_time (argv[N], &tzero)) {
     27    if (!ohana_str_to_time (argv[N], &tzero)) {
    2828      gprint (GP_ERR, "syntax error\n");
    2929      return (FALSE);
    3030    }
    3131    remove_argument (N, &argc, argv);
    32     if (!str_to_dtime (argv[N], &trange)) {
     32    if (!ohana_str_to_dtime (argv[N], &trange)) {
    3333      gprint (GP_ERR, "syntax error\n");
    3434      return (FALSE);
  • trunk/Ohana/src/opihi/dvo/mextract.c

    r14401 r14590  
    33int mextract (int argc, char **argv) {
    44 
    5   int i, j, k, m, n, N, N1, Npts, NPTS, last, Nfields, Nreturn, Ncstack, Nstack;
     5  int i, j, k, m, n, N, Npts, NPTS, last, Nfields, Nreturn, Ncstack, Nstack;
    66  int Nsecfilt, VERBOSE, loadImages, mosaicMode;
    7   char *p;
    8   double *M1;
    97  char **cstack, name[1024];
    108  float *values;
     
    2422  fields = NULL;
    2523  stack = NULL;
     24
     25  if ((N = get_argument (argc, argv, "-h"))) goto help;
     26  if ((N = get_argument (argc, argv, "--help"))) goto help;
    2627
    2728  VERBOSE = FALSE;
     
    159160  FreeSkyRegionSelection (selection);
    160161  return (TRUE);
    161 
    162 usage:
    163   gprint (GP_ERR, "USAGE: mextract (value) [options]\n");
    164   gprint (GP_ERR, "  value: measure.parameter or photcode\n");
    165   return (FALSE);
    166162
    167163escape:
  • trunk/Ohana/src/opihi/dvo/photometry.c

    r14401 r14590  
    443443  if ((N = get_argument (*argc, argv, "-time"))) {
    444444    remove_argument (N, argc, argv);
    445     if (!str_to_time (argv[N], &tzero)) {
     445    if (!ohana_str_to_time (argv[N], &tzero)) {
    446446      gprint (GP_ERR, "syntax error\n");
    447447      return (FALSE);
    448448    }
    449449    remove_argument (N, argc, argv);
    450     if (!str_to_dtime (argv[N], &trange)) {
     450    if (!ohana_str_to_dtime (argv[N], &trange)) {
    451451      gprint (GP_ERR, "syntax error\n");
    452452      return (FALSE);
  • trunk/Ohana/src/opihi/dvo/pmeasure.c

    r13505 r14590  
    127127        if ((R < Rmin) || (R > Rmax) || (D < -90.0) || (D > 90.0)) {
    128128          char *date;
    129           date = sec_to_date (catalog.measure[m+k].t);
     129          date = ohana_sec_to_date (catalog.measure[m+k].t);
    130130          gprint (GP_LOG, "out: %f, %f : %s : (%f, %f) + (%f, %f)\n", R, D, date, catalog.average[i].R, catalog.average[i].D, catalog.measure[m+k].dR/3600.0, catalog.measure[m+k].dD/3600.0);
    131131          free (date);
  • trunk/Ohana/src/opihi/dvo/skycoverage.c

    r9275 r14590  
    2424  if ((N = get_argument (argc, argv, "-time"))) {
    2525    remove_argument (N, &argc, argv);
    26     if (!str_to_time (argv[N], &tzero)) {
     26    if (!ohana_str_to_time (argv[N], &tzero)) {
    2727      gprint (GP_ERR, "syntax error\n");
    2828      return (FALSE);
    2929    }
    3030    remove_argument (N, &argc, argv);
    31     if (!str_to_dtime (argv[N], &trange)) {
     31    if (!ohana_str_to_dtime (argv[N], &trange)) {
    3232      gprint (GP_ERR, "syntax error\n");
    3333      return (FALSE);
     
    4242  if ((N = get_argument (argc, argv, "-trange"))) {
    4343    remove_argument (N, &argc, argv);
    44     if (!str_to_time (argv[N], &tzero)) {
     44    if (!ohana_str_to_time (argv[N], &tzero)) {
    4545      gprint (GP_ERR, "syntax error\n");
    4646      return (FALSE);
    4747    }
    4848    remove_argument (N, &argc, argv);
    49     if (!str_to_time (argv[N], &tend)) {
     49    if (!ohana_str_to_time (argv[N], &tend)) {
    5050      gprint (GP_ERR, "syntax error\n");
    5151      return (FALSE);
  • trunk/Ohana/src/opihi/dvo/subpix.c

    r14401 r14590  
    2828    return (FALSE);
    2929  }
    30   if (!str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
     30  if (!ohana_str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
    3131  if (Ra < 0) Ra += 360.0;
    3232  if (Ra > 360.0) Ra -= 360.0;
  • trunk/Ohana/src/opihi/include/convert.h

    r8192 r14590  
    1515int           day_to_sec            PROTO((char *string, time_t *second));
    1616int           hms_to_sec            PROTO((char *string, time_t *second));
    17 char         *sec_to_hms            PROTO((time_t second));
    18 char         *sec_to_day            PROTO((time_t second));
     17char         *ohana_sec_to_hms      PROTO((time_t second));
     18char         *ohana_sec_to_day      PROTO((time_t second));
    1919
    2020char         *meade_deg_to_str      PROTO((double deg));
  • trunk/Ohana/src/opihi/include/dvoshell.h

    r14401 r14590  
    4242      MEAS_NMEAS,
    4343      MEAS_NMISS,
    44       MEAS_NPHOT,
    45       MEAS_NCODE,
    4644      MEAS_OBJFLAGS,
    4745      MEAS_MAG,
     
    170168Image        *LoadImages            PROTO((int *Nimage));
    171169Image        *MatchImage            PROTO((unsigned int time, short int source));
    172 Image        *MatchImage            PROTO((unsigned int time, short int source));
    173170Coords       *MatchMosaic           PROTO((unsigned int time, short int source));
    174171int           Quality               PROTO((Measure *measure, int IsDophot));
     
    227224char        *strfloat               PROTO((float value));
    228225
     226int get_skyregion (double *Rs, double *Re, double *Ds, double *De);
     227int set_skyregion (double Rs, double Re, double Ds, double De);
     228void FreeImageSelection ();
     229
     230void FreeSkyRegionSelection (SkyRegionSelection *selection);
     231int wordhash (char *word);
     232
    229233# endif
  • trunk/Ohana/src/opihi/include/imfit.h

    r4689 r14590  
    1414void sgauss_setup (char *name);
    1515void qgauss_setup (char *name);
    16 void Pgauss_setup (char *name);
    17 void Sgauss_setup (char *name);
    18 void Qgauss_setup (char *name);
    1916void qfgauss_setup (char *name);
    2017void qrgauss_setup (char *name);
     18void pgauss_psf_setup (char *name);
     19void qgauss_psf_setup (char *name);
     20void sgauss_psf_setup (char *name);
  • trunk/Ohana/src/opihi/include/pcontrol.h

    r12840 r14590  
    216216void   LinkJobAndHost (Job *job, Host *host);
    217217
     218void pcontrol_exit (int n);
     219
    218220// Job   *FindJobByID (IDtype JobID, int *StackID);
    219221// Job   *FindJobInStackByID (int StackID, int ID);
  • trunk/Ohana/src/opihi/lib.data/convert.c

    r8192 r14590  
    117117
    118118/***** convert seconds to HH:MM:SS ****/
    119 char *sec_to_hms (time_t second) {
     119char *ohana_sec_to_hms (time_t second) {
    120120 
    121121  struct tm *gmt;
     
    129129
    130130/***** convert seconds to Day@HH:MM:SS ****/
    131 char *sec_to_day (time_t second) {
     131char *ohana_sec_to_day (time_t second) {
    132132 
    133133  struct tm *gmt;
  • trunk/Ohana/src/opihi/lib.data/open_kapa.c

    r14283 r14590  
    190190  }
    191191  KapaSetGraphData (Socket[Active], data);
     192  return (TRUE);
    192193}
    193194
     
    254255  }
    255256  KapaSetImageData (Socket[Active], data);
     257  return (TRUE);
    256258}
    257259
  • trunk/Ohana/src/opihi/lib.shell/timeformat.c

    r7917 r14590  
    77  *TimeReference = 0;
    88  if ((p = get_variable ("TIMEREF")) != (char *) NULL) {
    9     if (!str_to_time (p, TimeReference)) {
     9    if (!ohana_str_to_time (p, TimeReference)) {
    1010      gprint (GP_ERR, "error in TIME_REF format\n");
    1111      return (FALSE);
  • trunk/Ohana/src/opihi/pantasks/CheckController.c

    r12404 r14590  
    8989  if (VerboseMode()) gprint (GP_ERR, "clear %d crash jobs %f\n", i, TimerElapsed(TRUE));
    9090
    91  finish:
    9291  FlushIOBuffer (&buffer);
    9392  // status = ControllerCommand ("run", CONTROLLER_PROMPT, &buffer);
  • trunk/Ohana/src/opihi/pantasks/TaskOps.c

    r12332 r14590  
    104104        switch (tasks[i][0].ranges[j].type) {
    105105          case RANGE_ABS:
    106             start = sec_to_date (tasks[i][0].ranges[j].start);
    107             stop  = sec_to_date (tasks[i][0].ranges[j].stop);
     106            start = ohana_sec_to_date (tasks[i][0].ranges[j].start);
     107            stop  = ohana_sec_to_date (tasks[i][0].ranges[j].stop);
    108108            break;
    109109          case RANGE_DAY:
    110             start = sec_to_hms (tasks[i][0].ranges[j].start);
    111             stop  = sec_to_hms (tasks[i][0].ranges[j].stop);
     110            start = ohana_sec_to_hms (tasks[i][0].ranges[j].start);
     111            stop  = ohana_sec_to_hms (tasks[i][0].ranges[j].stop);
    112112            break;
    113113          case RANGE_WEEK:
    114             start = sec_to_day (tasks[i][0].ranges[j].start);
    115             stop  = sec_to_day (tasks[i][0].ranges[j].stop);
     114            start = ohana_sec_to_day (tasks[i][0].ranges[j].start);
     115            stop  = ohana_sec_to_day (tasks[i][0].ranges[j].stop);
    116116            break;
    117117          default:
     
    264264    switch (tasks[i][0].ranges[j].type) {
    265265      case RANGE_ABS:
    266         start = sec_to_date (tasks[i][0].ranges[j].start);
    267         stop  = sec_to_date (tasks[i][0].ranges[j].stop);
     266        start = ohana_sec_to_date (tasks[i][0].ranges[j].start);
     267        stop  = ohana_sec_to_date (tasks[i][0].ranges[j].stop);
    268268        break;
    269269      case RANGE_DAY:
    270         start = sec_to_hms (tasks[i][0].ranges[j].start);
    271         stop  = sec_to_hms (tasks[i][0].ranges[j].stop);
     270        start = ohana_sec_to_hms (tasks[i][0].ranges[j].start);
     271        stop  = ohana_sec_to_hms (tasks[i][0].ranges[j].stop);
    272272        break;
    273273      case RANGE_WEEK:
    274         start = sec_to_day (tasks[i][0].ranges[j].start);
    275         stop  = sec_to_day (tasks[i][0].ranges[j].stop);
     274        start = ohana_sec_to_day (tasks[i][0].ranges[j].start);
     275        stop  = ohana_sec_to_day (tasks[i][0].ranges[j].stop);
    276276        break;
    277277      default:
  • trunk/Ohana/src/opihi/pantasks/controller_jobstack.c

    r12467 r14590  
    2121
    2222  // XXX this has an error?  test this out...
    23   sprintf (command, "jobstack", argv[2]);
     23  sprintf (command, "jobstack %s", argv[2]);
    2424  InitIOBuffer (&buffer, 0x100);
    2525
  • trunk/Ohana/src/opihi/pantasks/flush.c

    r13548 r14590  
    22
    33int flush_jobs (int argc, char **argv) {
    4 
    5   Job *job;
    6   int JobID;
    74
    85  if (argc != 2) goto usage;
  • trunk/Ohana/src/opihi/pantasks/task.c

    r12469 r14590  
    44int task (int argc, char **argv) {
    55
    6   int N, hash;
     6  int hash;
    77  int ThisList, status;
    88  char *input, *outline;
  • trunk/Ohana/src/opihi/pantasks/task_trange.c

    r8192 r14590  
    6969  /* this test does not fail sufficiently robustly for invalid inputs */
    7070  /* test for YYYY/MM/DD - both must match */
    71   if (str_to_time (argv[1], &range.start)) {
    72     if (!str_to_time (argv[2], &range.stop)) {
     71  if (ohana_str_to_time (argv[1], &range.start)) {
     72    if (!ohana_str_to_time (argv[2], &range.stop)) {
    7373      gprint (GP_ERR, "invalid date/time %s\n", argv[2]);
    7474      goto usage;
  • trunk/Ohana/src/opihi/pcontrol/HostOps.c

    r13720 r14590  
    2525  gprint (GP_ERR, "error: unknown host stack : programming error\n");
    2626  pcontrol_exit (1);
     27  return (NULL);
    2728}
    2829
     
    3738  gprint (GP_ERR, "error: unknown host stack : programming error\n");
    3839  pcontrol_exit (1);
     40  return (NULL);
    3941}
    4042
  • trunk/Ohana/src/opihi/pcontrol/JobOps.c

    r13720 r14590  
    2828  gprint (GP_ERR, "error: unknown host stack : programming error\n");
    2929  pcontrol_exit (1);
     30  return (NULL);
    3031}
    3132
     
    4142  gprint (GP_ERR, "error: unknown job stack : programming error\n");
    4243  pcontrol_exit (1);
     44  return (NULL);
    4345}
    4446
  • trunk/Ohana/src/opihi/pcontrol/ResetJob.c

    r13720 r14590  
    4848  gprint (GP_ERR, "programming error in GetJobOutput (should not reach here)\n");
    4949  pcontrol_exit (1);
     50  return (FALSE);
    5051}
    5152
  • trunk/Ohana/src/relastro/src/ParFactor.c

    r12332 r14590  
    4949  /* given a time T in UNIX seconds, determine the solar longitude S */
    5050
    51   jd = sec_to_jd (T);
     51  jd = ohana_sec_to_jd (T);
    5252  sun_ecliptic (jd, &L, &B, &E);
    5353
  • trunk/Ohana/src/relastro/src/UpdateObjects.c

    r14381 r14590  
    6262
    6363  // use J2000 as a reference time
    64   To = date_to_sec ("2000/01/01");
     64  To = ohana_date_to_sec ("2000/01/01");
    6565  Nave = Npar = Npm = 0;
    6666
  • trunk/Ohana/src/relastro/src/args.c

    r12332 r14590  
    6161  if ((N = get_argument (argc, argv, "-time"))) {
    6262    remove_argument (N, &argc, argv);
    63     if (!str_to_time (argv[N], &TSTART)) {
     63    if (!ohana_str_to_time (argv[N], &TSTART)) {
    6464      fprintf (stderr, "ERROR: syntax error\n");
    6565      return (FALSE);
    6666    }
    6767    remove_argument (N, &argc, argv);
    68     if (!str_to_dtime (argv[N], &trange)) {
    69       if (!str_to_time (argv[N], &TSTOP)) {
     68    if (!ohana_str_to_dtime (argv[N], &trange)) {
     69      if (!ohana_str_to_time (argv[N], &TSTOP)) {
    7070        fprintf (stderr, "ERROR: syntax error\n");
    7171        return (FALSE);
  • trunk/Ohana/src/relastro/src/initialize.c

    r12731 r14590  
    4343    fprintf (stderr, "current parameter settings:\n");
    4444    if (TimeSelect) {
    45       fprintf (stderr, "TimeSelect: TRUE (%s - %s)\n", sec_to_date (TSTART), sec_to_date (TSTOP));
     45      fprintf (stderr, "TimeSelect: TRUE (%s - %s)\n", ohana_sec_to_date (TSTART), ohana_sec_to_date (TSTOP));
    4646    } else {
    4747      fprintf (stderr, "TimeSelect: FALSE\n");
  • trunk/Ohana/src/relphot/src/args.c

    r9633 r14590  
    1111  if ((N = get_argument (argc, argv, "-time"))) {
    1212    remove_argument (N, &argc, argv);
    13     if (!str_to_time (argv[N], &TSTART)) {
     13    if (!ohana_str_to_time (argv[N], &TSTART)) {
    1414      fprintf (stderr, "ERROR: syntax error\n");
    1515      return (FALSE);
    1616    }
    1717    remove_argument (N, &argc, argv);
    18     if (!str_to_dtime (argv[N], &trange)) {
    19       if (!str_to_time (argv[N], &TSTOP)) {
     18    if (!ohana_str_to_dtime (argv[N], &trange)) {
     19      if (!ohana_str_to_time (argv[N], &TSTOP)) {
    2020        fprintf (stderr, "ERROR: syntax error\n");
    2121        return (FALSE);
  • trunk/Ohana/src/relphot/src/initialize.c

    r12332 r14590  
    3030    fprintf (stderr, "current parameter settings:\n");
    3131    if (TimeSelect) {
    32       fprintf (stderr, "TimeSelect: TRUE (%s - %s)\n", sec_to_date (TSTART), sec_to_date (TSTOP));
     32      fprintf (stderr, "TimeSelect: TRUE (%s - %s)\n", ohana_sec_to_date (TSTART), ohana_sec_to_date (TSTOP));
    3333    } else {
    3434      fprintf (stderr, "TimeSelect: FALSE\n");
  • trunk/Ohana/src/relphot/src/plotstuff.c

    r14382 r14590  
    8181
    8282  float *values;
    83   int i, Nbytes;
     83  int i;
    8484
    8585  if (Npts < 1) return;
  • trunk/Ohana/src/uniphot/src/args.c

    r2492 r14590  
    99  if ((N = get_argument (argc, argv, "-time"))) {
    1010    remove_argument (N, &argc, argv);
    11     if (!str_to_time (argv[N], &TSTART)) {
     11    if (!ohana_str_to_time (argv[N], &TSTART)) {
    1212      fprintf (stderr, "ERROR: syntax error\n");
    1313      exit (1);
    1414    }
    1515    remove_argument (N, &argc, argv);
    16     if (!str_to_time (argv[N], &TSTOP)) {
     16    if (!ohana_str_to_time (argv[N], &TSTOP)) {
    1717      fprintf (stderr, "ERROR: syntax error\n");
    1818      exit (1);
  • trunk/Ohana/src/uniphot/src/find_image_tgroups.c

    r7080 r14590  
    5454    group[i].dM = 0;
    5555
    56     start = sec_to_date (tmin[i]);
    57     stop = sec_to_date (tmax[i]);
     56    start = ohana_sec_to_date (tmin[i]);
     57    stop = ohana_sec_to_date (tmax[i]);
    5858    snprintf (group[i].label, 64, "%s - %s", start, stop);
    5959    free (start);
Note: See TracChangeset for help on using the changeset viewer.