You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the coordinates API needs to support the data or obs times can be arrays but currently this doesn't work for the implemented transform from STIXImaging to HPC
The current code is focused on imaging need to adapt for coordinate transform which should be reversible - not sure the mean approach works here should only interpolate but do in vectorised manner. Related to #52.
hpc=ff.flare_location.transform_to(frame='helioprojective')
---------------------------------------------------------------------------TypeErrorTraceback (mostrecentcalllast)
File~/.virtualenvs/stixpy/lib/python3.11/site-packages/astropy/time/core.py:707, inTimeBase.__hash__(self)
705loc=loc.x.to_value(u.m), loc.y.to_value(u.m), loc.z.to_value(u.m)
-->707returnhash((self.jd1, self.jd2, self.scale, loc))
709exceptTypeError:
TypeError: unhashabletype: 'numpy.ndarray'Duringhandlingoftheaboveexception, anotherexceptionoccurred:
TypeErrorTraceback (mostrecentcalllast)
CellIn[36], line1---->1hpc=ff.flare_location.transform_to(frame='helioprojective')
File~/.virtualenvs/stixpy/lib/python3.11/site-packages/astropy/coordinates/sky_coordinate.py:692, inSkyCoord.transform_to(self, frame, merge_attributes)
688generic_frame=GenericFrame(frame_kwargs)
690# Do the transformation, returning a coordinate frame of the desired691# final type (not generic).-->692new_coord=trans(self.frame, generic_frame)
694# Finally make the new SkyCoord object from the `new_coord` and695# remaining frame_kwargs that are not frame_attributes in `new_coord`.696forattrinset(new_coord.frame_attributes) &set(frame_kwargs.keys()):
File~/.virtualenvs/stixpy/lib/python3.11/site-packages/astropy/coordinates/transformations.py:1574, inCompositeTransform.__call__(self, fromcoord, toframe)
1571frattrs[inter_frame_attr_nm] =attr1573curr_toframe=t.tosys(**frattrs)
->1574curr_coord=t(curr_coord, curr_toframe)
1576# this is safe even in the case where self.transforms is empty, because1577# coordinate objects are immutable, so copying is not needed1578returncurr_coordFile~/.virtualenvs/stixpy/lib/python3.11/site-packages/astropy/coordinates/transformations.py:949, inFunctionTransform.__call__(self, fromcoord, toframe)
948def__call__(self, fromcoord, toframe):
-->949res=self.func(fromcoord, toframe)
950ifnotisinstance(res, self.tosys):
951raiseTypeError(
952f"the transformation function yielded {res} but "953f"should have been of type {self.tosys}"954 )
File~/Projects/stixpy/stixpy/coordinates/transforms.py:218, instixim_to_hpc(stxcoord, hpcframe)
213r""" 214 Transform STIX Imaging coordinates to given HPC frame 215 """216logger.debug("STIX: %s", stxcoord)
-->218rot_matrix, solo_pos_heeq=_get_rotation_matrix_and_position(stxcoord.obstime)
219solo_heeq=HeliographicStonyhurst(solo_pos_heeq, representation_type="cartesian", obstime=stxcoord.obstime)
221# Transform from STIX imaging to SOLO HPCFile~/Projects/stixpy/stixpy/coordinates/transforms.py:40, in_get_rotation_matrix_and_position(obstime)
29def_get_rotation_matrix_and_position(obstime):
30r""" 31 Return rotation matrix STIX Imaging to SOLO HPC and position of SOLO in HEEQ. 32 (...) 38 ------- 39 """--->40roll, solo_position_heeq, spacecraft_pointing=get_hpc_info(obstime)
42# Generate the rotation matrix using the x-convention (see Goldstein)43# Rotate +90 clockwise around the first axis44# STIX is mounted on the -Y panel (SOLO_SRF) need to rotate to from STIX frame to SOLO_SRF45rot_to_solo=np.array([[1, 0, 0], [0, 0, -1], [0, 1, 0]])
File~/Projects/stixpy/stixpy/coordinates/transforms.py:73, inget_hpc_info(start_time, end_time)
58defget_hpc_info(start_time, end_time=None):
59r""" 60 Get STIX pointing and SO location from L2 aspect files. 61 (...) 71 72 """--->73aux=_get_aux_data(start_time, end_time=end_time)
74ifend_timeisNone:
75end_time=start_timeFile~/.virtualenvs/stixpy/lib/python3.11/site-packages/astropy/time/core.py:717, inTimeBase.__hash__(self)
714else:
715raise-->717raiseTypeError(f"unhashable type: '{self.__class__.__name__}' {reason}")
TypeError: unhashabletype: 'Time' (mustbescalar)
The text was updated successfully, but these errors were encountered:
For the coordinates API needs to support the data or obs times can be arrays but currently this doesn't work for the implemented transform from STIXImaging to HPC
The current code is focused on imaging need to adapt for coordinate transform which should be reversible - not sure the mean approach works here should only interpolate but do in vectorised manner. Related to #52.
Works
Doesn't
The text was updated successfully, but these errors were encountered: