Changeset 41562
- Timestamp:
- Apr 29, 2021, 2:17:05 PM (5 years ago)
- Location:
- trunk/Ohana/src/relphot/src
- Files:
-
- 2 edited
-
TGroupOps.c (modified) (5 diffs)
-
args.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relphot/src/TGroupOps.c
r41561 r41562 6 6 // tgroupTimes carries the times of the tgroups (initially, just the photometric nights) 7 7 static int NtgroupTimes = 0; 8 static int NTGROUPTIMES = 0; 8 9 static TGTimes **tgroupTimes = NULL; 9 10 … … 59 60 // given photcode, it is left empty (no images) 60 61 61 ALLOCATE (tgroupTimes, TGTimes *, NtgroupTimes); 62 NTGROUPTIMES = NtgroupTimes; // if we have loaded a list of times, use that as the starting alloc number 63 ALLOCATE (tgroupTimes, TGTimes *, NTGROUPTIMES); 62 64 63 65 // the start of an MJD day is 14:00 HST, so the end time can be the start time + 23h 59m 59s (86399s) … … 118 120 119 121 if (!TGROUP_ZEROPT) return; 120 myAssert (tgroupTimes, "oops, tgroupTimes not allocated");121 122 122 123 // index of the new entry 123 124 int Ntgt = NtgroupTimes; 124 125 125 NtgroupTimes ++; 126 REALLOCATE (tgroupTimes, TGTimes *, NtgroupTimes); 126 127 if (NtgroupTimes >= NTGROUPTIMES) { 128 NTGROUPTIMES += 100; 129 REALLOCATE (tgroupTimes, TGTimes *, NTGROUPTIMES); 130 } 127 131 128 132 double mjd = ohana_sec_to_mjd (tzero); … … 187 191 * internal construct that defines a group of related images 188 192 */ 193 194 if (!tgroupTimes) { 195 NTGROUPTIMES = 100; 196 ALLOCATE (tgroupTimes, TGTimes *, NTGROUPTIMES); 197 } 189 198 190 199 ALLOCATE (ImageToTGroup, TGroup *, Nsubset); // tgroup to which image belongs … … 362 371 // assume a 1day range for now 363 372 TGroup *findTGroup (unsigned int start, int photcode) { 373 374 if (!NtgroupTimes) return NULL; // if none are yet defined, do not even try 364 375 365 376 // find index of matching photcode from our list of active secondary photcodes -
trunk/Ohana/src/relphot/src/args.c
r41555 r41562 359 359 TGROUP_ZEROPT = TRUE; 360 360 remove_argument (N, &argc, argv); 361 TGROUP_FILENAME = strcreate(argv[N]);362 remove_argument (N, &argc, argv);363 361 // if we fit for TGROUPS, start with the images and mosaics frozen 364 362 TGROUP_ZPT_MODE = TGROUP_ZPT_MODE_ALL; 365 363 IMAGE_ZPT_MODE = IMAGE_ZPT_MODE_NONE; 366 364 MOSAIC_ZPT_MODE = MOSAIC_ZPT_MODE_NONE; 365 } 366 if ((N = get_argument (argc, argv, "-tgroup-list"))) { 367 if (!TGROUP_ZEROPT) { 368 fprintf (stderr, "-tgroup-list (filename) requires -tgroup option\n"); 369 exit (2); 370 } 371 remove_argument (N, &argc, argv); 372 TGROUP_FILENAME = strcreate(argv[N]); 373 remove_argument (N, &argc, argv); 367 374 } 368 375 if ((N = get_argument (argc, argv, "-tgroup")) || (N = get_argument (argc, argv, "-tgroups"))) { … … 567 574 if (argc != 1) relphot_usage (); 568 575 569 if (TGROUP_ZEROPT) { 576 // if we supplied a file, we need to load it now 577 if (TGROUP_FILENAME) { 570 578 loadTGroups (TGROUP_FILENAME); 571 579 free (TGROUP_FILENAME);
Note:
See TracChangeset
for help on using the changeset viewer.
