Changeset 41835
- Timestamp:
- Oct 11, 2021, 11:38:34 AM (5 years ago)
- Location:
- branches/eam_branches/ipp-dev-20210817/Ohana/src/uniphot/src
- Files:
-
- 3 edited
-
load_images_fixhsc.c (modified) (1 diff)
-
load_rules_fixhsc.c (modified) (2 diffs)
-
update_catalog_fixhsc.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-dev-20210817/Ohana/src/uniphot/src/load_images_fixhsc.c
r41802 r41835 38 38 // the rule is the new base photcode 39 39 // this is robust against multiple passes 40 short chipcode = 1000 * (int)(photcode / 1000);40 short chipcode = photcode % 200; 41 41 42 42 short newcode = newbase + chipcode; -
branches/eam_branches/ipp-dev-20210817/Ohana/src/uniphot/src/load_rules_fixhsc.c
r41802 r41835 2 2 3 3 static int Nrule = 0; 4 static double *startRule = NULL;5 static double *stopRule = NULL;4 static e_time *startRule = NULL; 5 static e_time *stopRule = NULL; 6 6 static int *photbaseRule = NULL; 7 7 … … 16 16 int NRULE = 10000; 17 17 18 ALLOCATE _PTR (startRule, double, NRULE);19 ALLOCATE _PTR (stopRule, double, NRULE);20 ALLOCATE _PTR(photbaseRule, int, NRULE);18 ALLOCATE (startRule, e_time, NRULE); 19 ALLOCATE (stopRule, e_time, NRULE); 20 ALLOCATE (photbaseRule, int, NRULE); 21 21 22 while (fscanf (f, "%lf %lf %d", &startRule[Nrule], &stopRule[Nrule], &photbaseRule[Nrule]) != EOF) { 22 double startMJD, stopMJD; 23 24 // rules are in MJD, convert to e_time values 25 while (fscanf (f, "%lf %lf %d", &startMJD, &stopMJD, &photbaseRule[Nrule]) != EOF) { 26 27 startRule[Nrule] = ohana_mjd_to_sec (startMJD); 28 stopRule[Nrule] = ohana_mjd_to_sec (stopMJD); 23 29 Nrule ++; 24 30 25 31 if (Nrule >= NRULE) { 26 32 NRULE += 10000; 27 REALLOCATE (startRule, double, NRULE);28 REALLOCATE (stopRule, double, NRULE);33 REALLOCATE (startRule, e_time, NRULE); 34 REALLOCATE (stopRule, e_time, NRULE); 29 35 REALLOCATE (photbaseRule, int, NRULE); 30 36 } -
branches/eam_branches/ipp-dev-20210817/Ohana/src/uniphot/src/update_catalog_fixhsc.c
r41802 r41835 11 11 if (!newbase) continue; 12 12 13 short photcode = catalog[0].measure[i].photcode;13 unsigned short photcode = catalog[0].measure[i].photcode; 14 14 15 15 // the rule is the new base photcode 16 16 // this is robust against multiple passes 17 short chipcode = 1000 * (int)(photcode / 1000);17 short chipcode = photcode % 200; 18 18 19 19 short newcode = newbase + chipcode;
Note:
See TracChangeset
for help on using the changeset viewer.
