13.11.2014 Views

Abrir - RDU

Abrir - RDU

Abrir - RDU

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Apéndices 301<br />

found=0<br />

do i=1,np1<br />

if (lam13(i).gt.desde) then<br />

found=1<br />

exit<br />

endif<br />

enddo<br />

if (found.eq.0) then<br />

write(*,*) ”desder13 not found”<br />

write(52,*) ”desder13 not found”<br />

stop<br />

endif<br />

nd13=i-1<br />

!busca el ultimo pto. q es posterior al hasta, ”hastar13”<br />

found=0<br />

do j=nd13,np1<br />

if (lam13(j).gt.hasta) then<br />

found=1<br />

exit<br />

endif<br />

enddo<br />

if (found.eq.0) then<br />

write(*,*) ”hastar13 not found”<br />

write(52,*) ”hastar13 not found”<br />

stop<br />

endif<br />

nh13=j<br />

!spec2 sera el resampleado del spec1, va desde 2500-10500<br />

en lambda<br />

!igual q el R13, p comparar<br />

!ahora resamplea usando los lambda1,2 mas proximos al<br />

punto<br />

do j=nd13+1,nh13-1<br />

x=lam13(j)<br />

x1=0.<br />

x2=0.<br />

do i=1,2e5<br />

if (spec1(i,1).gt.x) then<br />

nx2=i<br />

x2=spec1(i,1)<br />

exit<br />

endif<br />

enddo<br />

210 continue<br />

if (spec1(i,1).lt.x) then<br />

nx1=i<br />

x1=spec1(i,1)<br />

else<br />

i=i-1<br />

goto 210<br />

endif<br />

if (x1.lt.1.) then<br />

write(*,*) ”problems searching x1 for lamda x=”,x<br />

write(52,*) ”problems searching x1 for lamda x=”,x<br />

stop<br />

endif<br />

if (x2.lt.1.) then<br />

write(*,*) ”problems searching x2 for lamda x=”,x<br />

write(52,*) ”problems searching x2 for lamda x=”,x<br />

stop<br />

endif<br />

!write(*,*) x1,x,x2<br />

!tenemos x1,x2, ahora calcula las alturas respectivas y1,y2<br />

y1=spec1(nx1,2)<br />

y2=spec1(nx2,2)<br />

call interp1d(x2,x1,y2,y1,x,px)<br />

spec4(j)=px<br />

enddo<br />

spec4(nd13)=1<br />

spec4(nh13)=1!los extremos del intervalo<br />

!spec4 con el mismo sampleo y mismo rango 2500-10500<br />

!que el archivo R13<br />

end<br />

!********************************************************<br />

subroutine velrad(desde,hasta,spec1,vrestim,spec5)<br />

!esta sub intenta determinar la vrad de una estrella<br />

!usando el minimo chicuad<br />

!entrada=desde,hasta,spec1 (todos SIN corregir x vrad)<br />

!salida=vrestim (spec5 es temporal, no es de salida)<br />

common /comunes/<br />

spec2,lam13,vrot,points,ndesder13,nhastar13,<br />

np1,wspec,file<br />

real*8 spec2(2e5),lam13(2e5),vrot,vrad<br />

integer points<br />

integer ndesder13,nhastar13,np1,wspec<br />

character file*80<br />

save /comunes/<br />

real*8 spec1(2e5,2),spec5(2e5,2),spec6(2e5)<br />

!1 es el observado, 5 es correg. x vrad,6 es resampleado<br />

real*8 sp1(2e5),sp2(2e5),sp3(2e5)!3 espectros para 3 temps.<br />

!diferentes: 5000, 7500, 10000<br />

real*8 vradi,frad,desde,hasta<br />

real*8 desde1,hasta1<br />

integer nd,nh,nd1,nh1<br />

real*8 chi1,chi2,chi3,minchi1,minchi2,minchi3<br />

real*8 minvr1,minvr2,minvr3<br />

real*8 vrestim<br />

open(54,file=”sp1.dat”,status=. o ld”)!lee los 3 espectros<br />

open(55,file=”sp2.dat”,status=. o ld”)<br />

open(56,file=”sp3.dat”,status=. o ld”)<br />

i=1<br />

do<br />

read(54,*,end=221) sp1(i)<br />

read(55,*,end=221) sp2(i)<br />

read(56,*,end=221) sp3(i)<br />

i=i+1<br />

enddo<br />

221close(54)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!