Hello,
I'm having problems merging two resonances using the C Api. Both
resonances are linked to the same atom. I have tried looking at the
mergeResonances (...) function in the Python Api, but the problem is
that I don't think mergeObjects (...) is available in the C Api (or is
it?). Currently I'm trying to manually set the peakDimContribs and
shifts to the correct resonance, but it's not working (it gets invalid).
My current code is:
peakDimContribs=Nmr_Resonance_GetPeakDimContribs(matchingResonance);
if(peakDimContribs)
{
for(j=0;j<ApiCollection_Len(peakDimContribs);j++)
{
peakDimContrib=ApiCollection_Get(peakDimContribs,j);
Nmr_PeakDimContrib_SetResonance(peakDimContrib,resonance);
}
}
shifts=Nmr_Resonance_GetShifts(matchingResonance);
if(shifts)
{
for(j=0;j<ApiCollection_Len(shifts);j++)
{
shift=ApiCollection_Get(shifts,j);
Nmr_Shift_SetResonance(shift,resonance);
}
}
where resonance and matchingResonance are the two resonances I'm trying
to merge. I guess my current way of thinking is a bit flawed, but I
can't see why it isn't working. Do you have any suggestions?
Another problem I have is that there doesn't seem to be an
Nmr_Resonance_Delete (...) function in the C Api. How do I delete a
resonance?
Thanks for any hints and advice.
/Magnus
|