1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|
program polarisation
use trimod
integer :: n,o,r
real :: inf,sup, num
real, parameter :: pi=3.14159265
real, dimension (210000,2) :: lambda1,I1,Q1,lambda2,I2,U2
real, dimension (6,420000) :: pollin
real, dimension (420000,2) :: lambda, lambda1x, lambda2x, I,Q,U
character(99) :: inputfile1, inputfile2, outputfile
double precision :: c=299792.458,lambda0
type *,'longueur d'' onde du laboratoire: '
read (*,'(f8.3)') lambda0
!---------------------------------------------------------------------------------------------------------------------------------------
!Choix du domaine spectral:
type *,"Choisissez votre domaine spectral (en nm, a 10^-2 pres): "
read (*,'(f5.2)') inf
read (*,'(f5.2)') sup
!Fichiers texte : 6 colonnes
!
!*****************************************************************************************************************
!* Lambda(nm) * Stokes I * Stokes Q,U,V * N1 * N2 * erreur/bin *
!*****************************************************************************************************************
!
!
!lecture du premier fichier texte
!********************************
type *,'inputfile 1 :'
read (*,'(a30)') inputfile1
OPEN (UNIT =1,FILE =inputfile1,form='formatted',status="old",action='read')
n=1
o=1
do
read (1,'(f10.4)',end=100) lambda1(n,1)
if (lambda1(n,1)>inf) then
if (lambda1(n,1)<sup) then
read (1,'(f10.4,2e12.8)') lambda1(o,1),I1(o,1),Q1(o,1)
lambda1(o,2)=1
o=o+1
else
exit
endif
endif
n=n+1
enddo
100 continue
!--------------------------------------------
!lecture du second fichier texte
!*******************************
type *,'inputfile 2 :'
read (*,'(a30)') inputfile2
OPEN (UNIT =2,FILE =inputfile2,form='formatted',status="old",action='read')
!------------------------------------------
n=1
o=1
do
read (2,'(f10.4)',end=200) lambda2(n,1)
if (lambda2(n,1)>inf) then
if (lambda2(n,1)<sup) then
read (2,'(f10.4,2e12.8)') lambda2(o,1),I2(o,1),U2(o,1)
lambda2(o,2)=2
o=o+1
else
exit
endif
endif
n=n+1
enddo
200 continue
!------------------------------------------
!calcul polarisation lineaire pl=sqrt(Q**2+U**2) avec Q et U fraction de Ic
!tableau de sortie : pollin, 6 colonnes
!*************************************************************************
!********************************************************************************
!* Lambda (nm) * I * Q * U * polarisation lineaire * theta *
!********************************************************************************
print *,'***************************'
print *,shape(lambda1), shape(lambda2)
print *,'***************************'
lambda(:,1) =(/lambda1(:,1), lambda2(:,1)/)
lambda(:,2) =(/lambda1(:,2), lambda2(:,2)/)
print *,'***************************'
print *,shape(lambda)
print *,'***************************'
lambda1x(:,1)=(/lambda1(:,1), lambda1(:,1)/)
lambda1x(:,2)=1.
lambda2x(:,1)=(/lambda2(:,1), lambda2(:,1)/)
!lambda2x(:,2)=2.
! call tri( size(lambda),lambda )
! call tri( size(lambda1x),lambda1x )
! call tri( size(lambda2x),lambda2x )
end program polarisation |
Partager