	program start_times
c	
c	This program calculates a year's worth of SMEI orbit start times pegged to
c	1h 5m 4.6s on DOY 148 (May 28, 2003), and using a value of 0.4345s reduction
c	in SMEI period per 365 days, which reproduces southmost camera 2 pointing for
c	orbits spanning SMEI data in 2003.
c	Then a small quadratic term provides a little better fit to orbital performance later in SMEI
c
	real*8 t0,torbit,doy,h,m,s
	integer*4 n,idoy,ih,im
c
	t0=-198.1D0
c
	open(10,file='start_times_quad.txt')	
	do n=1,14000
c	torbit=6096.49D0-0.84D-04*dfloat(n)
	torbit=6096.5074D0-1.044D-04*dfloat(n)+3.33136D-09*dfloat(n)*dfloat(n)
	doy=1.D0+t0/86400.D0
	idoy=int(doy)
	doy=doy-dfloat(idoy)
	h=24.D0*doy
	ih=int(h)
	h=h-dfloat(ih)
	m=60.D0*h
	im=int(m)
	m=m-dfloat(im)
	s=60.D0*m
	if(idoy.gt.365.and.idoy.lt.732)idoy=idoy-365	!normal year 2003
	if(idoy.ge.732)idoy=idoy-731			!leap year 2004
c	write(10,1)n,idoy,ih,im,s,torbit
	write(10,1)n,idoy,ih,im,s,torbit-6096.0D0
1	format(2i5,2i3,f5.1,f10.3)
	t0=t0+torbit
	enddo
	stop	'reached end'
	end		
