IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4796


Ignore:
Timestamp:
Aug 16, 2005, 3:00:56 PM (21 years ago)
Author:
eugene
Message:

moving to internal vs external measure/average: R,D + dR,dD.
NOTE * dR,dD now represent 1.0 arcsec, not 0.01 arcsec.

* all use has been updated to match

also, cleanups to pass Wall,Werror

Location:
trunk/Ohana/src/relphot
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/relphot/include/relphot.h

    r3466 r4796  
    44/* # define GRID_V1 */
    55# define GRID_V2
    6 
    7 static union { unsigned char c[4]; float f; } f_undef = { 0xff, 0xff, 0xff, 0xfe };
    8 # define fUNDEF (f_undef.f)
    9 
    10 static union { unsigned char c[8]; float d; } d_undef = { 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00 };
    11 # define dUNDEF (d_undef.d)
    126
    137typedef struct {
     
    9589int TimeSelect;
    9690unsigned int TSTART, TSTOP;
     91
     92# ifdef GRID_V1
     93int setGridMeasure (int meas, int cat, double X, double Y);
     94# endif
     95
     96# ifdef GRID_V2
     97int setGridMeasure (int meas, int cat, double X, double Y, int ccdnum);
     98# endif
    9799
    98100/***** prototypes ****/
     
    139141void reload_catalogs (GSCRegion *region, int Nregion, GSCRegion *fullregion);
    140142void free_catalogs (Catalog *catalog, int Ncatalog);
    141 
    142 # ifdef GRID_V1
    143 int setGridMeasure (int meas, int cat, double X, double Y);
    144 # endif
    145 
    146 # ifdef GRID_V2
    147 int setGridMeasure (int meas, int cat, double X, double Y, int ccdnum);
    148 # endif
    149 
    150143void set_ZP (double ZERO);
    151 
    152144char *GetPhotnamebyCode (PhotCodeData *photcodes, int code);
    153145StatType statsStarS (Catalog *catalog, int Ncatalog);
     
    157149StatType statsImageX (Catalog *catalog);
    158150StatType statsImageM (Catalog *catalog);
     151void plot_scatter (Catalog *catalog, int Ncatalog);
     152void plot_defaults (Graphdata *graphdata);
     153void plot_list (Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *file);
     154void plot_stars (Catalog *catalog, int Ncatalog);
     155void plot_chisq (Catalog *catalog, int Ncatalog);
     156void plot_star_coords (Catalog *catalog, int Ncatalog);
     157void plot_grid (Catalog *catalog);
     158void dump_grid ();
     159int *SelectRefMosaic (Mosaic **refmosaic, int *Nimage);
     160Image *getimage (int N);
     161void InterpolateGrid (float *buffer, int Nx, int Ny, Coords *ccd, Coords *gcoords);
     162void plot_mosaic_fields (Catalog *catalog);
     163void plot_mosaics ();
     164void plot_images ();
     165void wimages ();
     166void clean_mosaics ();
     167void freeMosaicBins (int Ncatalog);
     168void freeGridBins (int Ncatalog);
     169void clean_measures (Catalog *catalog, int Ncatalog, int final);
     170void global_stats (Catalog *catalog, int Ncatalog);
     171StatType statsImagedM (Catalog *catalog);
     172StatType statsMosaicdM (Catalog *catalog);
     173StatType statsMosaicM (Catalog *catalog);
     174StatType statsMosaicN (Catalog *catalog);
     175StatType statsMosaicX (Catalog *catalog);
     176Coords *getCoords (int meas, int cat);
     177int setExclusions (Catalog *catalog, int Ncatalog);
     178void freeImageBins (int Ncatalog);
     179void sortA (double *X, int N);
     180void sortB (double *X, double *Y, int N);
     181void sortC (double *X, double *Y, double *F1, double *F2, int N);
     182void sortD (double *X, double *Y, double *Z, int N);
     183void initstats (char *mode);
     184int liststats (double *value, double *dvalue, int N, StatType *stats);
     185
     186int dms_to_ddd (double *Value, char *string);
     187int str_to_radec (double *ra, double *dec, char *str1, char *str2);
     188int chk_time (char *line);
     189double sec_to_jd (unsigned long second);
     190unsigned long int jd_to_sec (double jd);
     191char *sec_to_date (unsigned long second);
     192unsigned long date_to_sec (char *date);
     193 
     194int str_to_time (char *line, unsigned int *second);
     195int str_to_dtime (char *line, double *second);
     196int Fseek (FILE *f, long offset, int whence);
     197void GetConfig (char *config, char *field, char *format, int N, void *ptr);
     198void skip_measurements (Catalog *catalog, int pass);
     199Image *getimages (int *N);
     200
     201void setMrelFinal (Catalog *catalog);
     202void skip_measurements (Catalog *catalog, int pass);
     203GSCRegion *get_regions (double minRa, double maxRa, double minDec, double maxDec, int *Nregions);
     204int hms_to_deg (double *h0, double *h1, double *d0, double *d1, char *string);
     205GSCRegion *find_regions (Image *image, int Nimage, int *Nregions, GSCRegion *fullregion);
     206void getfullregion (Image *image, int Nimage, GSCRegion *fullregion);
     207void setMcalFinal (Image *image, int Nimage);
     208int gcatalog (Catalog *catalog, int FINAL);
     209void write_coords (Header *header, Coords *coords);
     210void wcatalog (Catalog *catalog);
     211int setMrelOutput (Catalog *catalog, int Ncatalog, int mark);
     212int setMcalOutput (Catalog *catalog, int Ncatalog);
  • trunk/Ohana/src/relphot/src/ConfigInit.c

    r2486 r4796  
    11# include "relphot.h"
    2 void GetConfig (char *config, char *field, char *format, int N, void *ptr);
    32
    43void ConfigInit (int *argc, char **argv) {
     
    6059void GetConfig (char *config, char *field, char *format, int N, void *ptr) {
    6160
    62   int status;
     61  char *status;
    6362
    6463  status = ScanConfig (config, field, format, N, ptr);
    65   if (!status) {
     64  if (status == NULL) {
    6665    fprintf (stderr, "error in config, cannot find %s\n", field);
    6766    exit (1);
  • trunk/Ohana/src/relphot/src/GridOps.v2.c

    r2486 r4796  
    227227  return (TRUE);
    228228
    229 escape:
    230229  fprintf (stderr, "error: star out of grid\n");
    231230  exit (1);
     
    352351}
    353352
    354 int *SelectRefMosaic (Mosaic **refmosaic, int *Nimage);
    355 Image *getimage (int N);
    356 
    357353void dump_grid () {
    358354
    359   int i, j, Nx, Ny, Nimage;
     355  int i, j, Nimage;
    360356  int *imlist;
    361   char *p, *pname, ccdname[80];
    362357  FILE *f;
    363358  Header header, theader;
    364359  Matrix matrix;
    365360  Mosaic *refmosaic;
    366   Image *image;
    367361   
    368362  /* select reference mosaic image */
     
    517511}
    518512
    519 InterpolateGrid (float *buffer, int Nx, int Ny, Coords *ccd, Coords *gcoords) {
     513void InterpolateGrid (float *buffer, int Nx, int Ny, Coords *ccd, Coords *gcoords) {
    520514
    521515  int i, j;
    522   double x, y, r, d, X, Y, dx, dy, dVx, dVy, dVxy;
     516  double x, y, r, d, X, Y, dx, dy;
    523517  double V00, V01, V10, V11;
    524518  double wV00, wV01, wV10, wV11;
  • trunk/Ohana/src/relphot/src/ImageOps.c

    r2486 r4796  
    1515void initImages (Image *input, int N) {
    1616
    17   int i, j;
     17  int i;
    1818
    1919  image = input;
     
    111111      /* add this measurement to the grid cell for this chip */
    112112      ave = measure[0].averef;
    113       ra  = catalog[cat].average[ave].R - measure[0].dR / 360000.0;
    114       dec = catalog[cat].average[ave].D - measure[0].dD / 360000.0;
     113      ra  = catalog[cat].average[ave].R_PS - measure[0].dR_PS / 3600.0;
     114      dec = catalog[cat].average[ave].D_PS - measure[0].dD_PS / 3600.0;
    115115       
    116116      /* X,Y always positive-definite in range 0,0 - dX, dY */
     
    152152
    153153  int i;
    154   short value;
    155154
    156155  i = bin[cat][meas];
     
    285284void plot_images () {
    286285
    287   int i, j, m, c, N, Nmax, bin;
    288   short Mrel, Mcal, Mmos;
     286  int i, bin;
    289287  double *xlist, *Mlist, *dlist;
    290288  Graphdata graphdata;
     
    334332StatType statsImageN (Catalog *catalog) {
    335333
    336   int i, j, k, m, c, n, N, Nmax;
     334  int i, j, m, c, n, N;
    337335  double *list, *dlist;
    338336  StatType stats;
     
    372370StatType statsImageX (Catalog *catalog) {
    373371
    374   int i, j, k, m, n, N, Nmax;
     372  int i, n;
    375373  double *list, *dlist;
    376374  StatType stats;
     
    400398StatType statsImageM (Catalog *catalog) {
    401399
    402   int i, j, k, m, n, N, Nmax;
     400  int i, n;
    403401  double *list, *dlist;
    404402  StatType stats;
     
    428426StatType statsImagedM (Catalog *catalog) {
    429427
    430   int i, j, k, m, n, N, Nmax;
     428  int i, n;
    431429  double *list, *dlist;
    432430  StatType stats;
  • trunk/Ohana/src/relphot/src/MosaicOps.c

    r3417 r4796  
    9999  int i, j, m, NX, NY;
    100100  int dXmax, dYmax;
    101   double dR, dD, dS, dX, dY;
     101  double dS, dX, dY;
    102102  double R, D, Rmin, Rmax, Dmin, Dmax;
    103103  double Mcal, dMcal, Xm;
     
    211211}
    212212
    213 void freeMosaicBins (Ncatalog) {
     213void freeMosaicBins (int Ncatalog) {
    214214
    215215  int i;
     
    249249    }
    250250  }
    251  
     251  return (TRUE);
    252252}
    253253
    254254void matchMosaics (Catalog *catalog, int meas, int cat) {
    255255
    256   int i, ave;
    257   double ra, dec, X, Y;
     256  int i;
    258257
    259258  for (i = 0; i < Nmosaic; i++) {
     
    264263    if (USE_GRID) {
    265264      ave = catalog[cat].measure[meas].averef;
    266       ra  = catalog[cat].average[ave].R - catalog[cat].measure[meas].dR / 360000.0;
    267       dec = catalog[cat].average[ave].D - catalog[cat].measure[meas].dD / 360000.0;
     265      ra  = catalog[cat].average[ave].R_PS - catalog[cat].measure[meas].dR_PS / 3600.0;
     266      dec = catalog[cat].average[ave].D_PS - catalog[cat].measure[meas].dD_PS / 3600.0;
    268267
    269268      /* X,Y always positive-definite in range 0,0 - dX, dY */
     
    311310  StatType stats;
    312311  Image *image;
    313   Graphdata graphdata;
    314312
    315313  if (!MOSAICNAME[0]) return (FALSE);
     
    391389StatType statsMosaicM (Catalog *catalog) {
    392390
    393   int i, n, N, Nmax;
     391  int i, n;
    394392  double *list, *dlist;
    395393  StatType stats;
     
    417415StatType statsMosaicdM (Catalog *catalog) {
    418416
    419   int i, n, N, Nmax;
     417  int i, n;
    420418  double *list, *dlist;
    421419  StatType stats;
     
    444442StatType statsMosaicN (Catalog *catalog) {
    445443
    446   int i, j, k, m, c, n, N, Nmax;
     444  int i, j, m, c, n, N;
    447445  double *list, *dlist;
    448446  StatType stats;
     
    483481StatType statsMosaicX (Catalog *catalog) {
    484482
    485   int i, n, N, Nmax;
     483  int i, n;
    486484  double *list, *dlist;
    487485  StatType stats;
     
    511509void clean_mosaics () {
    512510
    513   int i, j, N, mark, Nmark;
     511  int i, N, mark, Nmark;
    514512  double *mlist, *slist, *dlist;
    515513  double MaxOffset, MedOffset, MaxScatter;
    516514  StatType stats;
    517   Image *image;
    518515
    519516  if (!MOSAICNAME[0]) return;
     
    562559
    563560  int i, j, m, c, N, ave, Nimage;
    564   short Mrel, Mcal, Mmos;
    565561  double *xlist, *ylist;
    566562  double Xmin, Xmax, Ymin, Ymax;
     
    592588
    593589      ave = catalog[c].measure[m].averef;
    594       xlist[N] = catalog[c].average[ave].R - catalog[c].measure[m].dR / 360000.0;
    595       ylist[N] = catalog[c].average[ave].D - catalog[c].measure[m].dD / 360000.0;
     590      xlist[N] = catalog[c].average[ave].R_PS - catalog[c].measure[m].dR_PS / 3600.0;
     591      ylist[N] = catalog[c].average[ave].D_PS - catalog[c].measure[m].dD_PS / 3600.0;
    596592      N++;
    597593    }
     
    608604void plot_mosaics () {
    609605
    610   int i, j, m, c, N, Nmax, bin;
    611   short Mrel, Mcal, Mmos;
     606  int i, bin;
    612607  double *xlist, *Mlist, *dlist;
    613608  Graphdata graphdata;
  • trunk/Ohana/src/relphot/src/StarOps.c

    r2486 r4796  
    7676    }
    7777  }
     78  return (TRUE);
    7879}
    7980
     
    134135  free (list);
    135136  free (dlist);
     137  return (TRUE);
    136138}
    137139
     
    366368StatType statsStarX (Catalog *catalog, int Ncatalog) {
    367369
    368   int i, j, k, m, n, N, Ntot, Xm;
     370  int i, j, n, Ntot, Xm;
    369371  double *list, *dlist;
    370372  StatType stats;
     
    401403StatType statsStarS (Catalog *catalog, int Ncatalog) {
    402404
    403   int i, j, k, m, n, N, Ntot, dM;
     405  int i, j, n, Ntot, dM;
    404406  double *list, *dlist;
    405407  StatType stats;
     
    435437void plot_stars (Catalog *catalog, int Ncatalog) {
    436438
    437   int i, j, m, c, N, bin;
     439  int i, j, bin;
    438440  short dMrel;
    439441  double *xlist, *Mlist;
     
    497499void plot_star_coords (Catalog *catalog, int Ncatalog) {
    498500
    499   int i, j, m, c, N, bin;
    500   short Mrel, Mcal, Mmos;
     501  int i, j, N;
    501502  double *xlist, *ylist;
    502503  double Xmin, Ymin, Xmax, Ymax;
     
    515516  for (i = 0; i < Ncatalog; i++) {
    516517    for (j = 0; j < catalog[i].Naverage; j++) {
    517       xlist[N] = catalog[i].average[j].R;
    518       ylist[N] = catalog[i].average[j].D;
     518      xlist[N] = catalog[i].average[j].R_PS;
     519      ylist[N] = catalog[i].average[j].D_PS;
    519520      N++;
    520521    }
  • trunk/Ohana/src/relphot/src/args.c

    r3417 r4796  
    77  /* define time */
    88  TimeSelect = FALSE;
    9   if (N = get_argument (argc, argv, "-time")) {
     9  if ((N = get_argument (argc, argv, "-time"))) {
    1010    remove_argument (N, &argc, argv);
    1111    if (!str_to_time (argv[N], &TSTART)) {
     
    162162    exit (2);
    163163  }
    164 
     164  return (TRUE);
    165165}
    166166
  • trunk/Ohana/src/relphot/src/bcatalog.c

    r2486 r4796  
    1818  for (i = 0; i < catalog[0].Naverage; i++) {
    1919    if (catalog[0].average[i].Nm < 2) continue;
    20     if (catalog[0].average[i].R < fullregion[0].RA[0]) continue;
    21     if (catalog[0].average[i].R > fullregion[0].RA[1]) continue;
    22     if (catalog[0].average[i].D < fullregion[0].DEC[0]) continue;
    23     if (catalog[0].average[i].D > fullregion[0].DEC[1]) continue;
     20    if (catalog[0].average[i].R_PS < fullregion[0].RA[0]) continue;
     21    if (catalog[0].average[i].R_PS > fullregion[0].RA[1]) continue;
     22    if (catalog[0].average[i].D_PS < fullregion[0].DEC[0]) continue;
     23    if (catalog[0].average[i].D_PS > fullregion[0].DEC[1]) continue;
    2424
    2525    /* start with all stars good */
     
    116116             subcatalog[0].Naverage, subcatalog[0].Nmeasure);
    117117  }
    118 
     118  return (TRUE);
    119119}
  • trunk/Ohana/src/relphot/src/find_images.c

    r2616 r4796  
    1111  Header header;
    1212  Image *timage, *image;
    13   int i, j, k, m, found, nimage, Nimage, NIMAGE, NTIMAGE, Nloop, Nlast;
    14   int n, Nim, status, InRange, ecode;
     13  int i, j, k, m, found, nimage, Nimage, NIMAGE;
     14  int status, InRange, ecode;
    1515  FILE *f;
    1616  double Xc[5], Yc[5], Xi[5], Yi[5], r, d, dx, dy;
    17   char line[256];
    1817  int *line_number;
    1918  Coords tcoords;
  • trunk/Ohana/src/relphot/src/find_regions.c

    r2486 r4796  
    5959
    6060
    61 getfullregion (Image *image, int Nimage, GSCRegion *fullregion) {
     61void getfullregion (Image *image, int Nimage, GSCRegion *fullregion) {
    6262
    6363  int i;
  • trunk/Ohana/src/relphot/src/gcatalog.c

    r2486 r4796  
    33int gcatalog (Catalog *catalog, int FINAL) {
    44 
    5   char mode, status;
     5  char mode;
    66
    77  if (FINAL) {
  • trunk/Ohana/src/relphot/src/get_regions.c

    r2486 r4796  
    5555  /* use the pole regions, if near pole */
    5656  if (maxDec > 86.25) {
    57     sprintf (regions[nregions].filename, "n8230/pole.cpt\0");
     57    sprintf (regions[nregions].filename, "n8230/pole.cpt");
    5858    regions[nregions].RA[0] = 0;
    5959    regions[nregions].RA[1] = 360;
     
    118118      if ((DEC1 > 0) && (minDec < DEC1) && (maxDec > DEC0) && (minRa < RA1) && (maxRa > RA0)) {
    119119        temp[5] = 0;
    120         sprintf (regions[nregions].filename, "%s/%s.cpt\0", Dec2Sections[NBigDec + j], &temp[1]);
     120        sprintf (regions[nregions].filename, "%s/%s.cpt", Dec2Sections[NBigDec + j], &temp[1]);
    121121        regions[nregions].RA[0] = RA0;
    122122        regions[nregions].RA[1] = RA1;
     
    131131      if ((DEC1 < 0) && (minDec < DEC0) && (maxDec > DEC1) && (minRa < RA1) && (maxRa > RA0)) {
    132132        temp[5] = 0;
    133         sprintf (regions[nregions].filename, "%s/%s.cpt\0", Dec2Sections[NBigDec + j], &temp[1]);
     133        sprintf (regions[nregions].filename, "%s/%s.cpt", Dec2Sections[NBigDec + j], &temp[1]);
    134134        regions[nregions].RA[0] = RA0;
    135135        regions[nregions].RA[1] = RA1;
  • trunk/Ohana/src/relphot/src/global_stats.c

    r2486 r4796  
    11# include "relphot.h"
    22
    3 StatType statsImagedM (Catalog *catalog);
    4 
    5 StatType statsMosaicdM (Catalog *catalog);
    6 StatType statsMosaicM (Catalog *catalog);
    7 StatType statsMosaicN (Catalog *catalog);
    8 StatType statsMosaicX (Catalog *catalog);
    9 
    10 global_stats (Catalog *catalog, int Ncatalog) {
     3void global_stats (Catalog *catalog, int Ncatalog) {
    114
    125  StatType stN, stX, stS, imN, imX, imM, imD, msM, msX, msN, msD;
  • trunk/Ohana/src/relphot/src/initialize.c

    r2486 r4796  
    22
    33void initialize (int argc, char **argv) {
    4 
    5   int Np;
    64
    75  /* are these set correctly? */
  • trunk/Ohana/src/relphot/src/liststats.c

    r2486 r4796  
    66static int statmode;
    77
    8 initstats (char *mode) {
     8void initstats (char *mode) {
    99
    1010  statmode = -1;
  • trunk/Ohana/src/relphot/src/misc.c

    r2486 r4796  
     1# include "relphot.h"
    12
    2 sortA (double *X, int N) {
     3void sortA (double *X, int N) {
    34
    45  int l,j,ir,i;
     
    3637}
    3738
    38 sortB (double *X, double *Y, int N) {
     39void sortB (double *X, double *Y, int N) {
    3940
    4041  int l,j,ir,i;
     
    7879}
    7980
    80 sortC (double *X, double *Y, double *F1, double *F2, int N) {
     81void sortC (double *X, double *Y, double *F1, double *F2, int N) {
    8182
    8283  int l,j,ir,i;
     
    133134}
    134135
    135 sortD (double *X, double *Y, double *Z, int N) {
     136void sortD (double *X, double *Y, double *Z, int N) {
    136137
    137138  int l,j,ir,i;
  • trunk/Ohana/src/relphot/src/plot_scatter.c

    r2486 r4796  
    11# include "relphot.h"
    22   
    3 plot_scatter (Catalog *catalog, int Ncatalog) {
     3void plot_scatter (Catalog *catalog, int Ncatalog) {
    44
    5   char c;
    65  int i, j, k, m, N, Ntot;
    76  short Mrel, Mcal, Mmos, Mgrid;
    87  double *xlist, *ylist, *ilist;
    9   StatType stats;
    108  Graphdata graphdata;
    119
  • trunk/Ohana/src/relphot/src/plotstuff.c

    r2486 r4796  
    44static int Xgraph[5] = {0,0,0,0,0};
    55static int active;
     6
     7/*
     8static union { unsigned char c[4]; float f; } f_undef = { {0xff, 0xff, 0xff, 0xfe} };
     9# define fUNDEF (f_undef.f)
     10*/
     11
     12static union { unsigned char c[8]; float d; } d_undef = { {0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00} };
     13# define dUNDEF (d_undef.d)
    614
    715void XDead () {
     
    2129# endif /* ANSI */
    2230
    23   int i, InitSocket, status, addreslen;
     31  int InitSocket, status, addreslen;
    2432  struct sockaddr_un Address;
    25   char temp[100], *display_name;
     33  char temp[100];
    2634  char socket_name[100];
    27   FILE *f;
    2835 
    2936  active = N;
     
    3542  Address.sun_family = AF_UNIX;
    3643  InitSocket = socket (AF_UNIX, SOCK_STREAM, 0);
    37   status = bind (InitSocket, &Address, sizeof (Address));
     44  status = bind (InitSocket, (struct sockaddr *) &Address, sizeof (Address));
    3845  status = listen (InitSocket, 1);
    3946 
     
    4754 
    4855  addreslen =  sizeof (Address);
    49   Xgraph[N] = accept (InitSocket, &Address, &addreslen);
     56  Xgraph[N] = accept (InitSocket, (struct sockaddr *) &Address, &addreslen);
    5057  if (Xgraph[N] < 0) {
    5158    fprintf (stderr, "error starting kapa\n");
     
    6572  write (Xgraph[N], "DBOX", 4);
    6673  sprintf (buffer, "%f %f %f %f", graphmode[0].xmin, graphmode[0].xmax, graphmode[0].ymin, graphmode[0].ymax);
    67   sprintf (buffer2, "NBYTES: %6d", strlen (buffer));
     74  sprintf (buffer2, "NBYTES: %6d", (int) strlen (buffer));
    6875  write (Xgraph[N], buffer2, 16);
    6976  write (Xgraph[N], buffer, strlen (buffer));
    7077
    7178  sprintf (buffer, "%s %s %s", "2222", "2222", "2222");
    72   sprintf (buffer2, "NBYTES: %6d", strlen (buffer));
     79  sprintf (buffer2, "NBYTES: %6d", (int) strlen (buffer));
    7380  write (Xgraph[N], buffer2, 16);
    7481  write (Xgraph[N], buffer, strlen (buffer));
     
    7683
    7784void JpegPlot (Graphdata *graphmode, int N, char *filename) {
    78   char buffer[65], buffer2[65];
     85
     86  char buffer[65];
    7987
    8088  if (Xgraph[N] == 0) return;
    8189
    8290  write (Xgraph[N], "PNGF", 4);
    83   sprintf (buffer, "LEN: %11d", strlen (filename));
     91  sprintf (buffer, "LEN: %11d", (int) strlen (filename));
    8492  write (Xgraph[N], buffer, 16);
    8593  write (Xgraph[N], filename, strlen (filename));
     
    8896
    8997void PSPlot (Graphdata *graphmode, int N, char *filename) {
    90   char buffer[65], buffer2[65];
     98
     99  char buffer[65];
    91100
    92101  if (Xgraph[N] == 0) return;
    93102
    94103  write (Xgraph[N], "PSIT", 4);
    95   sprintf (buffer, "LEN: %11d", strlen (filename));
     104  sprintf (buffer, "LEN: %11d", (int) strlen (filename));
    96105  write (Xgraph[N], buffer, 16);
    97106  write (Xgraph[N], filename, strlen (filename));
     
    126135           graphmode[0].etype, graphmode[0].color,
    127136           graphmode[0].lweight, graphmode[0].size);
    128   sprintf (buffer2, "NBYTES: %6d", strlen (buffer));
     137  sprintf (buffer2, "NBYTES: %6d", (int) strlen (buffer));
    129138  write (Xgraph[N], buffer2, 16);
    130139  write (Xgraph[N], buffer, strlen (buffer));
     
    133142           graphmode[0].xmin, graphmode[0].xmax,
    134143           graphmode[0].ymin, graphmode[0].ymax);
    135   sprintf (buffer2, "NBYTES: %6d", strlen (buffer));
     144  sprintf (buffer2, "NBYTES: %6d", (int) strlen (buffer));
    136145  write (Xgraph[N], buffer2, 16);
    137146  write (Xgraph[N], buffer, strlen (buffer));
     
    146155
    147156  write (Xgraph[N], "LABL", 4);
    148   sprintf (buffer, " %6d %6d", strlen (string), 2);
     157  sprintf (buffer, " %6d %6d", (int) strlen (string), 2);
    149158  write (Xgraph[N], buffer, 16);
    150159  write (Xgraph[N], string, strlen (string));
     
    170179}
    171180
    172 plot_list (Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *file) {
     181void plot_list (Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *file) {
    173182
    174183  int i;
    175   char c;
    176184  StatType stats;
    177185 
     
    207215}
    208216
    209 plot_defaults (Graphdata *graphdata) {
     217void plot_defaults (Graphdata *graphdata) {
    210218
    211219  graphdata[0].style = 2;
  • trunk/Ohana/src/relphot/src/relphot.c

    r2486 r4796  
    44int main (int argc, char **argv) {
    55
    6   char c;
    76  int i, Ncatalog;
    8   Catalog *catalog, tcatalog;
     7  Catalog *catalog;
    98  GSCRegion fullregion, *region;
    109
     
    8180  reload_catalogs (region, Ncatalog, &fullregion);
    8281  wimages ();
    83 
     82  exit (0);
    8483}
    8584
  • trunk/Ohana/src/relphot/src/setExclusions.c

    r2486 r4796  
    11# include "relphot.h"
    2 
    3 Coords *getCoords (int meas, int cat);
    42
    53int setExclusions (Catalog *catalog, int Ncatalog) {
     
    2725        /* select measurements by mag limit */
    2826        if (AreaSelect) {
    29           r = catalog[i].average[j].R + catalog[i].measure[m].dR / 360000.0;
    30           d = catalog[i].average[j].D + catalog[i].measure[m].dD / 360000.0;
     27          r = catalog[i].average[j].R_PS + catalog[i].measure[m].dR_PS / 3600.0;
     28          d = catalog[i].average[j].D_PS + catalog[i].measure[m].dD_PS / 3600.0;
    3129          if ((coords = getCoords (m, i)) == NULL) goto markbad;
    3230          RD_to_XY (&x, &y, r, d, coords);
     
    5250  if (VERBOSE) fprintf (stderr, "%d measurements marked by area\n", Narea);
    5351  if (VERBOSE) fprintf (stderr, "%d measurements marked nocal\n", Nnocal);
     52  return (TRUE);
    5453}
    55 
    56 
  • trunk/Ohana/src/relphot/src/setMrelFinal.c

    r2486 r4796  
    11# include "relphot.h"
    2 
    3 void skip_measurements (Catalog *catalog, int pass);
    4 Image *getimages (int *N);
    52
    63void setMrelFinal (Catalog *catalog) {
     
    7370void skip_measurements (Catalog *catalog, int pass) {
    7471
    75   int i, j, k, m, Nimage, ecode, d1, d2;
     72  int i, k, m, ecode, d1, d2;
    7673  int Ntot, Ntry, Nkeep, Nskip;
    7774  short mag;
    78   Image *image;
    7975
    8076  Ntot = Ntry = Nskip = Nkeep = 0;
  • trunk/Ohana/src/relphot/src/time.c

    r2486 r4796  
    1 # include <ohana.h>
    2 
    3 int dms_to_ddd (double *Value, char *string);
    4 int str_to_radec (double *ra, double *dec, char *str1, char *str2);
    5 int chk_time (char *line);
    6 double sec_to_jd (unsigned long second);
    7 unsigned long int jd_to_sec (double jd);
    8 char *sec_to_date (unsigned long second);
    9 unsigned long date_to_sec (char *date);
    10  
     1# include "relphot.h"
     2
    113/***** convert [-]00:00:00 to 0.0000 ****/
    124int dms_to_ddd (double *Value, char *string) {
     
    305297int Fseek (FILE *f, long offset, int whence) {
    306298
    307   int status, k;
     299  int status;
    308300
    309301  status = fseek (f, offset, whence);
Note: See TracChangeset for help on using the changeset viewer.