void InputEquatSlewDat( void) { /* read (rb) slew.dat where: R <Ra degrees> D <Dec degrees> p <Alt degrees> q <Az degrees> ... t <time()> <JD> L <lat> <long> */ Input = fopen( FullyQualifiedSlewFile, "r"); if( Input == NULL) PressKeyToContMsg( "Could not read slew file"); else { do fscanf( Input, "%s", Name); while( strcmpi( Name, "R") != 0); FReadDouble( Input, &In.Ra); In.Ra /= RadToDeg; do fscanf( Input, "%s", Name); while( strcmpi( Name, "D") != 0); FReadDouble( Input, &In.Dec); In.Dec /= RadToDeg; fclose( Input); DisplayIn( "from guide (Ra, Dec)", NameBlanks); } }
void ReadGuideStartup( void) { double RaDeg, DecDeg; struct HMSH RaHMSH; struct DMS DecDMS; Flag RaFlag = No; Flag DecFlag = No; Input = fopen( GuideStartupMarFilePtr, "r"); if( Input == NULL) BadExit( strcat( "ReadGuideStartup(): Could not open ", GuideStartupMarFilePtr)); fscanf( Input, "%s", Name); while( !feof( Input) && !RaFlag || !DecFlag) { if( (strncmpi( Name, "ra", sizeof( Name))) == 0) { FReadDouble( Input, &RaDeg); RaDeg = 360. - RaDeg; RaFlag = Yes; } else if( (strncmpi( Name, "dec", sizeof( Name))) == 0) { FReadDouble( Input, &DecDeg); DecFlag = Yes; } fscanf( Input, "%s", Name); } fclose( Input); if( RaFlag && DecFlag) { In.Ra = RaDeg*DegToRad; In.Dec = DecDeg*DegToRad; DisplayIn( "from Guide", NameBlanks); /* write to OutGuideFile, preserving a record of all positions returned from Guide */ GetHMSH( In.Ra*RadToHundSec + .5, &RaHMSH); GetDMS( In.Dec*RadToArcsec + .5, &DecDMS); if( In.Dec < 0) if( DecDMS.Deg > 0) DecDMS.Deg = -DecDMS.Deg; else if( DecDMS.Min > 0) DecDMS.Min = -DecDMS.Min; else DecDMS.Sec = -DecDMS.Sec; fprintf( OutGuideFilePtr, "%3d %3d %3d %3d %3d %3d from_guide\n", RaHMSH.Hr, RaHMSH.Min, RaHMSH.Sec, DecDMS.Deg, DecDMS.Min, DecDMS.Sec); } }