From bacb9561b592346298b00065e4247250a3bce681 Mon Sep 17 00:00:00 2001 From: emmanuelgarcia9 Date: Mon, 14 Jun 2021 17:47:05 -0400 Subject: [PATCH] Fixed bug giving incorrect spectral line velocities when there is more than one molecule --- src/raytrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raytrace.c b/src/raytrace.c index 2df0af9..f04b147 100644 --- a/src/raytrace.c +++ b/src/raytrace.c @@ -284,7 +284,7 @@ if(!if(par->useVelFuncInRaytrace)): vel /* Calculate the red shift of the transition wrt to the frequency specified for the image. */ if(img[im].trans > -1){ - lineRedShift=(md[molI].freq[img[im].trans]-md[molI].freq[lineI])/md[molI].freq[img[im].trans]*CLIGHT; + lineRedShift=(md[img[im].molI].freq[img[im].trans]-md[molI].freq[lineI])/md[img[im].molI].freq[img[im].trans]*CLIGHT; } else { lineRedShift=(img[im].freq-md[molI].freq[lineI])/img[im].freq*CLIGHT; } @@ -886,7 +886,7 @@ At the moment I will fix the number of segments, but it might possibly be faster /* Calculate the red shift of the transition wrt to the frequency specified for the image. */ if(img[im].trans > -1){ - lineRedShift=(md[molI].freq[img[im].trans]-md[molI].freq[lineI])/md[molI].freq[img[im].trans]*CLIGHT; + lineRedShift=(md[img[im].molI].freq[img[im].trans]-md[molI].freq[lineI])/md[img[im].molI].freq[img[im].trans]*CLIGHT; } else { lineRedShift=(img[im].freq-md[molI].freq[lineI])/img[im].freq*CLIGHT; }