subroutine pitpha(minang) c c routine returns the spin phase angle where the minimum pitch angle c is sampled. c minang is returned in range -180 to +180 deg. c minang is returned =-1000 is b field is invalid. c c v1.0 jfe johnson 9 sep 82 c real b(3),brot(3) integer*2 idat(2812) common/maf1/idat c minang=-1000 call tstbm1(kode) if(kode.ne.0)return ! bad b field values c c put the b field values for the first sample into real arrays c do 1000 i=1,3 1000 b(i)=float(idat(100+i))*float(idat(25)) c spang=float(idat(23))*0.1 call axisrt(b,-spang,brot) ! rotate to fixed frame c determine phase angle at which we look, which is projected angle of c rotated b field onto spin plane rminan=atan2(brot(2),brot(1)) rminan=rminan*180.0/3.14159 rminan=amod(rminan+360.0,360.0) if(rminan.gt.180.0)rminan=rminan-360.0 minang=rminan return end