package USNOExtract; use strict; use English; use Carp; use vars qw(@ISA $VERSION $name $author $date $version @instList $numberOfStreams); @ISA = qw(Module); use ModuleResources; # Declare identity, version, author, date, etc. $name=__PACKAGE__; $VERSION='0.02'; $version = $VERSION; $author='Ian Stewart,Duncan John Fyfe'; $date='2005-11-22'; # # ChangeLog # ========= # # Version 0.02 - 2005-11-22 DJF # ------------ # # + Added call to crosscorrelationCatalogue to get catalogue details from the pipeline configuration. # # Version 0.01 - 2005-11-18 IMS # ------------ # # + First production version. # # Declare list of instruments this module is interested in @instList=qw(all); # Number of streams sub numberOfStreams { return 1; } sub evaluateRules { # If upstream module has been ignored, so if this one return ignore() if allIgnored( module => 'ExpChooser' , instrument => 'epn' ) and allIgnored( module => 'ExpChooser' , instrument => 'emos1' ) and allIgnored( module => 'ExpChooser' , instrument => 'emos2' ) and allIgnored( module => 'ExpChooser' , instrument => 'om' ); # Start conditions start() if allComplete( module => 'ExpChooser' , instrument => 'epn' ) and allComplete( module => 'ExpChooser' , instrument => 'emos1' ) and allComplete( module => 'ExpChooser' , instrument => 'emos2' ) and allComplete( module => 'ExpChooser' , instrument => 'om' ) and complete( module => 'GlobalHK' , instrument => 'all' , stream => 1 ); } sub performAction { info("Module version number: $version"); my $attFile=findFile( class => 'product' , instrument => 'all' , content => 'Attitude time series' , required => 'true' ); my $raDeg = readFITSKeyword( file => $attFile , extension => 'PRIMARY' , keyword => 'MAHFRA' ); my $decDeg = readFITSKeyword( file => $attFile , extension => 'PRIMARY' , keyword => 'MAHFDEC' ); my $raDegStr = sprintf "%21.14e", $raDeg; my $decDegStr = sprintf "%21.14e", $decDeg; my $kwdAsciiFile=newFile( class => 'intermediate' , instrument => thisInstrument , content => 'fimgcreate kwds' , format => 'ASCII' ); open(FMT, ">$kwdAsciiFile"); print FMT "CTYPE1 = 'RA---TAN' / Coord. type: RA tangent plane projection\n"; print FMT "CRPIX1 = 3.24506250000000E+02 / WCS reference pixel\n"; print FMT "CRVAL1 = $raDegStr / [deg] coord. at X axis ref. pixel\n"; print FMT "CUNIT1 = 'deg ' / Physical units of X axis\n"; print FMT "CDELT1 = -1.11111111111111E-03 / WCS pixel size\n"; print FMT "CTYPE2 = 'DEC--TAN' / Coord. type: DEC tangent plane projection\n"; print FMT "CRPIX2 = 3.24506250000000E+02 / WCS reference pixel\n"; print FMT "CRVAL2 = $decDegStr / [deg] coord. at Y axis ref. pixel\n"; print FMT "CUNIT2 = 'deg ' / Physical units of Y axis\n"; print FMT "CDELT2 = 1.11111111111111E-03 / WCS pixel size\n"; close(FMT); my $dummyImageFile=newFile( class => 'intermediate' , instrument => thisInstrument , content => 'dummy image' ); doCommand( 'fimgcreate' , bitpix => 8 , naxes => "'648,648'" , datafile => "none" , outfile => $dummyImageFile , headfile => $kwdAsciiFile ) or return exception(); my $usnoList = newFile( class => 'intermediate' , instrument => thisInstrument , content => 'USNO source list' , format => 'FITS' ); # Provides catalogue and variant values. my $cat = crosscorrelationCatalogue(); usnoSourceSearch( %$cat ,image => $dummyImageFile ,list => $usnoList ); return success(); } 1;