Skip to content

Commit 927c927

Browse files
authoredJun 13, 2024··
Merge pull request #123 from cpinte/pola_casa
Adding pola with -casa option
2 parents e0cd616 + 0f939a2 commit 927c927

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed
 

‎src/output.f90

+25-8
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ subroutine ecriture_map_ray_tracing()
801801

802802
integer :: status,unit,blocksize,bitpix,naxis
803803
integer, dimension(5) :: naxes
804-
integer :: i,j,group,fpixel,nelements, alloc_status, xcenter, lambda, itype, ibin, iaz
804+
integer :: i,j,group,fpixel,nelements, alloc_status, xcenter, lambda, itype, ntypes, ibin, iaz
805805

806806
character(len = 512) :: filename
807807
logical :: simple, extend
@@ -815,7 +815,11 @@ subroutine ecriture_map_ray_tracing()
815815
real, dimension(:,:,:,:), allocatable :: image_casa
816816

817817
if (lcasa) then
818-
allocate(image_casa(npix_x, npix_y, 1, 1), stat=alloc_status) ! 3eme axe : pola, 4eme axe : frequence
818+
if (lsepar_pola) then
819+
allocate(image_casa(npix_x, npix_y, 4, 1), stat=alloc_status) ! 3eme axe : pola, 4eme axe : frequence
820+
else
821+
allocate(image_casa(npix_x, npix_y, 1, 1), stat=alloc_status) ! 3eme axe : pola, 4eme axe : frequence
822+
endif
819823
if (alloc_status > 0) call error('Allocation error RT image_casa')
820824
image_casa = 0.0 ;
821825
else
@@ -936,20 +940,33 @@ subroutine ecriture_map_ray_tracing()
936940
!----- Images
937941
! Boucles car ca ne passe pas avec sum directement (ifort sur mac)
938942
if (lcasa) then
939-
itype=1 ; ibin=1 ; iaz = 1
943+
if (lsepar_pola) then
944+
ntypes=4 ;
945+
else
946+
ntypes=1
947+
endif
948+
ibin=1 ; iaz = 1
940949

941950
W2m2_to_Jy = 1e26 * (tab_lambda(lambda)*1e-6)/c_light;
942951

943-
do j=1,npix_y
944-
do i=1,npix_x
945-
image_casa(i,j,1,1) = sum(Stokes_ray_tracing(lambda,i,j,ibin,iaz,itype,:)) * W2m2_to_Jy
946-
enddo !i
947-
enddo !j
952+
do itype=1,ntypes
953+
do j=1,npix_y
954+
do i=1,npix_x
955+
image_casa(i,j,itype,1) = sum(Stokes_ray_tracing(lambda,i,j,ibin,iaz,itype,:)) * W2m2_to_Jy
956+
enddo !i
957+
enddo !j
958+
enddo ! itype
948959

949960
if (l_sym_ima) then
950961
xcenter = npix_x/2 + modulo(npix_x,2)
951962
do i=xcenter+1,npix_x
952963
image_casa(i,:,1,1) = image_casa(npix_x-i+1,:,1,1)
964+
965+
if (lsepar_pola) then
966+
image_casa(i,:,2,1) = image_casa(npix_x-i+1,:,2,1)
967+
image_casa(i,:,3,1) = - image_casa(npix_x-i+1,:,3,1)
968+
image_casa(i,:,4,1) = image_casa(npix_x-i+1,:,4,1)
969+
endif
953970
enddo
954971
endif
955972

0 commit comments

Comments
 (0)
Please sign in to comment.