program draw_fov c draws FoVs of INTEGRAL's detectors c s.ball December, 2006 c The FCFOV of the different instruments are c (all FOV are aligned with the fixed solar panels) c c IBIS: square of 9x9 degree c OMC: square of 5x5 degree (this is in fact a real FOV) c JEMX: circle of radius 2.4 degree c SPI: Hexagon 16 degree on a side c c The 0CFOV: c IBIS: square of 27x27 degree c JEMX: circle of 5 degree c SPI: Hexagon of 30 degree on a side implicit double precision (a-h,o-z) open (unit=1,file='fov.cmod',form='formatted') call write_header c ibis call draw_square (9.0d0, 0, 'IBIS FCFoV') c omc call draw_square (5.0d0, 1, 'OMC FoV') c jemx call draw_circle (2.4d0, 2, 'JEMX FCFoV') c spi call draw_hex (16.0d0, 3, 'SPI FCFoV') c ibis call draw_square (27.0d0, 0, 'IBIS OCFoV') c jemx call draw_circle (5.0d0, 2, 'JEMX OCFoV') c spi call draw_hex (30.0d0, 3, ' SPI OCFoV') close(1) end c================================= subroutine write_header write (1,1)'#celmodel__ascii' 1 format(a) write (1,1) ' ' write (1,1)' material #0 IBIS' write (1,1)' emissive 0 0 1' write (1,1)' diffuse 0 0 1' write (1,1)' opacity 1' write (1,1)' end_material' write (1,1) ' ' write (1,1)' material #1 OMC' write (1,1)' emissive 0 1 0' write (1,1)' diffuse 0 1 0' write (1,1)' opacity 1' write (1,1)' end_material' write (1,1) ' ' write (1,1)' material #2 JEMX' write (1,1)' emissive 1 0 1' write (1,1)' diffuse 1 0 1' write (1,1)' opacity 1' write (1,1)' end_material' write (1,1) ' ' write (1,1)' material #3 SPI' write (1,1)' emissive 1 0 0' write (1,1)' diffuse 1 0 0' write (1,1)' opacity 1' write (1,1)' end_material' write (1,1) ' ' return end c================================= subroutine draw_square (side, icolor, name) implicit double precision (a-h,o-z) Character*(*) name write (1,1) ' ' write (1,10)'mesh # square:',side,name write (1,1)' vertexdesc position f3 end_vertexdesc' call th2radius (side,r) write (1,1)' vertices 4' write (1,2) -(r/2.0d0), (r/2.0d0) write (1,2) -(r/2.0d0), -(r/2.0d0) write (1,2) (r/2.0d0), -(r/2.0d0) write (1,2) (r/2.0d0), (r/2.0d0) write (1,3)' linestrip ',icolor,' 5' write (1,1)' 0 1 2 3 0' write (1,1)'end_mesh' write (1,1) ' ' return 1 format(a) 10 format(a,f12.5,' ',a) 2 format(f12.5,' 0 ',f12.5) 3 format(a,i4,a) end c================================= subroutine draw_hex (side, icolor,name) implicit double precision (a-h,o-z) Character*(*) name d2r = 6.283185307179586476925287D0/360.0d0 write (1,1) ' ' write (1,10)'mesh # hex:',side,name write (1,1)' vertexdesc position f3 end_vertexdesc' call th2radius (side,r) write (1,1)' vertices 6' do nth = 0,300,60 th = d2r*nth x = r*cos(th) y = r*sin(th) write (1,2) x,y enddo write (1,3)' linestrip ',icolor,' 7' write (1,1)' 0 1 2 3 4 5 0' write (1,1)'end_mesh' write (1,1) ' ' return 1 format(a) 10 format(a,f12.5,' ',a) 2 format(f12.5,' 0 ',f12.5) 3 format(a,i4,a) end c================================= subroutine draw_circle (theta, icolor, name) implicit double precision (a-h,o-z) Character*(*) name d2r = 6.283185307179586476925287D0/360.0d0 write (1,1) ' ' write (1,10)'mesh # circle:',theta,name write (1,1)' vertexdesc position f3 end_vertexdesc' call th2radius (theta,r) write (1,1)' vertices 360' do nth = 0,359 th = d2r*nth x = r*cos(th) y = r*sin(th) write (1,2) x,y enddo write (1,3)' linestrip ',icolor,' 361' do np = 0,359 write (1,4) np enddo write (1,4) 0 write (1,1)'end_mesh' return 1 format(a) 10 format(a,f12.5,' ',a) 2 format(f12.5,' 0 ',f12.5) 3 format(a,i4,a) 4 format(i4) end c================================= subroutine th2radius (theta,radius) implicit double precision (a-z) d2r = 6.283185307179586476925287D0/360.0d0 c distance from INTEGRAL model to fov model in km c this *must* agree with the FixedPosition value in pointing_integral.ssc distance = 100.0d0 th = d2r*theta radius = distance*tan(th) return end