Changeset 39926 for trunk/psastro/src/psastroModelAdjust.c
- Timestamp:
- Jan 6, 2017, 11:30:10 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psastro/src/psastroModelAdjust.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to
/branches/czw_branch/20160809 merged eligible
-
Property svn:mergeinfo
set to
-
trunk/psastro/src/psastroModelAdjust.c
r21409 r39926 28 28 } 29 29 30 31 30 32 // if we have not measured the boresite position, no adjustment is needed 31 33 bool fitBoresite = psMetadataLookupBool (&status, recipe, "PSASTRO.MODEL.FIT.BORESITE"); … … 52 54 return false; 53 55 } 54 56 float refChipAngleNominal = PS_RAD_DEG*psMetadataLookupF32 (&status, recipe, "PSASTRO.MODEL.REF.CHIP.ANGLE"); 57 if (!refChipName) { 58 psError(PS_ERR_IO, true, "reference chip is missing from recipe"); 59 return false; 60 } 61 62 int rotatorParity = psMetadataLookupS32(&status, recipe, "PSASTRO.MODEL.ROT.PARITY"); 63 if (!status) psAbort ("Can't find recipe option PSASTRO.MODEL.ROT.PARITY"); 64 psMetadataAddS32 (output->fpa->concepts, PS_LIST_TAIL, "FPA.ROT_PARITY", PS_META_REPLACE, "rotator parity parameter", rotatorParity); 65 55 66 // get reference chip from name 56 67 pmChip *refChip = pmConceptsChipFromName (output->fpa, refChipName); … … 81 92 psFree (PT); 82 93 } 83 94 84 95 // rotate the chip-to-FPA transforms to have 0.0 posangle for refChip; 85 96 // compensate by rotating fpa to TPA transform 86 97 87 98 // get the current posangle of the ref chip 88 float chipAngle = atan2 (refChip->toFPA->y->coeff[1][0], refChip->toFPA->x->coeff[1][0]); 89 fprintf (stderr, "chipAngle: %f\n", chipAngle*PS_DEG_RAD); 99 // this should have a negative sign : chipAngle = -atan2 (dM/dy, dM/dx) 100 float chipAngle = -atan2 (refChip->toFPA->y->coeff[1][0], refChip->toFPA->x->coeff[1][0]); 101 102 // chipAngle should be refChipAngleNominal @ POSANGLE = 0.0 103 float posAngleOffset = rotatorParity * (chipAngle - refChipAngleNominal); 104 105 fprintf (stderr, "chipAngle is: %f, at PA = 0.0, it should be %f, rotating model by %f (parity %d)\n", 106 chipAngle*PS_DEG_RAD, refChipAngleNominal*PS_DEG_RAD, posAngleOffset*PS_DEG_RAD, rotatorParity); 107 90 108 // psMetadataAddF32 (output->fpa->concepts, PS_LIST_TAIL, "FPA.POSANGLE", PS_META_REPLACE, "boresite parameter", posangle); 91 109 … … 99 117 psRegion *region = pmChipPixels (chip); 100 118 101 psPlaneTransform *toFPA = psPlaneTransformRotate (NULL, chip->toFPA, chipAngle); 119 // this should ALSO have a negative sign: this rotates by +posAngleOffset 120 psPlaneTransform *toFPA = psPlaneTransformRotate (NULL, chip->toFPA, posAngleOffset); 102 121 psFree (chip->toFPA); 103 122 chip->toFPA = toFPA; 104 123 105 124 // invert the new fromFPA transform to get the new toFPA transform 125 // NOTE: when we call psPlaneTransformInvert here, we do not increase the order as in other places 106 126 psPlaneTransform *fromFPA = psPlaneTransformInvert(NULL, chip->toFPA, *region, 50); 107 127 psFree (chip->fromFPA); … … 125 145 126 146 psFree (output->fpa->fromTPA); 147 // NOTE: when we call psPlaneTransformInvert here, we do not increase the order as in other places 127 148 output->fpa->fromTPA = psPlaneTransformInvert(NULL, output->fpa->toTPA, *fpaRegion, 50); 128 149 … … 131 152 132 153 psMetadata *header = output->fpa->hdu->header; 154 133 155 pmAstromWriteBilevelMosaic (header, output->fpa, NONLIN_TOL); 134 156 … … 172 194 // invert the new fromFPA transform to get the new toFPA transform 173 195 // the region used here is the region covered by the chip in the FPA 196 // NOTE: when we call psPlaneTransformInvert here, we do not increase the order as in other places 174 197 psPlaneTransform *fromFPA = psPlaneTransformInvert(NULL, chip->toFPA, *region, 50); 175 198 psFree (chip->fromFPA);
Note:
See TracChangeset
for help on using the changeset viewer.
