Open jameswilburlewis opened 1 week ago
The problem seems to be in the attitude files themselves: erg_att_interpolate() gets RA and Dec variables from the attitude CDF for the axes SGI-Z, SGA-X, and SGA-Z. The differences between the SGI and SGA axes should be very small. SGA-Y is obtained by SGA-Z cross SGA-X. SGI-X comes from SGI-Z cross SGA-X. SGA-Y comes from SGA-Z cross SCA-X.
There is a period of several minutes on the test date, 2017-03-27, where SGI-Z and SGA-X are identical or nearly so, where for the rest of the day they are nearly orthogonal, as expected. The cross product of the parallel vectors gives 0-vectors as the SGI-X output, then when they're normalized to unit vectors, NaNs are generated and propagate through the cotrans calculation.
This doesn't seem recoverable without fixing the attitude files. Let's see what the ERG team says about it.
It looks like something can go wrong converting from ERG dsi coordinates to sga coordinates (dsi->sgi is OK, but there seems to be an issue with sgi->sga). The input data has been cleaned of NaNs, but the output has NaNs, and values are mismatched if you try to do a round-trip comparison. See this excerpt from ERG cotrans_test.py:
Maybe there are NaNs in the attitude data used for the coordinate transform?