Skip to content
Snippets Groups Projects
Commit 8c996b08 authored by paarongiroux's avatar paarongiroux Committed by Kristin
Browse files

UNFINISHED lronac isis driver work. (#296)

* ISIS ideal now fails if inst id is not ISIS Ideal

* redo super

* updated ideal test

* updated themis tests

* added themis test data

* updates as per comments

* updated as per comments

* updated tests

* unfinished lronac isis driver work

* added missing kernels

* error in body code

* updated tests

* patched int line

* addressing comments
parent a7d114bf
No related branches found
No related tags found
No related merge requests found
Showing
with 245147 additions and 137 deletions
......@@ -8,6 +8,7 @@ from ale.util import get_metakernels
from ale.base import Driver
from ale.base.data_naif import NaifSpice
from ale.base.label_pds3 import Pds3Label
from ale.base.label_isis import IsisLabel
from ale.base.type_sensor import LineScanner
......@@ -220,3 +221,202 @@ class LroLrocPds3LabelNaifSpiceDriver(LineScanner, NaifSpice, Pds3Label, Driver)
Number of samples and lines combined from the original data to produce a single pixel in this image
"""
return self.crosstrack_summing
class LroLrocIsisLabelNaifSpiceDriver(LineScanner, NaifSpice, IsisLabel, Driver):
@property
def instrument_id(self):
"""
The short text name for the instrument
Returns an instrument id uniquely identifying the instrument. Used to acquire
instrument codes from Spice Lib bods2c routine.
Returns
-------
str
The short text name for the instrument
"""
id_lookup = {
"NACL": "LRO_LROCNACL",
"NACR": "LRO_LROCNACR"
}
return id_lookup[super().instrument_id]
@property
def sensor_model_version(self):
"""
Returns ISIS instrument sensor model version number
Returns
-------
: int
ISIS sensor model version
"""
return 2
@property
def usgscsm_distortion_model(self):
"""
The distortion model name with its coefficients
LRO LROC NAC does not use the default distortion model so we need to overwrite the
method packing the distortion model into the ISD.
Returns
-------
: dict
Returns a dict with the model name : dict of the coefficients
"""
return {"lrolrocnac":
{"coefficients": self.odtk}}
@property
def odtk(self):
"""
The coefficients for the distortion model
Returns
-------
: list
Radial distortion coefficients. There is only one coefficient for LROC NAC l/r
"""
return spice.gdpool('INS{}_OD_K'.format(self.ikid), 0, 1).tolist()
@property
def light_time_correction(self):
"""
Returns the type of light time correciton and abberation correction to
use in NAIF calls.
LROC is specifically set to not use light time correction because it is
so close to the surface of the moon that light time correction to the
center of the body is incorrect.
Returns
-------
: str
The light time and abberation correction string for use in NAIF calls.
See https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/abcorr.html
for the different options available.
"""
return 'NONE'
@property
def detector_center_sample(self):
"""
The center of the CCD in detector pixels
ISIS uses 0.5 based CCD samples, so we need to convert to 0 based.
Returns
-------
float :
The center sample of the CCD
"""
return super().detector_center_sample - 0.5
@property
def ephemeris_start_time(self):
"""
The starting ephemeris time for LRO is computed by taking the
LRO:SPACECRAFT_CLOCK_PREROLL_COUNT, as defined in the label, and
adding offsets that were taken from an IAK.
-------
: double
Starting ephemeris time of the image
"""
start_time = spice.scs2e(self.spacecraft_id, self.label['IsisCube']['Instrument']['SpacecraftClockPrerollCount'])
return start_time + self.constant_time_offset + self.additional_preroll * self.exposure_duration
@property
def exposure_duration(self):
"""
Takes the exposure_duration defined in a parent class and adds
offsets taken from an IAK.
Returns
-------
: float
Returns the exposure duration in seconds.
"""
return super().exposure_duration * (1 + self.multiplicative_line_error) + self.additive_line_error
@property
def multiplicative_line_error(self):
"""
Returns the multiplicative line error defined in an IAK.
Returns
-------
: float
Returns the multiplicative line error.
"""
return 0.0045
@property
def additive_line_error(self):
"""
Returns the additive line error defined in an IAK.
Returns
-------
: float
Returns the additive line error.
"""
return 0.0
@property
def constant_time_offset(self):
"""
Returns the constant time offset defined in an IAK.
Returns
-------
: float
Returns the constant time offset.
"""
return 0.0
@property
def additional_preroll(self):
"""
Returns the addition preroll defined in an IAK.
Returns
-------
: float
Returns the additionl preroll.
"""
return 1024.0
@property
def sampling_factor(self):
"""
Returns the summing factor from the PDS3 label that is defined by the CROSSTRACK_SUMMING.
For example a return value of 2 indicates that 2 lines and 2 samples (4 pixels)
were summed and divided by 4 to produce the output pixel value.
Returns
-------
: int
Number of samples and lines combined from the original data to produce a single pixel in this image
"""
return self.label['IsisCube']['Instrument']['SpatialSumming']
@property
def target_frame_id(self):
"""
Returns the Naif ID code for the target body
Expects target_name to be defined. This must be a string containig the name
of the target body.
Returns
-------
: int
Naif ID code for the target body
"""
name_lookup = {
"MOON": "MOON_ME"
}
return int(spice.gdpool('FRAME_{}'.format(name_lookup[self.target_name]),0,1))
......@@ -6,7 +6,7 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 44
'SPK_STATES_13 '
'1203A21863267E^8'
'1203A2253DC63C^8'
'1203A2253D432A^8'
'-55'
'12D'
'1'
......@@ -60,7 +60,7 @@ END_ARRAY 1 44
BEGIN_ARRAY 2 45
'DE-0421LE-0421 '
'1203A21863267E^8'
'1203A2253DC63C^8'
'1203A2253D432A^8'
'12D'
'3'
'1'
......@@ -115,7 +115,7 @@ END_ARRAY 2 45
BEGIN_ARRAY 3 39
'DE-0421LE-0421 '
'1203A21863267E^8'
'1203A2253DC63C^8'
'1203A2253D432A^8'
'A'
'0'
'1'
......@@ -164,7 +164,7 @@ END_ARRAY 3 39
BEGIN_ARRAY 4 45
'DE-0421LE-0421 '
'1203A21863267E^8'
'1203A2253DC63C^8'
'1203A2253D432A^8'
'3'
'0'
'1'
......@@ -218,25 +218,25 @@ BEGIN_ARRAY 4 45
END_ARRAY 4 45
TOTAL_ARRAYS 4
~NAIF/SPC BEGIN COMMENTS~
; /Users/jmapel/ale/nb_test/M103595705LE_0.bsp LOG FILE
; /home/pgiroux/Desktop/lro_slices/M103595705LE_0.bsp LOG FILE
; Created 2019-09-04/12:46:24.00.
; Created 2019-10-11/11:26:30.00.
;
; BEGIN SPKMERGE COMMANDS
LEAPSECONDS_KERNEL = /usgs/cpkgs/isis3/data/base/kernels/lsk/naif0012.tls
SPK_KERNEL = /Users/jmapel/ale/nb_test/M103595705LE_0.bsp
SPK_KERNEL = /home/pgiroux/Desktop/lro_slices/M103595705LE_0.bsp
SOURCE_SPK_KERNEL = /usgs/cpkgs/isis3/data/lro/kernels/spk/fdf29r_2009182_2009213_v01.bsp
INCLUDE_COMMENTS = NO
BODIES = -85
BEGIN_TIME = 2009 JUL 30 12:12:06.204
END_TIME = 2009 JUL 30 12:12:19.058
END_TIME = 2009 JUL 30 12:12:19.056
SOURCE_SPK_KERNEL = /usgs/cpkgs/isis3/data/lro/kernels/tspk/de421.bsp
INCLUDE_COMMENTS = NO
BODIES = 3, 10, 301
BEGIN_TIME = 2009 JUL 30 12:12:06.204
END_TIME = 2009 JUL 30 12:12:19.058
END_TIME = 2009 JUL 30 12:12:19.056
; END SPKMERGE COMMANDS
~NAIF/SPC END COMMENTS~
......@@ -6,7 +6,7 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 44
'SPK_STATES_13 '
'1203A4135E494D^8'
'1203A41DC803AB^8'
'1203A41DC78099^8'
'-55'
'12D'
'1'
......@@ -60,7 +60,7 @@ END_ARRAY 1 44
BEGIN_ARRAY 2 45
'DE-0421LE-0421 '
'1203A4135E494D^8'
'1203A41DC803AB^8'
'1203A41DC78099^8'
'12D'
'3'
'1'
......@@ -115,7 +115,7 @@ END_ARRAY 2 45
BEGIN_ARRAY 3 39
'DE-0421LE-0421 '
'1203A4135E494D^8'
'1203A41DC803AB^8'
'1203A41DC78099^8'
'A'
'0'
'1'
......@@ -164,7 +164,7 @@ END_ARRAY 3 39
BEGIN_ARRAY 4 45
'DE-0421LE-0421 '
'1203A4135E494D^8'
'1203A41DC803AB^8'
'1203A41DC78099^8'
'3'
'0'
'1'
......@@ -218,25 +218,25 @@ BEGIN_ARRAY 4 45
END_ARRAY 4 45
TOTAL_ARRAYS 4
~NAIF/SPC BEGIN COMMENTS~
; /Users/jmapel/ale/nb_test/M103595705LE_1.bsp LOG FILE
; /home/pgiroux/Desktop/lro_slices/M103595705LE_1.bsp LOG FILE
; Created 2019-09-04/12:46:24.00.
; Created 2019-10-11/11:26:31.00.
;
; BEGIN SPKMERGE COMMANDS
LEAPSECONDS_KERNEL = /usgs/cpkgs/isis3/data/base/kernels/lsk/naif0012.tls
SPK_KERNEL = /Users/jmapel/ale/nb_test/M103595705LE_1.bsp
SPK_KERNEL = /home/pgiroux/Desktop/lro_slices/M103595705LE_1.bsp
SOURCE_SPK_KERNEL = /usgs/cpkgs/isis3/data/lro/kernels/spk/fdf29r_2009182_2009213_v01.bsp
INCLUDE_COMMENTS = NO
BODIES = -85
BEGIN_TIME = 2009 JUL 30 12:20:33.185
END_TIME = 2009 JUL 30 12:20:43.598
END_TIME = 2009 JUL 30 12:20:43.596
SOURCE_SPK_KERNEL = /usgs/cpkgs/isis3/data/lro/kernels/tspk/de421.bsp
INCLUDE_COMMENTS = NO
BODIES = 3, 10, 301
BEGIN_TIME = 2009 JUL 30 12:20:33.185
END_TIME = 2009 JUL 30 12:20:43.598
END_TIME = 2009 JUL 30 12:20:43.596
; END SPKMERGE COMMANDS
~NAIF/SPC END COMMENTS~
Object = IsisCube
Object = Core
StartByte = 65537
Format = Tile
TileSamples = 422
TileLines = 512
Group = Dimensions
Samples = 5064
Lines = 400
Bands = 1
End_Group
Group = Pixels
Type = Real
ByteOrder = Lsb
Base = 0.0
Multiplier = 1.0
End_Group
End_Object
Group = Instrument
SpacecraftName = "LUNAR RECONNAISSANCE ORBITER"
InstrumentHostName = "LUNAR RECONNAISSANCE ORBITER"
InstrumentHostId = LRO
InstrumentName = "LUNAR RECONNAISSANCE ORBITER NARROW ANGLE
CAMERA LEFT"
InstrumentId = NACL
FrameId = LEFT
TargetName = MOON
MissionPhaseName = COMMISSIONING
PrerollTime = 2009-07-30T12:20:37.127
StartTime = 2009-07-30T12:20:38.185
StopTime = 2009-07-30T12:21:32.155
SpacecraftClockPrerollCount = 1/270649237:07208
SpacecraftClockStartCount = 1/270649238:11024
SpacecraftClockStopCount = 1/270649292:09046
LineExposureDuration = 1.028800 <ms>
TemperatureSCS = 2.49 <degC>
TemperatureFPA = 16.89 <degC>
TemperatureFPGA = -14.08 <degC>
TemperatureTelescope = 12.38 <degC>
SpatialSumming = 1
SampleFirstPixel = 0
TemperatureSCSRaw = 2833
TemperatureFPARaw = 2155
TemperatureFPGARaw = 3476
TemperatureTelescopeRaw = 2370
End_Group
Group = Archive
DataSetId = LRO-L-LROC-2-EDR-V1.0
OriginalProductId = nacl00002965
ProductId = M103595705LE
ProducerId = LRO_LROC_TEAM
ProducerInstitutionName = "ARIZONA STATE UNIVERSITY"
ProductVersionId = v1.8
UploadId = SC_2009211_0000_B_V01.txt
OrbitNumber = 433
RationaleDescription = "TARGET OF OPPORTUNITY"
DataQualityId = 0
LineExposureCode = 81
DACResetLevel = 198
ChannelAOffset = 40
ChannelBOffset = 104
CompandCode = 0
LineCode = 51
BTerms = (0, 8, 25, 59, 128)
MTerms = (0.5, 0.25, 0.125, 0.0625, 0.03125)
XTerms = (0, 32, 136, 543, 2207)
CompressionFlag = 1
Mode = 7
End_Group
Group = BandBin
FilterName = BroadBand
Center = 600 <nm>
Width = 300 <nm>
End_Group
Group = Kernels
NaifFrameCode = -85600
End_Group
End_Object
Object = Label
Bytes = 65536
End_Object
Object = History
Name = IsisCube
StartByte = 1057914881
Bytes = 428
End_Object
Object = OriginalLabel
Name = IsisCube
StartByte = 1057915309
Bytes = 4411
End_Object
End
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -6,35 +6,35 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 19
'LRO_LROCNACL DATA TYPE 3 '
'1021C5962FF4^C'
'1021C5A30A9D^C'
'1021C5A30A23^C'
'-14E60'
'-14C08'
'3'
'1'
19
'FFF91D64D19238^0'
'-3ABFADE78ED4EE^-1'
'42A8C39E6613^-3'
'-893668BB093ED^-2'
'-3ABFADE78ED4F^-1'
'42A8C39E66130C^-3'
'-893668BB093EC^-2'
'34C15FCBF9D626^-6'
'-38BAC10FCB0EF^-7'
'-1A0BC4D9A9D106^-8'
'FFF91D6018BDB^0'
'-3ABFC27A37375E^-1'
'42A94F1BDFCF2^-3'
'-8936689831C63^-2'
'37F79D727A8C^-6'
'-85C86A076739C^-7'
'-3D6C5F78626F2A^-8'
'FFF91D6018EA8^0'
'-3ABFC27973F4FA^-1'
'42A94F16B3E4BC^-3'
'-893668983310F^-2'
'37F77EF68146EC^-6'
'-85C58EB5195CB^-7'
'-3D6B0FB3354448^-8'
'1021C5962FF4^C'
'1021C5A30A9D^C'
'1021C5A30A23^C'
'1021C5962FF4^C'
'1^1'
'2^1'
END_ARRAY 1 19
TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~
This CK is for testing with the image: /work/users/jmapel/M103595705LE.cub
This CK is for testing with the image: /home/pgiroux/Desktop/M103595705LE.cub
This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~
......@@ -6,35 +6,35 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 19
'LRO_LROCNACR DATA TYPE 3 '
'1021C5962FF4^C'
'1021C5A30A9D^C'
'1021C5A30A23^C'
'-14E6A'
'-14C08'
'3'
'1'
19
'4ABD7DFCD07A34^-2'
'4ABD7DFCD07A2^-2'
'-28479DF5DC79DC^-2'
'-2782E9949E4FE4^-1'
'-FFFCE553D8AC18^0'
'-34C15FCBF6DABC^-6'
'-2782E9949E4FE6^-1'
'-FFFCE553D8AC1^0'
'-34C15FCBF6DABE^-6'
'38BE074E98097C^-7'
'-1184523E56ED56^-8'
'4ABD7E4470D09^-2'
'-2847A59D3FE5F4^-2'
'-2782FE27FE7FD6^-1'
'-FFFCE550AA5EE8^0'
'-37F79D7278059A^-6'
'85D022D5E48D18^-7'
'-294F3CEB71375A^-8'
'4ABD7E446E28BC^-2'
'-2847A59CF74132^-2'
'-2782FE273B369C^-1'
'-FFFCE550AA7D1^0'
'-37F77EF67EC082^-6'
'85CD4759607BB8^-7'
'-294E5B19EA0B4A^-8'
'1021C5962FF4^C'
'1021C5A30A9D^C'
'1021C5A30A23^C'
'1021C5962FF4^C'
'1^1'
'2^1'
END_ARRAY 1 19
TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~
This CK is for testing with the image: /work/users/jmapel/M103595705LE.cub
This CK is for testing with the image: /home/pgiroux/Desktop/M103595705LE.cub
This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~
......@@ -6,35 +6,35 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 19
'LRO_LROCWAC DATA TYPE 3 '
'1021C5962FF4^C'
'1021C5A30A9D^C'
'1021C5A30A23^C'
'-14E74'
'-14C08'
'3'
'1'
19
'FFFFFFFFD74A3^0'
'-85214D1E75E7C8^-4'
'-37DB9E0D69AB8C^-4'
'-1D0990F9882A2D^-8'
'2FD95956569878^-6'
'FFFFFFFFD74A2^0'
'-85214D1E75E7B8^-4'
'-37DB9E0D69AB7E^-4'
'-1D0990F9882A29^-8'
'2FD95956569876^-6'
'-3077ED33BD5752^-6'
'-33849E0A29252C^-A'
'FFFFFFFFD6EEC^0'
'-864E46E8BBAEF^-4'
'-36AAF4922FE936^-4'
'-1CA79A86242617^-8'
'31FCAC4480E09^-6'
'-32B3E1A7EBD0F6^-6'
'-3677B95D32900E^-A'
'FFFFFFFFD6EEB^0'
'-864E3BC0240F5^-4'
'-36AAFFDDC434E2^-4'
'-1CA79E371CC4EB^-8'
'31FC97F9CB6818^-6'
'-32B3CC736FF64A^-6'
'-36779D5E668328^-A'
'1021C5962FF4^C'
'1021C5A30A9D^C'
'1021C5A30A23^C'
'1021C5962FF4^C'
'1^1'
'2^1'
END_ARRAY 1 19
TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~
This CK is for testing with the image: /work/users/jmapel/M103595705LE.cub
This CK is for testing with the image: /home/pgiroux/Desktop/M103595705LE.cub
This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~
......@@ -6,7 +6,7 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 19
'LRO_LROCNACL DATA TYPE 3 '
'1021C7912B1^C'
'1021C79B94E3^C'
'1021C79B9469^C'
'-14E60'
'-14C08'
'3'
......@@ -15,26 +15,26 @@ BEGIN_ARRAY 1 19
'FFF91C6346CA18^0'
'-3AC40FF39E8BD^-1'
'428975384289D4^-3'
'-89366F50DAFFA^-2'
'-89366F50DB00A8^-2'
'3FEE0F16185CC6^-6'
'-5B3633299BE7FC^-6'
'-29E3BE8A7CD6B6^-7'
'FFF91C5E6BFE18^0'
'-3AC42507844446^-1'
'42A6C5871CF93C^-3'
'-8936689318F04^-2'
'3C75E8B98A1F92^-6'
'-5F8BEE1495545^-6'
'-2BE174B4E2DB8C^-7'
'FFF91C5E6C36F^0'
'-3AC425068D5386^-1'
'42A6C42FAEBE5^-3'
'-8936689367EA^-2'
'3C76115ED67A7^-6'
'-5F8BBB4B51059C^-6'
'-2BE15D6141EE32^-7'
'1021C7912B1^C'
'1021C79B94E3^C'
'1021C79B9469^C'
'1021C7912B1^C'
'1^1'
'2^1'
END_ARRAY 1 19
TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~
This CK is for testing with the image: /work/users/jmapel/M103595705LE.cub
This CK is for testing with the image: /home/pgiroux/Desktop/M103595705LE.cub
This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~
......@@ -6,35 +6,35 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 19
'LRO_LROCNACR DATA TYPE 3 '
'1021C7912B1^C'
'1021C79B94E3^C'
'1021C79B9469^C'
'-14E6A'
'-14C08'
'3'
'1'
19
'4ABD83D35E2EE^-2'
'4ABD83D35E2DE^-2'
'-28456EF713458^-2'
'-27874B957BBE42^-1'
'-27874B957BBE4^-1'
'-FFFCE4A6F74FF^0'
'-3FEE0F161545E6^-6'
'5B3B776267AC08^-6'
'-3FEE0F161545E4^-6'
'5B3B776267AC04^-6'
'-1C2D1E91BE13FC^-7'
'4ABD888D8789^-2'
'-284742EADDA96E^-2'
'-278760C1D880EA^-1'
'-FFFCE4A3675138^0'
'-3C75E8B987677C^-6'
'5F917262E098F8^-6'
'-1D83FC9C063FBE^-7'
'4ABD888D50269^-2'
'-284742D57345C6^-2'
'-278760C0E07192^-1'
'-FFFCE4A3677AF8^0'
'-3C76115ED3C254^-6'
'5F913F96AD8054^-6'
'-1D83ECEB17D24^-7'
'1021C7912B1^C'
'1021C79B94E3^C'
'1021C79B9469^C'
'1021C7912B1^C'
'1^1'
'2^1'
END_ARRAY 1 19
TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~
This CK is for testing with the image: /work/users/jmapel/M103595705LE.cub
This CK is for testing with the image: /home/pgiroux/Desktop/M103595705LE.cub
This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~
......@@ -6,35 +6,35 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 19
'LRO_LROCWAC DATA TYPE 3 '
'1021C7912B1^C'
'1021C79B94E3^C'
'1021C79B9469^C'
'-14E74'
'-14C08'
'3'
'1'
19
'FFFFFFFFDD124^0'
'-55C00A72539C3C^-4'
'-669E2602EFAE08^-4'
'-223143AB21DAC6^-8'
'-55C00A72539C44^-4'
'-669E2602EFAE0C^-4'
'-223144AB21DAC8^-8'
'-8E91400FCEC9B^-6'
'8820BB752205D^-6'
'511262E8673D38^-A'
'FFFFFFFFDCEC98^0'
'-5355B9C49A6914^-4'
'-68F2D8270BAED^-4'
'-2204A6C85DECAA^-8'
'-960E7D47153A58^-6'
'8EE5D15816B438^-6'
'52385BBA1D7A44^-A'
'511262E8673D34^-A'
'FFFFFFFFDCEC9^0'
'-5355D6109945BC^-4'
'-68F2BCD855CF14^-4'
'-2204A945BF1C6E^-8'
'-960E2589483EB^-6'
'8EE58207C6E1A8^-6'
'52384E4607121C^-A'
'1021C7912B1^C'
'1021C79B94E3^C'
'1021C79B9469^C'
'1021C7912B1^C'
'1^1'
'2^1'
END_ARRAY 1 19
TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~
This CK is for testing with the image: /work/users/jmapel/M103595705LE.cub
This CK is for testing with the image: /home/pgiroux/Desktop/M103595705LE.cub
This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~
......@@ -6,7 +6,7 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 1044
'LRO BODY ATTITUDE - SEGMENT '
'1021C5962FF4^C'
'1021C5A30A9D^C'
'1021C5A30A23^C'
'-14C08'
'1'
'3'
......@@ -14,8 +14,8 @@ BEGIN_ARRAY 1 1044
1024
'373EAF2ADAB8CE^0'
'F0256D5FCF0688^0'
'6E9333601A66CC^-1'
'45095C2056B89C^0'
'6E9333601A66BC^-1'
'45095C2056B898^0'
'7B3F4109DA19A8^-3'
'-304553D0379114^-2'
'-16792E806A6854^-2'
......@@ -915,13 +915,13 @@ BEGIN_ARRAY 1 1044
'89C8B52170C368^-3'
'-313792FB2A15B4^-2'
'-158EEA1152F467^-2'
'374638CD503EA6^0'
'EFC7502E17D4^0'
'69CE8054BB72^-1'
'464EEDD2AF19D^0'
'9BA57195676EB8^-3'
'-319004603226DE^-2'
'-144827624D72D2^-2'
'3746389804E9C2^0'
'EFC753B6157568^0'
'69CEADD0FA37FC^-1'
'464EE1AD2B3348^0'
'9B3F80295F36D8^-3'
'-318E0B9DB652C2^-2'
'-144F7043B25D0E^-2'
'1021C5962FF4^C'
'1021C5964208CA^C'
'1021C5965BA263^C'
......@@ -1052,7 +1052,7 @@ BEGIN_ARRAY 1 1044
'1021C5A2C20964^C'
'1021C5A2DBA2FE^C'
'1021C5A2F53C98^C'
'1021C5A30A9D^C'
'1021C5A30A23^C'
'1021C5A00E9403^C'
'1021C5962FF4^C'
'1^1'
......@@ -1060,7 +1060,7 @@ BEGIN_ARRAY 1 1044
END_ARRAY 1 1044
TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~
This CK is for testing with the image: /work/users/jmapel/M103595705LE.cub
This CK is for testing with the image: /home/pgiroux/Desktop/M103595705LE.cub
This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~
......@@ -6,19 +6,19 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 852
'LRO BODY ATTITUDE - SEGMENT '
'1021C7912B1^C'
'1021C79B94E3^C'
'1021C79B9469^C'
'-14C08'
'1'
'3'
'1'
852
'3773B7C00A0FA2^0'
'DC448FA261C3D8^0'
'-4DB3F3216695CC^-1'
'75FB33B5949FE8^0'
'DC448FA261C3D^0'
'-4DB3F3216695E4^-1'
'75FB33B5949FE4^0'
'906E0DFDD0265^-3'
'-33F70107C1A258^-2'
'-15F97D94F326B7^-2'
'-33F70107C1A256^-2'
'-15F97D94F326B8^-2'
'3773A8F10EB4C2^0'
'DC43651AEEF8B8^0'
'-4DBC4B01690C74^-1'
......@@ -747,13 +747,13 @@ BEGIN_ARRAY 1 852
'9BE4772F9F94F8^-3'
'-329F57ADAFA03^-2'
'-1528D96B6DED27^-2'
'376DFC306BD94A^0'
'DBBF156576DD68^0'
'-519EFFBAA464D8^-1'
'76F322F51EF3D^0'
'9A3F7448C719^-3'
'-3236D175681DA8^-2'
'-155B839F329554^-2'
'376DFC4C736F7^0'
'DBBF1B9AB01F4^0'
'-519ED302C86B58^-1'
'76F3178ED3D65^0'
'9A608F1CA248D8^-3'
'-323F0980122D42^-2'
'-155787C10CF4C^-2'
'1021C7912B1^C'
'1021C79141C5D3^C'
'1021C7915A1717^C'
......@@ -859,7 +859,7 @@ BEGIN_ARRAY 1 852
'1021C79B5BA043^C'
'1021C79B7539DD^C'
'1021C79B8ED376^C'
'1021C79B94E3^C'
'1021C79B9469^C'
'1021C79B0ED41F^C'
'1021C7912B1^C'
'1^1'
......@@ -867,7 +867,7 @@ BEGIN_ARRAY 1 852
END_ARRAY 1 852
TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~
This CK is for testing with the image: /work/users/jmapel/M103595705LE.cub
This CK is for testing with the image: /home/pgiroux/Desktop/M103595705LE.cub
This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~
KPL/FK
SPICE Lunar Reference Frame Specification Kernel
=====================================================================
Original file name: moon_080317.tf
Creation date: 2008 March 17 20:10
Created by: Nat Bachman (NAIF/JPL)
Date of last revision: 2008 March 21 16:07
Purpose of revision:
Changed names of PA system and frame from "principal axis" to
"principal axes."
Version description:
This frame kernel contains lunar frame specifications compatible
with the current lunar binary PCK file
moon_pa_de421_1900-2050.bpc
The above PCK contains lunar orientation data from the DE-421 JPL
Planetary Ephemeris.
The previous NAIF lunar frame specification kernel was
moon_071218.tf
That kernel is compatible with the DE-418-based lunar binary PCK
file
moon_pa_de418_1950-2050.bpc
The comment section below titled "Lunar body-fixed frame
associations" discusses lunar frame association kernels. These
kernels direct portions of the SPICE system that rely on default
body-fixed reference frames to associate with the Moon either the
MOON_ME or MOON_PA reference frames.
This file was modified on 26-FEB-2009 by Nat Bachman. The initial
blank line was removed and this change description was added.
Nothing else has been changed.
Frames Specified by this Kernel
=====================================================================
Frame Name Relative to Type Frame ID
-------------- ----------------- ----- --------
MOON_PA MOON_PA_DE421 FIXED 31000
MOON_ME MOON_ME_DE421 FIXED 31001
MOON_PA_DE421 ICRF/J2000 PCK 31006
MOON_ME_DE421 MOON_PA_DE421 FIXED 31007
Introduction
=====================================================================
This kernel specifies lunar body-fixed reference frames for use by
SPICE-based application software. These reference frames are
associated with high-accuracy lunar orientation data provided by the
JPL Solar System Dynamics Group's planetary ephemerides (both
trajectory and lunar orientation data are stored in these ephemeris
files). These ephemerides have names of the form DE-nnn (DE stands
for "developmental ephemeris").
The frames specified by this kernel are realizations of two different
lunar reference systems:
Principal Axes (PA) system
--------------------------
The axes of this system are defined by the principal axes of the
Moon. Due to the nature of the Moon's orbit and
rotation, the Z axis of this system does not coincide with the
Moon's mean spin axis, nor does the X axis coincide with the mean
direction to the center of the Earth (in contrast with the ME
system defined below).
Lunar principal axes frames realizing the lunar PA system and
specified by this kernel are associated with JPL planetary
ephemerides. Each new JPL planetary ephemeris can (but does not
necessarily) define a new realization of the lunar principal axes
system. Coordinates of lunar surface features expressed in lunar
PA frames can change slightly from one lunar ephemeris version to
the next.
Mean Earth/Polar Axis (ME) system
---------------------------------
The Lunar mean Earth/polar axis system is a lunar body-fixed
reference system used in the IAU/IAG Working Group Report [2] to
describe the orientation of the Moon relative to the ICRF frame.
The +Z axis of this system is aligned with the north mean lunar
rotation axis, while the prime meridian contains the the mean
Earth direction.
This system is also sometimes called the "mean Earth/mean
rotation axis" system or "mean Earth" system.
The mean directions used to define the axes of a mean Earth/polar
axis reference frame realizing the lunar ME system and specified
by this kernel are associated with a given JPL planetary
ephemeris version. The rotation between the mean Earth frame for
a given ephemeris version and the associated principal axes frame
is given by a constant matrix (see [1]).
For the current JPL planetary ephemeris (DE), this kernel includes
specifications of the corresponding principal axes and mean Earth/
polar axis frames. The names of these frames have the form
MOON_PA_DEnnn
and
MOON_ME_DEnnn
respectively, where nnn is the version number of the DE. The set of
DE-dependent frame specifications will grow over time; frame
specifications pertaining to older DEs can be obtained from earlier
versions of this frame kernel.
For each of the two reference systems, there is a corresponding
"generic" frame specification: these generic frames are simply
aliases for the PA and ME frames associated with the latest DE. The
generic frame names are
MOON_PA
MOON_ME
These generic frame names are provided to enable SPICE-based
applications to refer to the latest DE-based (or other) lunar
rotation data without requiring code modifications as new kernels
become available. SPICE users may, if they wish, modify this kernel
to assign these frame aliases to other frames than those selected
here, for example, older DE-based frames. NAIF recommends that, if
this frame kernel is modified, the name of this file also be changed
to avoid confusion.
Comparison of PA and ME frames
------------------------------
The rotation between the mean Earth frame for a given DE and the
associated principal axes frame for the same DE is given by a
constant matrix (see [1]). For DE-421, the rotation angle of this
matrix is approximately 0.0288473 degrees; this is equivalent to
approximately 875 m when expressed as a displacement along a great
circle on the Moon's surface.
Comparison of DE-based and IAU/IAG report-based ME frames
---------------------------------------------------------
Within the SPICE system, a lunar ME frame specified by the
rotational elements from the IAU/IAG Working Group report [2] is
given the name IAU_MOON; the data defining this frame are provided
in a generic text PCK.
The orientation of the lunar ME frame obtained by applying the
DE-based PA-to-ME rotation described above to the DE-based lunar
libration data does not agree closely with the lunar ME frame
orientation given by the rotational elements from the IAU/IAG
Working Group report (that is, the IAU_MOON frame). The difference
is due to truncation of the libration series used in the report's
formula for lunar orientation (see [1]).
In the case of DE-421, for the time period ~2000-2020, the
time-dependent difference of these ME frame implementations has an
amplitude of approximately 0.0051 degrees, which is equivalent to
approximately 155 m, measured along a great circle on the Moon's
surface, while the average value is approximately 0.00249 degrees,
or 76 m.
Comparison of DE-421 and DE-418 Lunar Reference Frames
======================================================
The magnitudes of the rotational offsets between the
DE-418 and DE-421 realizations of the MOON_PA and MOON_ME
frames are discussed below.
Note that the angle ranges shown below are ordered as signed values,
*not* by absolute value.
MOON_PA frame orientation differences
-------------------------------------
Tests performed by NAIF indicate an approximately 0.45 microradian
maximum rotation between the MOON_PA_DE418 and MOON_PA_DE421 frames,
based on a sampling of orientation data over the time period
2000-2020. This offset corresponds to a displacement of about 0.79 m
along a great circle on the Moon's surface.
When the transformation from the MOON_PA_DE418 frame to the
MOON_PA_DE421 frame is decomposed as a 1-2-3 Euler angle sequence,
the offset angle ranges for each axis are:
X axis: -3.8063e-07 to -2.9746e-07 radians
Y axis: -2.5322e-07 to -1.8399e-07 radians
Z axis: -9.9373e-08 to 6.0046e-08 radians
MOON_ME frame orientation differences
-------------------------------------
Tests performed by NAIF indicate an approximately 0.27 microradian
maximum rotation between the MOON_ME_DE418 and MOON_ME_DE421 frames,
based on a sampling of orientation data over the time period
2000-2020. This offset corresponds to a displacement of about 0.46 m
along a great circle on the Moon's surface.
When the transformation from the MOON_ME_DE418 frame to the
MOON_ME_DE421 frame is decomposed as a 1-2-3 Euler angle sequence,
the offset angle ranges for each axis are:
X axis: 7.2260e-09 to 9.0391e-08 radians
Y axis: 3.7643e-08 to 1.0691e-07 radians
Z axis: -2.4471e-07 to -8.5296e-08 radians
Regarding Use of the ICRF in SPICE
==================================
The IERS Celestial Reference Frame (ICRF) is offset from the J2000
reference frame (equivalent to EME 2000) by a small rotation: the
J2000 pole offset magnitude is about 18 milliarcseconds (mas) and
the equinox offset magnitude is approximately 78 milliarcseconds
(see [3]).
Certain SPICE data products use the frame label "J2000" for data
that actually are referenced to the ICRF. This is the case for SPK
files containing JPL version DE-4nn planetary ephemerides, for
orientation data from generic text PCKs, and for binary PCKs,
including binary lunar PCKs used in conjunction with this lunar
frame kernel.
Consequently, when SPICE computes the rotation between the "J2000"
frame and either of the lunar PA or ME frames, what's computed is
actually the rotation between the ICRF and the respective lunar
frame.
Similarly, when SPICE is used to compute the state given by a JPL DE
planetary ephemeris SPK file of one ephemeris object relative to
another (for example, the state of the Moon with respect to the
Earth), expressed relative to the frame "J2000," the state is
actually expressed relative to the ICRF.
Because SPICE is already using the ICRF, users normally need not
use the J2000-to-ICRF transformation to adjust results computed
with SPICE.
Lunar body-fixed frame associations
=====================================================================
By default, the SPICE system considers the body-fixed reference
frame associated with the Moon to be the one named IAU_MOON. This
body-frame association affects the outputs of the SPICE frame system
routines
CIDFRM
CNMFRM
and of the SPICE time conversion and geometry routines
ET2LST
ILLUM
SRFXPT
SUBPT
SUBSOL
Also, any code that calls these routines to obtain results involving
lunar body-fixed frames are affected. Within SPICE, the only
higher-level system that is affected is the dynamic frame system.
NAIF provides "frame association" kernels that simplify changing the
body-fixed frame associated with the Moon. Using FURNSH to load
either of the kernels named below changes the Moon's body-fixed
frame from its current value, which initially is IAU_MOON, to that
shown in the right-hand column:
Kernel name Lunar body-fixed frame
----------- ----------------------
moon_assoc_me.tf MOON_ME
moon_assoc_pa.tf MOON_PA
For further information see the in-line comments in the association
kernels themselves. Also see the Frames Required Reading section
titled "Connecting an Object to its Body-fixed Frame."
In the N0062 SPICE Toolkit, the routines
ILLUM
SRFXPT
SUBPT
SUBSOL
are superseded, respectively, by the routines
ILUMIN
SINCPT
SUBPNT
SUBSLR
The newer routines don't require frame association kernels: the name
of the target body's body-fixed reference frame is an input argument
to these routines.
Using this Kernel
=====================================================================
In order for a SPICE-based application to use reference frames
specified by this kernel, the application must load both this kernel
and a binary lunar PCK containing lunar orientation data for the
time of interest. Normally the kernels need be loaded only once
during program initialization.
SPICE users may find it convenient to use a meta-kernel (also called
a "FURNSH kernel") to name the kernels to be loaded. Below, we show
an example of such a meta-kernel, as well as the source code of a
small Fortran program that uses lunar body fixed frames. The
program's output is included as well.
The kernel names shown here are simply used as examples; users must
select the kernels appropriate for their applications.
Numeric results shown below may differ very slightly from those
obtained on users' computer systems.
Meta-kernel
-----------
KPL/MK
Example meta-kernel showing use of
- binary lunar PCK
- generic lunar frame kernel (FK)
- leapseconds kernel (LSK)
- planetary SPK
17-MAR-2008 (NJB)
Note: to actually use this kernel, replace the @ characters
below with backslashes (\). The backslash character cannot be
used here, within the comments of this frame kernel, because the
begindata and begintext strings would be interpreted as
directives bracketing actual load commands.
This meta-kernel assumes that the referenced kernels exist
in the user's current working directory.
@begindata
KERNELS_TO_LOAD = ( 'moon_pa_de421_1900-2050.bpc'
'moon_080317.tf'
'leapseconds.ker'
'de421.bsp' )
@begintext
Example program
---------------
PROGRAM EX1
IMPLICIT NONE
INTEGER FILSIZ
PARAMETER ( FILSIZ = 255 )
CHARACTER*(FILSIZ) META
DOUBLE PRECISION ET
DOUBLE PRECISION LT
DOUBLE PRECISION STME ( 6 )
DOUBLE PRECISION STPA ( 6 )
C
C Prompt user for meta-kernel name.
C
CALL PROMPT ( 'Enter name of meta-kernel > ', META )
C
C Load lunar PCK, generic lunar frame kernel,
C leapseconds kernel, and planetary ephemeris
C via metakernel.
C
CALL FURNSH ( META )
C
C Convert a time of interest from UTC to ET.
C
CALL STR2ET ( '2008 MAR 17 20:10:00', ET )
WRITE (*,*) 'ET (sec past J2000 TDB): ', ET
WRITE (*,*) ' State of Earth relative to Moon'
C
C Find the geometric state of the Earth relative to the
C Moon at ET, expressed relative to the ME frame.
C
CALL SPKEZR ( 'Earth', ET, 'MOON_ME',
. 'NONE', 'Moon', STME, LT )
WRITE (*,*) ' In MOON_ME frame:'
WRITE (*,*) STME
C
C Find the geometric state of the Earth relative to the
C Moon at ET, expressed relative to the PA frame.
C
CALL SPKEZR ( 'Earth', ET, 'MOON_PA',
. 'NONE', 'Moon', STPA, LT )
WRITE (*,*) ' In MOON_PA frame:'
WRITE (*,*) STPA
END
Program output
--------------
Enter name of meta-kernel > meta
ET (sec past J2000 TDB): 259056665.
State of Earth relative to Moon
In MOON_ME frame:
379892.825 33510.118 -12661.5278 0.0400357582 0.0117963334 0.115130508
In MOON_PA frame:
379908.634 33385.003 -12516.8859 0.0399957879 0.0117833314 0.115145731
References
=====================================================================
[1] J.G. Williams, D.H. Boggs and W.M. Folkner. "DE421 Lunar
Orbit, Physical Librations, and Surface Coordinates,"
preprint of JPL IOM 335-JW,DB,WF-20080314-001, dated
March 14, 2008.
[2] Seidelmann, P.K., Abalakin, V.K., Bursa, M., Davies, M.E.,
Bergh, C. de, Lieske, J.H., Oberst, J., Simon, J.L., Standish,
E.M., Stooke, P., and Thomas, P.C. (2002). "Report of the
IAU/IAG Working Group on Cartographic Coordinates and Rotational
Elements of the Planets and Satellites: 2000," Celestial
Mechanics and Dynamical Astronomy, v.82, Issue 1, pp. 83-111.
[3] Roncoli, R. (2005). "Lunar Constants and Models Document,"
JPL D-32296.
Frame Specifications
=====================================================================
MOON_PA is the name of the generic lunar principal axes (PA) reference
frame. This frame is an alias for the principal axes frame defined
by the latest version of the JPL Solar System Dynamics Group's
planetary ephemeris.
In this instance of the lunar reference frames kernel, MOON_PA is an
alias for the lunar principal axes frame associated with the
planetary ephemeris DE-421.
\begindata
FRAME_MOON_PA = 31000
FRAME_31000_NAME = 'MOON_PA'
FRAME_31000_CLASS = 4
FRAME_31000_CLASS_ID = 31000
FRAME_31000_CENTER = 301
TKFRAME_31000_SPEC = 'MATRIX'
TKFRAME_31000_RELATIVE = 'MOON_PA_DE421'
TKFRAME_31000_MATRIX = ( 1 0 0
0 1 0
0 0 1 )
\begintext
MOON_ME is the name of the generic lunar mean Earth/polar axis (ME)
reference frame. This frame is an alias for the mean Earth/polar
axis frame defined by the latest version of the JPL Solar System
Dynamics Group's planetary ephemeris.
In this instance of the lunar reference frames kernel, MOON_ME is an
alias for the lunar mean Earth/polar axis frame associated with the
planetary ephemeris DE-421.
\begindata
FRAME_MOON_ME = 31001
FRAME_31001_NAME = 'MOON_ME'
FRAME_31001_CLASS = 4
FRAME_31001_CLASS_ID = 31001
FRAME_31001_CENTER = 301
TKFRAME_31001_SPEC = 'MATRIX'
TKFRAME_31001_RELATIVE = 'MOON_ME_DE421'
TKFRAME_31001_MATRIX = ( 1 0 0
0 1 0
0 0 1 )
\begintext
MOON_PA_DE421 is the name of the lunar principal axes
reference frame defined by JPL's DE-421 planetary ephemeris.
\begindata
FRAME_MOON_PA_DE421 = 31006
FRAME_31006_NAME = 'MOON_PA_DE421'
FRAME_31006_CLASS = 2
FRAME_31006_CLASS_ID = 31006
FRAME_31006_CENTER = 301
\begintext
MOON_ME_DE421 is the name of the lunar mean Earth/polar
axis reference frame defined by JPL's DE-421 planetary ephemeris.
Rotation angles are from reference [1].
\begindata
FRAME_MOON_ME_DE421 = 31007
FRAME_31007_NAME = 'MOON_ME_DE421'
FRAME_31007_CLASS = 4
FRAME_31007_CLASS_ID = 31007
FRAME_31007_CENTER = 301
TKFRAME_31007_SPEC = 'ANGLES'
TKFRAME_31007_RELATIVE = 'MOON_PA_DE421'
TKFRAME_31007_ANGLES = ( 67.92 78.56 0.30 )
TKFRAME_31007_AXES = ( 3, 2, 1 )
TKFRAME_31007_UNITS = 'ARCSECONDS'
\begintext
Updating this Kernel
--------------------
When a new JPL DE providing lunar rotation data becomes available,
the new lunar PA frame associated with that data set will be named
MOON_PA_DEnnn
where nnn is the version number of the DE.
The PCK body ID code associated with that data set will be
31008
The frame ID and class ID for this frame will also be 31008.
The generic PA frame specification will be updated to point to the
new DE-specific PA frame. The rest of this frame specification
is unchanged.
The ME frame name associated with the new data set will be named
MOON_ME_DEnnn
The frame ID and class ID for this frame will be
31009
The rotational offset between this frame and the new DE-specific PA
frame will need to be updated; this offset is DE-dependent.
The generic ME frame specification will be updated to point to the
new DE-specific ME frame. The rest of this frame specification
is unchanged.
=====================================================================
End of kernel
KPL/FK
SPICE Lunar ME Reference Frame/Body Association Kernel
=====================================================================
Original file name: moon_assoc_me.tf
Creation date: 2007 February 13 17:24
Created by: Nat Bachman (NAIF/JPL)
Last updated: 2008 March 18 22:15
Purpose of update:
Documentation now refers to DE421 kernels. Deprecated SPICE
routines and their replacements are noted.
Overview
=====================================================================
In the SPICE system, the default body-fixed reference frame
associated with the Moon is named
IAU_MOON
The IAU_MOON reference frame is implemented via approximate formulas
provided by the IAU report [1] and is not suitable for high-accuracy
work.
This kernel directs the SPICE system to associate the lunar "mean
Earth" reference frame
MOON_ME
with the Moon.
When this kernel is loaded via FURNSH, the SPICE frame system
routines CNMFRM and CIDFRM, which identify the reference frame
associated with a specified body, will indicate that the MOON_ME
frame is associated with the Moon. In addition, higher-level SPICE
geometry routines that rely on the CNMFRM or CIDFRM routines will
use the MOON_ME frame where applicable. As of the release date of
this kernel, these SPICE routines are:
ET2LST
LSPCN
Any code that calls these routines to obtain results
involving lunar body-fixed frames are affected. Within SPICE, the
only higher-level system that is affected is the dynamic frame
system.
The deprecated (as of the N0062 SPICE Toolkit release) routines
ILLUM
SRFXPT
SUBPT
SUBSOL
also make use of this kernel; however NAIF recommends that
users instead call the following routines which, respectively,
supersede those listed above:
ILUMIN
SINCPT
SUBPNT
SUBSLR
The newer routines don't make use of frame association kernels;
these routines accept the name of the target body-fixed
frame as an input argument.
Note: to direct SPICE to associate the lunar principal axis frame
MOON_PA
with the Moon, load the kernel
moon_assoc_pa.tf
rather than this one.
Using this kernel
=====================================================================
This kernel must be loaded together with a lunar frame specification
kernel and a binary lunar PCK. Below an example meta-kernel that
loads these files and a small program illustrating use of the
meta-kernel are shown. The names of the kernels used here are
current as of the release date of this kernel, but should not be
assumed to be current at later dates.
Example meta-kernel
-------------------
To use the meta-kernel shown below, the '@' characters must be
replaced with backslash '\' characters. Backslashes cannot be
used in this comment block because they would confuse the SPICE
text kernel parser.
KPL/FK
@begintext
Kernels to load are:
Lunar kernels
-------------
Binary lunar PCK: moon_pa_de421_1900-2050.bpc
Lunar FK: moon_080317.tf
Frame association kernel: moon_assoc_me.tf
Additional kernels to support sub-point computation
---------------------------------------------------
Text PCK for lunar radii: pck00008.tpc
Leapseconds kernel (for
time conversion): naif0008.tls
Planetary ephemeris (for
sub-Earth computation): de421.bsp
@begindata
KERNELS_TO_LOAD = ( 'moon_pa_de421_1900-2050.bpc'
'moon_080317.tf'
'moon_assoc_me.tf'
'pck00008.tpc'
'naif0008.tls'
'de421.bsp' )
@begintext
End of kernel
Example code
------------
Find the geometric (without light time and stellar aberration
corrections) sub-Earth point on the Moon at a given UTC time,
using the MOON_ME reference frame. Display the name of the
body-fixed lunar frame used for the computation.
PROGRAM EX
IMPLICIT NONE
DOUBLE PRECISION DPR
INTEGER FILEN
PARAMETER ( FILEN = 255 )
INTEGER FRNMLN
PARAMETER ( FRNMLN = 32 )
INTEGER TIMLEN
PARAMETER ( TIMLEN = 50 )
CHARACTER*(FRNMLN) FRNAME
CHARACTER*(FILEN) META
CHARACTER*(TIMLEN) TIMSTR
DOUBLE PRECISION ALT
DOUBLE PRECISION ET
DOUBLE PRECISION LAT
DOUBLE PRECISION LON
DOUBLE PRECISION RADIUS
DOUBLE PRECISION SPOINT ( 3 )
INTEGER FRCODE
LOGICAL FOUND
C
C Obtain name of meta-kernel; load kernel.
C
CALL PROMPT ( 'Enter meta-kernel name > ', META )
CALL FURNSH ( META )
C
C Obtain input time and convert to seconds past J2000 TDB.
C
CALL PROMPT ( 'Enter observation time > ', TIMSTR )
CALL STR2ET ( TIMSTR, ET )
C
C Find the closest point on the Moon to the center
C of the Earth at ET.
C
CALL SUBPT ( 'Near point', 'MOON', ET, 'NONE',
. 'EARTH', SPOINT, ALT )
.
C
C Express the sub-observer point in latitudinal
C coordinates.
C
CALL RECLAT ( SPOINT, RADIUS, LON, LAT )
C
C Look up the name of the lunar body-fixed frame.
C
CALL CNMFRM ( 'MOON', FRCODE, FRNAME, FOUND )
C
C Always check the "found" flag. Signal an error if we
C don't find a frame name.
C
IF ( .NOT. FOUND ) THEN
CALL SETMSG ( 'No body-fixed frame found for the Moon.' )
CALL SIGERR ( 'SPICE(NOFRAME)' )
END IF
WRITE(*,*) 'Lunar body-fixed frame is ', FRNAME
WRITE(*,*) 'Sub-Earth planetocentric longitude (deg):',
. LON*DPR()
WRITE(*,*) 'Sub-Earth planetocentric latitude (deg):',
. LAT*DPR()
END
Example program output
----------------------
Numeric results and output formatting shown below should be
expected to differ somewhat across different computing platforms.
When the above example program is run using the example meta-kernel,
and the (arbitrary) date 2008 Mar 18 00:00:00 UTC is used
as the observation time, the output will be:
Lunar body-fixed frame is MOON_ME
Sub-Earth planetocentric longitude (deg): 5.05523767
Sub-Earth planetocentric latitude (deg): -1.65932776
References
=====================================================================
[1] Seidelmann, P.K., Abalakin, V.K., Bursa, M., Davies, M.E.,
Bergh, C. de, Lieske, J.H., Oberst, J., Simon, J.L.,
Standish, E.M., Stooke, P., and Thomas, P.C. (2002).
"Report of the IAU/IAG Working Group on Cartographic
Coordinates and Rotational Elements of the Planets and
Satellites: 2000," Celestial Mechanics and Dynamical
Astronomy, v.82, Issue 1, pp. 83-111.
Data
=====================================================================
The assignment below directs the SPICE system to associate the MOON_ME
reference frame with the Moon.
For further information, see the Frames Required Reading section
titled "Connecting an Object to its Body-fixed Frame."
\begindata
OBJECT_MOON_FRAME = 'MOON_ME'
\begintext
End of kernel
=====================================================================
Source diff could not be displayed: it is too large. Options to address this: view the blob.
import pytest
import numpy as np
import os
import unittest
from unittest.mock import PropertyMock, patch
import spiceypy as spice
import json
import ale
from ale import util
from ale.drivers import lro_drivers
from ale.drivers.lro_drivers import LroLrocPds3LabelNaifSpiceDriver
from ale.drivers.lro_drivers import LroLrocIsisLabelNaifSpiceDriver
from conftest import get_image_label, get_image_kernels, convert_kernels, compare_dicts
@pytest.fixture()
image_dict = {
'M103595705LE': {
'isis': {
"CameraVersion": 2,
"NaifKeywords": {
"BODY301_RADII": [ 1737.4, 1737.4, 1737.4 ],
"BODY_FRAME_CODE": 31001,
"BODY_CODE": 301,
"INS-85600_MULTIPLI_LINE_ERROR": 0.0045,
"INS-85600_CK_FRAME_ID": -85000,
"TKFRAME_-85600_RELATIVE": "LRO_SC_BUS",
"INS-85600_PIXEL_SAMPLES": 5064,
"INS-85600_WAVELENGTH_RANGE": [ 400, 760 ],
"INS-85600_ITRANSL": [ 0, 142.857, 0 ],
"INS-85600_TRANSX": [ 0, 0, 0.007 ],
"INS-85600_SWAP_OBSERVER_TARGET": "TRUE",
"INS-85600_TRANSY": [ 0, 0.007, 0 ],
"INS-85600_ITRANSS": [ 0, 0, 142.857 ],
"INS-85600_LIGHTTIME_CORRECTION": "NONE",
"INS-85600_ADDITIVE_LINE_ERROR": 0,
"INS-85600_FOV_BOUNDARY_CORNERS": [
0.0000049738,
-0.025335999999999997,
1,
0.0000049747,
-0.024943,
1,
0.0000050026999999999996,
0,
1,
0.000004975
],
"FRAME_-85600_NAME": "LRO_LROCNACL",
"CK_-85600_SPK": -85,
"INS-85600_CONSTANT_TIME_OFFSET": 0,
"CK_-85600_SCLK": -85,
"INS-85600_PIXEL_LINES": 1,
"INS-85600_BORESIGHT": [ 0, 0, 1 ],
"INS-85600_PLATFORM_ID": -85000,
"INS-85600_BORESIGHT_LINE": 0,
"FRAME_-85600_CLASS": 3,
"INS-85600_FOCAL_LENGTH": 699.62,
"INS-85600_F/RATIO": 3.577,
"INS-85600_OD_K": 0.0000181,
"INS-85600_FOV_SHAPE": "POLYGON",
"INS-85600_PIXEL_SIZE": [ 0.007, 0.007 ],
"INS-85600_BORESIGHT_SAMPLE": 2548,
"INS-85600_PIXEL_PITCH": 0.007,
"INS-85600_ADDITIONAL_PREROLL": 1024,
"INS-85600_CK_REFERENCE_ID": 1,
"INS-85600_LT_SURFACE_CORRECT": "TRUE",
"INS-85600_FOV_FRAME": "LRO_LROCNACL",
"FRAME_-85600_CLASS_ID": -85600,
"INS-85600_IFOV": 0.000010005399999999999,
"FRAME_-85600_CENTER": -85,
"INS-85600_CCD_CENTER": [ 2532.5, 1 ],
"BODY301_POLE_RA": [ 269.9949, 0.0031, 0 ],
"BODY301_NUT_PREC_PM": [ 3.561, 0.1208, -0.0642, 0.0158, 0.0252, -0.0066, -0.0047, -0.0046, 0.0028, 0.0052 ],
"BODY301_NUT_PREC_RA": [ -3.8787000000000003, -0.1204, 0.07, -0.0172, 0, 0.0072, 0, 0, 0, -0.0052 ],
"BODY301_LONG_AXIS": 0,
"BODY301_NUT_PREC_DEC": [ 1.5419, 0.0239, -0.0278, 0.0068, 0, -0.0029, 0.0009, 0, 0, 0.0008 ],
"BODY301_POLE_DEC": [ 66.5392, 0.013, 0 ],
"BODY301_PM": [ 38.3213, 13.17635815, -1.3999999999999999e-12 ]
},
"InstrumentPointing": {
"TimeDependentFrames": [ -85600, -85000, 1 ],
"CkTableStartTime": 302228504.36824864,
"CkTableEndTime": 302228504.7816205,
"CkTableOriginalSize": 6,
"EphemerisTimes": [
302228504.36824864,
302228504.450923,
302228504.5335974,
302228504.61627173,
302228504.6989461,
302228504.7816205
],
"Quaternions": [
[ 0.22984449090659237, 0.8562360121526155, -0.014576324183122052, 0.4624055928145594 ],
[ 0.22984459963498413, 0.8562197280950775, -0.014583335437683352, 0.4624354696246142 ],
[ 0.22984367991941132, 0.8562032842671137, -0.014590196641096627, 0.4624661554895512 ],
[ 0.2298423219602694, 0.8561872277925395, -0.01459745672913303, 0.46249632675068797 ],
[ 0.2298413596492449, 0.8561711699907094, -0.014604593844944487, 0.4625263051005321 ],
[ 0.22984081705372042, 0.8561549931881817, -0.014611505650658618, 0.4625562996626938 ]
],
"AngularVelocity": [
[ 0.00015796288676771882, -0.0007643782570599635, -0.0003174531428220953 ],
[ 0.00015631294459532674, -0.0007657803825957866, -0.0003184081089449395 ],
[ 0.00013745925497849103, -0.0007797744104491687, -0.00032988161600413016 ],
[ 0.00013211442776748356, -0.0007623315159936997, -0.00033874000799855454 ],
[ 0.00014047395809259157, -0.0007614279586831931, -0.0003284683667926366 ],
[ 0.0001443115614238801, -0.0007630657146284228, -0.00032321391571062645 ]
],
"ConstantFrames": [ -85600 ],
"ConstantRotation": [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ]
},
"BodyRotation": {
"TimeDependentFrames": [ 31006, 1 ],
"CkTableStartTime": 302228504.36824864,
"CkTableEndTime": 302228504.7816205,
"CkTableOriginalSize": 6,
"EphemerisTimes": [
302228504.36824864,
302228504.450923,
302228504.5335974,
302228504.61627173,
302228504.6989461,
302228504.7816205
],
"Quaternions": [
[ -0.8896294526439446, 0.18337484217069425, -0.07150784453785884, 0.41209189802380003 ],
[ -0.8896294073127606, 0.1833748342493258, -0.07150786471014642, 0.41209199590986223 ],
[ -0.889629361981566, 0.18337482632795524, -0.07150788488243316, 0.41209209379591966 ],
[ -0.8896293166503605, 0.18337481840658243, -0.07150790505471902, 0.41209219168197186 ],
[ -0.8896292713191442, 0.18337481048520735, -0.071507925227004, 0.4120922895680191 ],
[ -0.8896292259879173, 0.18337480256383012, -0.0715079453992881, 0.41209238745406124 ]
],
"AngularVelocity": [
[ 6.23828510009553e-8, -0.0000010257490014652093, 0.000002455354036200098 ],
[ 6.238285108687342e-8, -0.0000010257490015380855, 0.0000024553540362115642 ],
[ 6.238285117279176e-8, -0.000001025749001610962, 0.0000024553540362230297 ],
[ 6.238285125870996e-8, -0.0000010257490016838385, 0.000002455354036234496 ],
[ 6.2382851344628e-8, -0.0000010257490017567146, 0.0000024553540362459614 ],
[ 6.238285143054625e-8, -0.0000010257490018295912, 0.0000024553540362574277 ]
],
"ConstantFrames": [ 31001, 31007, 31006 ],
"ConstantRotation": [
0.9999998732547144,
-0.00032928542237557133,
0.00038086961867138755,
0.00032928600021094723,
0.9999999457843062,
-0.0000014544409378362713,
-0.00038086911909607826,
0.0000015798557868269087,
0.9999999274681067
]
},
"InstrumentPosition": {
"SpkTableStartTime": 302228504.36824864,
"SpkTableEndTime": 302228504.7816205,
"SpkTableOriginalSize": 6,
"EphemerisTimes": [
302228504.36824864,
302228504.450923,
302228504.5335974,
302228504.61627173,
302228504.6989461,
302228504.7816205
],
"Positions": [
[ -1516.151401156933, -668.6288568627692, 902.0947198613901 ],
[ -1516.223409461061, -668.5964957526799, 901.9888699314455 ],
[ -1516.2954102001283, -668.5641313047068, 901.8830154985509 ],
[ -1516.3674033217933, -668.5317635424859, 901.7771566394573 ],
[ -1516.4393889295134, -668.4993924191643, 901.6712932021625 ],
[ -1516.511366970942, -668.4670179583775, 901.5654252634131 ]
],
"Velocities": [
[ -0.8710326332082557, 0.39140831001748183, -1.2802959403961716 ],
[ -0.870941131400504, 0.3914486847034966, -1.280350409495549 ],
[ -0.870849624629936, 0.39148905771548614, -1.280404872563503 ],
[ -0.8707581129628269, 0.3915294290241222, -1.2804593295603206 ],
[ -0.8706665962676469, 0.39156979868758957, -1.2805137805641233 ],
[ -0.8705750746107267, 0.3916101666764657, -1.2805682255353403 ]
]
},
"SunPosition": {
"SpkTableStartTime": 302228504.5749346,
"SpkTableEndTime": 302228504.5749346,
"SpkTableOriginalSize": 1,
"EphemerisTimes": [ 302228504.5749346 ],
"Positions": [ [ -91883378.263122, 111069433.8370443, 48184018.936351 ] ],
"Velocities": [ [ -23.97818344566901, -15.922784266924515, -6.938247041660347 ] ]
}
}
}
}
@pytest.fixture(scope="module")
def test_kernels():
kernels = get_image_kernels('M103595705LE')
updated_kernels, binary_kernels = convert_kernels(kernels)
updated_kernels = {}
binary_kernels = {}
for image in image_dict.keys():
kernels = get_image_kernels(image)
updated_kernels[image], binary_kernels[image] = convert_kernels(kernels)
yield updated_kernels
for kern in binary_kernels:
for kern_list in binary_kernels.values():
for kern in kern_list:
os.remove(kern)
@pytest.fixture(params=["Pds3NaifDriver"])
......@@ -135,8 +321,78 @@ def test_exposure_duration(driver):
exposure_duration.return_value = 1
assert driver.exposure_duration == 1.0045
def test_load(test_kernels, usgscsm_comparison_isd):
label_file = get_image_label('M103595705LE')
usgscsm_isd = ale.load(label_file, props={'kernels': test_kernels}, formatter='usgscsm')
print(usgscsm_isd)
assert compare_dicts(usgscsm_isd, usgscsm_comparison_isd) == []
@pytest.mark.parametrize("label_type", ['isis3'])
@pytest.mark.parametrize("formatter", ['isis'])
@pytest.mark.parametrize("image", image_dict.keys())
def test_load_isis(test_kernels, label_type, formatter, image):
label_file = get_image_label(image, label_type)
isis_isd = ale.loads(label_file, props={'kernels': test_kernels[image]}, formatter=formatter, verbose=True)
isis_isd_obj = json.loads(isis_isd)
print(json.dumps(isis_isd_obj, indent=4))
assert compare_dicts(isis_isd_obj, image_dict[image][formatter]) == []
# ========= Test isislabel and naifspice driver =========
class test_isis_naif(unittest.TestCase):
def setUp(self):
label = get_image_label('M103595705LE', 'isis3')
self.driver = LroLrocIsisLabelNaifSpiceDriver(label)
def test_short_mission_name(self):
assert self.driver.short_mission_name == 'lro'
def test_intrument_id(self):
assert self.driver.instrument_id == 'LRO_LROCNACL'
def test_usgscsm_distortion_model(self):
with patch('ale.drivers.lro_drivers.spice.gdpool', return_value=np.array([1.0])) as gdpool, \
patch('ale.drivers.lro_drivers.spice.bods2c', return_value=-12345) as bods2c:
distortion_model = self.driver.usgscsm_distortion_model
assert distortion_model['lrolrocnac']['coefficients'] == [1.0]
gdpool.assert_called_with('INS-12345_OD_K', 0, 1)
bods2c.assert_called_with('LRO_LROCNACL')
def test_odtk(self):
with patch('ale.drivers.lro_drivers.spice.gdpool', return_value=np.array([1.0])) as gdpool, \
patch('ale.drivers.lro_drivers.spice.bods2c', return_value=-12345) as bods2c:
assert self.driver.odtk == [1.0]
gdpool.assert_called_with('INS-12345_OD_K', 0, 1)
bods2c.assert_called_with('LRO_LROCNACL')
def test_light_time_correction(self):
assert self.driver.light_time_correction == 'NONE'
def test_detector_center_sample(self):
with patch('ale.drivers.lro_drivers.spice.gdpool', return_value=np.array([1.0])) as gdpool, \
patch('ale.drivers.lro_drivers.spice.bods2c', return_value=-12345) as bods2c:
assert self.driver.detector_center_sample == 0.5
gdpool.assert_called_with('INS-12345_BORESIGHT_SAMPLE', 0, 1)
bods2c.assert_called_with('LRO_LROCNACL')
def test_exposure_duration(self):
np.testing.assert_almost_equal(self.driver.exposure_duration, .0010334296)
def test_ephemeris_start_time(self):
with patch('ale.drivers.lro_drivers.spice.scs2e', return_value=321) as scs2e:
np.testing.assert_almost_equal(self.driver.ephemeris_start_time, 322.05823191)
scs2e.assert_called_with(-85, '1/270649237:07208')
def test_multiplicative_line_error(self):
assert self.driver.multiplicative_line_error == 0.0045
def test_additive_line_error(self):
assert self.driver.additive_line_error == 0
def test_constant_time_offset(self):
assert self.driver.constant_time_offset == 0
def test_additional_preroll(self):
assert self.driver.additional_preroll == 1024
def test_sampling_factor(self):
assert self.driver.sampling_factor == 1
def test_target_frame_id(self):
with patch('ale.drivers.lro_drivers.spice.gdpool', return_value=-12345) as gdpool:
assert self.driver.target_frame_id == -12345
gdpool.assert_called_with('FRAME_MOON_ME',0,1)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment