Changeset 4844
- Timestamp:
- Aug 20, 2005, 5:40:29 AM (21 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 10 edited
-
addstar/src/rtext.c (modified) (1 diff)
-
getstar/src/aregion.c (modified) (1 diff)
-
markrock/src/aregion.c (modified) (1 diff)
-
markstar/src/aregion.c (modified) (1 diff)
-
markstar/src/old/gstars.c (modified) (1 diff)
-
misc/src/applyscat.c (modified) (1 diff)
-
misc/src/fakestars.c (modified) (1 diff)
-
mosastro/src/rtext.c (modified) (1 diff)
-
opihi/dvo/aregion.c (modified) (1 diff)
-
opihi/dvo/cmatch.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/rtext.c
r3466 r4844 23 23 /* load next data block */ 24 24 Nbytes = BYTES_STAR * BLOCK - Nextra; 25 nbytes = Fread (&buffer[Nextra], 1, Nbytes, f, "char");25 nbytes = fread (&buffer[Nextra], 1, Nbytes, f); 26 26 if (nbytes == 0) { 27 27 *nstars = N; -
trunk/Ohana/src/getstar/src/aregion.c
r4810 r4844 79 79 80 80 done = FALSE; 81 Fread (buffer, 1, 48*NDecLines[NBigDec], f, "char");81 fread (buffer, 1, 48*NDecLines[NBigDec], f); 82 82 for (i = 0; !done && (i < NDecLines[NBigDec]); i++) { 83 83 strncpy (temp, &buffer[i*48], 48); -
trunk/Ohana/src/markrock/src/aregion.c
r4810 r4844 83 83 84 84 done = FALSE; 85 Fread (buffer, 1, 48*NDecLines[NBigDec], f, "char");85 fread (buffer, 1, 48*NDecLines[NBigDec], f); 86 86 for (i = 0; !done && (i < NDecLines[NBigDec]); i++) { 87 87 strncpy (temp, &buffer[i*48], 48); -
trunk/Ohana/src/markstar/src/aregion.c
r4810 r4844 83 83 84 84 done = FALSE; 85 Fread (buffer, 1, 48*NDecLines[NBigDec], f , "char");85 Fread (buffer, 1, 48*NDecLines[NBigDec], f); 86 86 for (i = 0; !done && (i < NDecLines[NBigDec]); i++) { 87 87 strncpy (temp, &buffer[i*48], 48); -
trunk/Ohana/src/markstar/src/old/gstars.c
r2490 r4844 141 141 ALLOCATE (buffer, char, (BLOCK*BYTES_STAR)); 142 142 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); 144 144 if (nbytes != BLOCK*BYTES_STAR) { 145 145 fprintf (stderr, "ERROR: failed to read in stars (1)\n"); -
trunk/Ohana/src/misc/src/applyscat.c
r4772 r4844 52 52 53 53 /* load in data */ 54 nbytes = Fread (buffer, 1, Nbytes, f, "char");54 nbytes = fread (buffer, 1, Nbytes, f); 55 55 if (nbytes != Nbytes) { 56 56 fprintf (stderr, "ERROR: can't load in all stars\n"); -
trunk/Ohana/src/misc/src/fakestars.c
r2417 r4844 70 70 Nbytes = Nstar*BYTES_STAR; 71 71 ALLOCATE (buffer, char, Nbytes + 1); 72 nbytes = Fread (buffer, 1, Nbytes, f, "char");72 nbytes = fread (buffer, 1, Nbytes, f); 73 73 if (nbytes != Nbytes) { 74 74 fprintf (stderr, "ERROR: failed to read in %d stars\n", Nstar); -
trunk/Ohana/src/mosastro/src/rtext.c
r3416 r4844 24 24 Nbytes = BYTES_STAR * mychip[0].Nstars; 25 25 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); 27 27 if (nbytes != Nbytes) { exit (1); } 28 28 mychip[0].Nbuffer = Nbytes; -
trunk/Ohana/src/opihi/dvo/aregion.c
r3462 r4844 48 48 49 49 done = FALSE; 50 Fread (buffer, 1, 48*NDecLines[NBigDec], f, "char");50 fread (buffer, 1, 48*NDecLines[NBigDec], f); 51 51 for (i = 0; !done && (i < NDecLines[NBigDec]); i++) { 52 52 strncpy (temp, &buffer[i*48], 48); -
trunk/Ohana/src/opihi/dvo/cmatch.c
r4800 r4844 1 1 # include "dvo1.h" 2 # define BYTES_STAR 233 # define BLOCK 10004 # define DNSTARS 10005 2 6 3 int cmatch (int argc, char **argv) { … … 15 12 Vector *rvec, *dvec, *mvec, *drvec, *ddvec, *dmvec; 16 13 14 VarConfig ("GSCDIR", "%s", gscdir); 17 15 VarConfig ("CATDIR", "%s", catdir); 18 VarConfig ("GSCDIR", "%s", gscdir); 16 if (VarConfig ("CATMODE", "%s", catalog.catmode) == NULL) 17 strcpy (catalog.catmode, "RAW"); 19 18 20 19 if (argc != 9) { 21 20 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"); 22 22 return (FALSE); 23 23 } 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); 24 28 25 29 radius = atof (argv[2]); … … 34 38 /* load data from the photometry database file */ 35 39 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: 38 45 return (FALSE); 39 46 } 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); 43 49 return (FALSE); 44 50 } 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); 65 52 fprintf (stderr, "read %d stars from phot catalog file %s\n", catalog1.Naverage, filename); 66 53 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 77 54 nstar = 0; 78 55 NSTARS = DNSTARS;
Note:
See TracChangeset
for help on using the changeset viewer.
