; NAME: ; TESTSYNTHSPEC ; ; PURPOSE: ; Test the synthspec package ; ; CALLING SEQUENCE: ; testsynthspec, precision ; ; INPUTS: ; Precision: Allowable absolute error between files. (1.e-6) ; ; PROCEDURE: ; Grab location of control files, write out new test files into ; the current directory, then compare the two. ; ; FUNCTIONS CALLED: ; synthspec ; ; MODIFICATION HISTORY: ; created Augest 4 2003 by John Dermody pro testsynthspec, precision=precision on_error, 1 if not keyword_defined(precision) then precision = 1.e-6 loc1obj = file_which('synthspec1obj.fits') loc1sky = file_which('synthspec1sky.fits') loc2obj = file_which('synthspec2obj.fits') loc2sky = file_which('synthspec2sky.fits') ; simple frames objframe1 = synthspec(skyframe1, objheader=objheader1, skyheader=skyheader1, $ /nonoise, /norays, /nobad, /nospecl, /noskyl, /nosmile, $ /notilt, /notrace) print, "Creating simple test files" writefits, 'test1obj.fits', objframe1, objheader writefits, 'test1sky.fits', skyframe1, skyheader objframe2 = synthspec(skyframe2, objheader=objheader2, skyheader=skyheader2, $ /nonoise, /norays, /nobad, /nospecl) print, "Creating default test files" writefits, 'test2obj.fits', objframe2, objheader writefits, 'test2sky.fits', skyframe2, skyheader if ((loc1obj ne "") and (loc1sky ne "")) then begin controlobjframe = readfits(loc1obj, controlobjheader, /silent) controlskyframe = readfits(loc1sky, controlskyheader, /silent) if (max(abs(controlobjframe - objframe1)) gt precision) then begin print, "FAIL - Simple Object Frame" endif else begin print, "PASS - Simple Object Frame" endelse if (max(abs(controlskyframe - skyframe1)) gt precision) then begin print, "FAIL - Simple Sky Frame" endif else begin print, "PASS - Simple Sky Frame" endelse endif else begin message, "Good simple test files not found" endelse ;defaults if ((loc2obj ne "") and (loc2sky ne "")) then begin controlobjframe = readfits(loc2obj, controlobjheader, /silent) controlskyframe = readfits(loc2sky, controlskyheader, /silent) if (max(abs(controlobjframe - objframe2)) gt precision) then begin print, "FAIL - Default Object Frame" endif else begin print, "PASS - Default Object Frame" endelse if (max(abs(controlskyframe - skyframe2)) gt precision) then begin print, "FAIL - Default Sky Frame" endif else begin print, "PASS - Default Sky Frame" endelse endif else begin message, "Good default test files not found" endelse end