Changeset 39396
- Timestamp:
- Feb 26, 2016, 6:21:57 AM (10 years ago)
- Location:
- trunk/Ohana/src/relastro
- Files:
-
- 8 edited
-
include/relastro.h (modified) (3 diffs)
-
src/BrightCatalog.c (modified) (2 diffs)
-
src/ConfigInit.c (modified) (4 diffs)
-
src/SetSignals.c (modified) (1 diff)
-
src/args.c (modified) (1 diff)
-
src/load_catalogs.c (modified) (1 diff)
-
src/plotstuff.c (modified) (1 diff)
-
src/relastro_client.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relastro/include/relastro.h
r39390 r39396 415 415 void SetProtect (int mode); 416 416 int SetSignals (void); 417 418 void relastro_client_free (); 417 419 418 420 GSCRegion *find_regions PROTO((Image *image, off_t Nimage, int *Nregions, GSCRegion *fullregion)); … … 610 612 int BrightCatalogSplit (CatalogSplitter *catalogs, BrightCatalog *bcatalog); 611 613 int BrightCatalogSplitFree (CatalogSplitter *catalogs); 614 void BrightCatalogFree (BrightCatalog *bcatalog); 612 615 613 616 PhotCode **ParsePhotcodeList (char *rawlist, int *nphotcodes, int needAve); … … 774 777 double weight_cauchy (double x); 775 778 double dpsi_cauchy (double x); 779 void my_memdump (char *message); -
trunk/Ohana/src/relastro/src/BrightCatalog.c
r39383 r39396 357 357 358 358 ohana_memcheck (1); 359 360 my_memdump("start of define_bintable"); 359 361 gfits_define_bintable_column (&theader, "D", "RA", "ra", "degrees", 1.0, 0.0); 362 my_memdump("after define_bintable RA"); 363 360 364 gfits_define_bintable_column (&theader, "D", "DEC", "dec", "degrees", 1.0, 0.0); 365 my_memdump("after define_bintable DEC"); 366 361 367 gfits_define_bintable_column (&theader, "E", "MAG_SYS", "magnitude (sys)", NULL, 1.0, 0.0); 362 368 gfits_define_bintable_column (&theader, "E", "MAG_CAL", "magnitude (cal)", NULL, 1.0, 0.0); … … 771 777 } 772 778 779 void BrightCatalogFree (BrightCatalog *bcatalog) { 780 if (!bcatalog) return; 781 FREE (bcatalog[0].average); 782 FREE (bcatalog[0].measure); 783 FREE (bcatalog[0].secfilt); 784 FREE (bcatalog); 785 return; 786 } 787 773 788 // distribute a bright catalog across separate catalogs 774 789 CatalogSplitter *BrightCatalogSplitInit (int Nsecfilt) { -
trunk/Ohana/src/relastro/src/ConfigInit.c
r39375 r39396 4 4 5 5 char *config, *file; 6 char CatdirPhotcodeFile[ 256];6 char CatdirPhotcodeFile[DVO_MAX_PATH]; 7 7 struct stat filestat; 8 8 int status; … … 61 61 ScanConfig(config, "WHERE_B", "%s", 0, WHERE_B); 62 62 63 s printf (ImageCat, "%s/Images.dat", CATDIR);63 snprintf (ImageCat, DVO_MAX_PATH, "%s/Images.dat", CATDIR); 64 64 65 65 if (!ScanConfig (config, "SKY_DEPTH", "%d", 0, &SKY_DEPTH)) SKY_DEPTH = 2; … … 77 77 78 78 /* update master photcode table if not defined */ 79 s printf (CatdirPhotcodeFile, "%s/Photcodes.dat", CATDIR);79 snprintf (CatdirPhotcodeFile, DVO_MAX_PATH, "%s/Photcodes.dat", CATDIR); 80 80 if (!LoadPhotcodes (CatdirPhotcodeFile, NULL, FALSE)) { 81 81 fprintf (stderr, "error loading photcode table %s\n", CatdirPhotcodeFile); … … 91 91 } 92 92 93 FreeConfigFile(); 93 94 free (config); 94 95 free (file); -
trunk/Ohana/src/relastro/src/SetSignals.c
r13322 r39396 52 52 return (TRUE); 53 53 } 54 55 void my_memdump (char *message) { 56 57 fprintf (stderr, "%s\n", message); 58 pid_t myPid = getpid(); 59 char line[256]; 60 snprintf (line, 256, "cat /proc/%d/maps", myPid); 61 system (line); 62 fprintf (stderr, "-------------------- end ---------------------\n"); 63 return; 64 } 65 54 66 /* 55 67 -
trunk/Ohana/src/relastro/src/args.c
r39390 r39396 920 920 if (argc != 1) usage_client (); 921 921 return TRUE; 922 } 923 924 void relastro_client_free () { 925 FREE (PHOTCODE_SKIP_LIST); 926 FREE (PHOTCODE_KEEP_LIST); 927 FREE (PHOTCODE_RESET_LIST); 928 FREE (DCR_RED_COLOR_POS); 929 FREE (DCR_RED_COLOR_NEG); 930 FREE (DCR_BLUE_COLOR_POS); 931 FREE (DCR_BLUE_COLOR_NEG); 932 933 FREE(PHOTCODE_A_LIST); 934 FREE(PHOTCODE_B_LIST); 935 FREE(HIGH_SPEED_DIR); 936 FREE(BCATALOG); 937 FREE (HOSTDIR); 922 938 } 923 939 -
trunk/Ohana/src/relastro/src/load_catalogs.c
r39225 r39396 92 92 } 93 93 Ncat ++; 94 95 char message[1024]; 96 snprintf (message, 1024, "loaded catalog: %d", Ncat); 97 my_memdump(message); 94 98 } 95 99 -
trunk/Ohana/src/relastro/src/plotstuff.c
r30616 r39396 25 25 char name[100]; 26 26 27 s printf (name, "gastro [%d]", N);27 snprintf (name, 100, "gastro [%d]", N); 28 28 Xgraph[N] = KapaOpen ("kapa", name); 29 29 -
trunk/Ohana/src/relastro/src/relastro_client.c
r39379 r39396 1 1 # include "relastro.h" 2 // # include <sys/types.h> 3 // # include <unistd.h> 2 4 3 5 // relastro_client is run on a remote host and is responsible for updating the catalogs … … 21 23 int main (int argc, char **argv) { 22 24 25 my_memdump("start of program"); 26 23 27 // get configuration info, args, lockfile (set CATDIR, HOST_ID, HOSTDIR, etc) 24 28 SetSignals (); … … 28 32 SkyTableSetFilenames (sky, CATDIR, "cpt"); 29 33 SkyList *skylist = SkyListByPatch (sky, -1, &UserPatch); 34 35 my_memdump("done config"); 30 36 31 37 switch (RELASTRO_OP) { … … 39 45 exit (2); 40 46 } 47 my_memdump("loaded catalogs"); 48 41 49 BrightCatalog *bcatalog = BrightCatalogMerge (catalog, Ncatalog); 50 my_memdump("merged bcatalog"); 51 42 52 if (!BrightCatalogSave (BCATALOG, bcatalog)) { 43 53 fprintf (stderr, "ERROR saving bright catalog from %s\n", CATDIR); 44 54 exit (2); 45 55 } 56 57 SkyTableFree (sky); 58 SkyListFree(skylist); 59 FreePhotcodeTable(); 60 61 int i; 62 for (i = 0; i < Ncatalog; i++) { 63 dvo_catalog_free (&catalog[i]); 64 } 65 FREE (catalog); 66 BrightCatalogFree(bcatalog); 67 68 relastro_client_free (); 69 FREE(photcodesKeep); 70 FREE(photcodesSkip); 71 FREE(photcodesReset); 72 FREE(photcodesGroupA); 73 FREE(photcodesGroupB); 74 75 ohana_memcheck (TRUE); 76 ohana_memdump (TRUE); 46 77 break; 47 78 }
Note:
See TracChangeset
for help on using the changeset viewer.
