If ObsPy finds that Traces with the same ID have different data types, it will raise an exception:
Can't merge traces with same ids but differing data types!
This PR implements a "safe merge" where we try to merge as usual and then if that fails, we change all data types that aren't int32 to int32.
Note that a similar procedure could be done to avoid inconsistent sampling rate issues, such as those encountered in https://github.com/uafgeotools/rtm/issues/58#issuecomment-948053840. This could be accomplished via rounding, as in @awech's code here (from which this fix is based). That should be a separate PR though I think.
If ObsPy finds that Traces with the same ID have different data types, it will raise an exception:
This PR implements a "safe merge" where we try to merge as usual and then if that fails, we change all data types that aren't
int32
toint32
.Note that a similar procedure could be done to avoid inconsistent sampling rate issues, such as those encountered in https://github.com/uafgeotools/rtm/issues/58#issuecomment-948053840. This could be accomplished via rounding, as in @awech's code here (from which this fix is based). That should be a separate PR though I think.