IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4844


Ignore:
Timestamp:
Aug 20, 2005, 5:40:29 AM (21 years ago)
Author:
eugene
Message:

removing pointless Fread/char

Location:
trunk/Ohana/src
Files:
10 edited

Legend:

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

    r3466 r4844  
    2323    /* load next data block */
    2424    Nbytes = BYTES_STAR * BLOCK - Nextra;
    25     nbytes = Fread (&buffer[Nextra], 1, Nbytes, f, "char");
     25    nbytes = fread (&buffer[Nextra], 1, Nbytes, f);
    2626    if (nbytes == 0) {
    2727      *nstars = N;
  • trunk/Ohana/src/getstar/src/aregion.c

    r4810 r4844  
    7979     
    8080  done = FALSE;
    81   Fread (buffer, 1, 48*NDecLines[NBigDec], f, "char");
     81  fread (buffer, 1, 48*NDecLines[NBigDec], f);
    8282  for (i = 0; !done && (i < NDecLines[NBigDec]); i++) {
    8383    strncpy (temp, &buffer[i*48], 48);
  • trunk/Ohana/src/markrock/src/aregion.c

    r4810 r4844  
    8383     
    8484  done = FALSE;
    85   Fread (buffer, 1, 48*NDecLines[NBigDec], f, "char");
     85  fread (buffer, 1, 48*NDecLines[NBigDec], f);
    8686  for (i = 0; !done && (i < NDecLines[NBigDec]); i++) {
    8787    strncpy (temp, &buffer[i*48], 48);
  • trunk/Ohana/src/markstar/src/aregion.c

    r4810 r4844  
    8383     
    8484  done = FALSE;
    85   Fread (buffer, 1, 48*NDecLines[NBigDec], f, "char");
     85  Fread (buffer, 1, 48*NDecLines[NBigDec], f);
    8686  for (i = 0; !done && (i < NDecLines[NBigDec]); i++) {
    8787    strncpy (temp, &buffer[i*48], 48);
  • trunk/Ohana/src/markstar/src/old/gstars.c

    r2490 r4844  
    141141  ALLOCATE (buffer, char, (BLOCK*BYTES_STAR));
    142142  for (i = 0; i < (int)(Nbytes / (BLOCK*BYTES_STAR)); i++) {
    143     nbytes = Fread (buffer, 1, (BLOCK*BYTES_STAR), f, "char");
     143    nbytes = Fread (buffer, 1, (BLOCK*BYTES_STAR), f);
    144144    if (nbytes != BLOCK*BYTES_STAR) {
    145145      fprintf (stderr, "ERROR: failed to read in stars (1)\n");
  • trunk/Ohana/src/misc/src/applyscat.c

    r4772 r4844  
    5252
    5353  /* load in data */
    54   nbytes = Fread (buffer, 1, Nbytes, f, "char");
     54  nbytes = fread (buffer, 1, Nbytes, f);
    5555  if (nbytes != Nbytes) {
    5656    fprintf (stderr, "ERROR: can't load in all stars\n");
  • trunk/Ohana/src/misc/src/fakestars.c

    r2417 r4844  
    7070  Nbytes = Nstar*BYTES_STAR;
    7171  ALLOCATE (buffer, char, Nbytes + 1);
    72   nbytes = Fread (buffer, 1, Nbytes, f, "char");
     72  nbytes = fread (buffer, 1, Nbytes, f);
    7373  if (nbytes != Nbytes) {
    7474    fprintf (stderr, "ERROR: failed to read in %d stars\n", Nstar);
  • trunk/Ohana/src/mosastro/src/rtext.c

    r3416 r4844  
    2424  Nbytes = BYTES_STAR * mychip[0].Nstars;
    2525  ALLOCATE (mychip[0].buffer, char, Nbytes + 1);
    26   nbytes = Fread (mychip[0].buffer, 1, Nbytes, f, "char");
     26  nbytes = fread (mychip[0].buffer, 1, Nbytes, f);
    2727  if (nbytes != Nbytes) { exit (1); }
    2828  mychip[0].Nbuffer = Nbytes;
  • trunk/Ohana/src/opihi/dvo/aregion.c

    r3462 r4844  
    4848     
    4949  done = FALSE;
    50   Fread (buffer, 1, 48*NDecLines[NBigDec], f, "char");
     50  fread (buffer, 1, 48*NDecLines[NBigDec], f);
    5151  for (i = 0; !done && (i < NDecLines[NBigDec]); i++) {
    5252    strncpy (temp, &buffer[i*48], 48);
  • trunk/Ohana/src/opihi/dvo/cmatch.c

    r4800 r4844  
    11# include "dvo1.h"
    2 # define BYTES_STAR 23
    3 # define BLOCK 1000
    4 # define DNSTARS 1000
    52
    63int cmatch (int argc, char **argv) {
     
    1512  Vector *rvec, *dvec, *mvec, *drvec, *ddvec, *dmvec;
    1613
     14  VarConfig ("GSCDIR", "%s", gscdir);
    1715  VarConfig ("CATDIR", "%s", catdir);
    18   VarConfig ("GSCDIR", "%s", gscdir);
     16  if (VarConfig ("CATMODE", "%s", catalog.catmode) == NULL)
     17    strcpy (catalog.catmode, "RAW");
    1918     
    2019  if (argc != 9) {
    2120    fprintf (stderr, "USAGE: cmatch file radius (RA) (DEC) (Mag) (dRA) (dDEC) (dMag)\n");
     21    fprintf (stderr, "       match a set of object coordinates with a DVO db table\n");
    2222    return (FALSE);
    2323  }
     24
     25  /*** this function is not well-defined.  re-assess it and re-code it ***/
     26  fprintf (stderr, "disabled for now\n");
     27  return (FALSE);
    2428
    2529  radius = atof (argv[2]);
     
    3438  /* load data from the photometry database file */
    3539  sprintf (filename, "%s/%s", catdir, argv[1]);
    36   if (!fits_read_header (filename, &catalog1.header)) {
    37     fprintf (stderr, "no stars in %s\n", filename);
     40  catalog1.filename = filename;
     41  switch (lock_catalog (&catalog, LCK_SOFT)) {
     42  case 2:
     43    unlock_catalog (&catalog);
     44  case 0:
    3845    return (FALSE);
    3946  }
    40   f = fopen (filename, "r");
    41   if (f == (FILE *) NULL) {
    42     fprintf (stderr, "no stars in %s\n", filename);
     47  if (!load_catalog (&catalog, LOAD_AVES | LOAD_MEAS | LOAD_SECF, TRUE)) {
     48    unlock_catalog (&catalog);
    4349    return (FALSE);
    4450  }
    45   fseek (f, catalog1.header.size, SEEK_SET);
    46  
    47   /** find number of stars, measurements **/
    48   catalog1.Naverage = 0;
    49   fits_scan (&catalog1.header, "NSTARS", "%d", 1, &catalog1.Naverage);
    50   if (catalog1.Naverage == 0) {
    51     fprintf (stderr, "no stars in catalog %s\n", filename);
    52     fclose (f);
    53     return (TRUE);
    54   }
    55   ALLOCATE (catalog1.average, Average, catalog1.Naverage);
    56   Nitems = catalog1.Naverage;
    57   nitems = Fread (catalog1.average, sizeof(Average), Nitems, f, "average");
    58   if (nitems != Nitems) {
    59     fprintf (stderr, "ERROR: failed to read data from catalog file %s (1)\n", filename);
    60     fclose (f);
    61     free (catalog1.average);
    62     return (FALSE);
    63   }
    64   fclose (f);
     51  unlock_catalog (&catalog);
    6552  fprintf (stderr, "read %d stars from phot catalog file %s\n", catalog1.Naverage, filename);
    6653
    67   /* load data from the GSC file */
    68   sprintf (filename, "%s/%s", gscdir, argv[1]);
    69   f = fopen (filename, "r");
    70   if (f == (FILE *) NULL) {
    71     fprintf (stderr, "no stars in %s\n", filename);
    72     free (catalog1.average);
    73     return (FALSE);
    74     /* return (FALSE); */
    75   }
    76  
    7754  nstar = 0;
    7855  NSTARS = DNSTARS;
Note: See TracChangeset for help on using the changeset viewer.