RDI_Coords.pl
changeset 34 3b4bcd55e1ea
parent 32 7155adf61d77
child 35 7c394a2d1fc9
equal deleted inserted replaced
33:307630665c6c 34:3b4bcd55e1ea
     1 #======================================================================
     1 #======================================================================
     2 #                    R D I _ C O O R D S . P L 
     2 #                    R D I _ C O O R D S . P L 
     3 #                    doc: Sun Jan 19 17:57:53 2003
     3 #                    doc: Sun Jan 19 17:57:53 2003
     4 #                    dlm: Mon Feb 29 18:03:31 2016
     4 #                    dlm: Thu May 19 10:18:44 2016
     5 #                    (c) 2003 A.M. Thurnherr
     5 #                    (c) 2003 A.M. Thurnherr
     6 #                    uE-Info: 44 85 NIL 0 0 72 0 2 4 NIL ofnI
     6 #                    uE-Info: 167 0 NIL 0 0 72 0 2 4 NIL ofnI
     7 #======================================================================
     7 #======================================================================
     8 
     8 
     9 # RDI Workhorse Coordinate Transformations
     9 # RDI Workhorse Coordinate Transformations
    10 
    10 
    11 # HISTORY:
    11 # HISTORY:
    41 #				  - removed unused code from &velBeamToBPInstrument
    41 #				  - removed unused code from &velBeamToBPInstrument
    42 #	Jan  5, 2016: - added &velEarthToInstrument(@), &velInstrumentToBeam(@)
    42 #	Jan  5, 2016: - added &velEarthToInstrument(@), &velInstrumentToBeam(@)
    43 #	Jan  9, 2016: - added &velEarthToBeam(), &velBeamToEarth()
    43 #	Jan  9, 2016: - added &velEarthToBeam(), &velBeamToEarth()
    44 #	Feb 29, 2016: - debugged & verified velEarthToInstrument(), velInstrumentToBeam()
    44 #	Feb 29, 2016: - debugged & verified velEarthToInstrument(), velInstrumentToBeam()
    45 #				  - added velBeamToEarth()
    45 #				  - added velBeamToEarth()
       
    46 #	May 19, 2016: - begin implemeting bin interpolation
    46 
    47 
    47 use strict;
    48 use strict;
    48 use POSIX;
    49 use POSIX;
    49 
    50 
    50 my($PI) = 3.14159265358979;
    51 my($PI) = 3.14159265358979;
    65 { # STATIC SCOPE
    66 { # STATIC SCOPE
    66 	my(@B2I);
    67 	my(@B2I);
    67 
    68 
    68 	sub velBeamToInstrument(@)
    69 	sub velBeamToInstrument(@)
    69 	{
    70 	{
    70 		my($dta,$v1,$v2,$v3,$v4) = @_;
    71 		my($dta,$ens,$v1,$v2,$v3,$v4) = @_;
    71 		return undef unless (defined($v1) + defined($v2) +
    72 		return undef unless (defined($v1) + defined($v2) +
    72 					   		 defined($v3) + defined($v4)
    73 					   		 defined($v3) + defined($v4)
    73 								>= $RDI_Coords::minValidVels);
    74 								>= $RDI_Coords::minValidVels);
    74 
    75 
    75 		unless (@B2I) {
    76 		unless (@B2I) {
   161 
   162 
   162 
   163 
   163 sub velBeamToEarth(@)
   164 sub velBeamToEarth(@)
   164 {
   165 {
   165 	my($dtaR,$e,@v) = @_;
   166 	my($dtaR,$e,@v) = @_;
   166 	return velInstrumentToEarth($dtaR,$e,velBeamToInstrument($dtaR,@v));
   167 	return velInstrumentToEarth($dtaR,$e,velBeamToInstrument($dtaR,$e,@v));
   167 }
   168 }
   168 
   169 
   169 #----------------------------------------------------------------------
   170 #----------------------------------------------------------------------
   170 # velEarthToInstrument() transforms earth to instrument coordinates
   171 # velEarthToInstrument() transforms earth to instrument coordinates
   171 #	- based on manually inverted rotation matrix M (Sec 5.6 in coord-trans manual)
   172 #	- based on manually inverted rotation matrix M (Sec 5.6 in coord-trans manual)