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
Branches
Tags
No related merge requests found
Showing
with 245147 additions and 137 deletions
...@@ -8,6 +8,7 @@ from ale.util import get_metakernels ...@@ -8,6 +8,7 @@ from ale.util import get_metakernels
from ale.base import Driver from ale.base import Driver
from ale.base.data_naif import NaifSpice from ale.base.data_naif import NaifSpice
from ale.base.label_pds3 import Pds3Label from ale.base.label_pds3 import Pds3Label
from ale.base.label_isis import IsisLabel
from ale.base.type_sensor import LineScanner from ale.base.type_sensor import LineScanner
...@@ -220,3 +221,202 @@ class LroLrocPds3LabelNaifSpiceDriver(LineScanner, NaifSpice, Pds3Label, Driver) ...@@ -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 Number of samples and lines combined from the original data to produce a single pixel in this image
""" """
return self.crosstrack_summing 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 ...@@ -6,7 +6,7 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 44 BEGIN_ARRAY 1 44
'SPK_STATES_13 ' 'SPK_STATES_13 '
'1203A21863267E^8' '1203A21863267E^8'
'1203A2253DC63C^8' '1203A2253D432A^8'
'-55' '-55'
'12D' '12D'
'1' '1'
...@@ -60,7 +60,7 @@ END_ARRAY 1 44 ...@@ -60,7 +60,7 @@ END_ARRAY 1 44
BEGIN_ARRAY 2 45 BEGIN_ARRAY 2 45
'DE-0421LE-0421 ' 'DE-0421LE-0421 '
'1203A21863267E^8' '1203A21863267E^8'
'1203A2253DC63C^8' '1203A2253D432A^8'
'12D' '12D'
'3' '3'
'1' '1'
...@@ -115,7 +115,7 @@ END_ARRAY 2 45 ...@@ -115,7 +115,7 @@ END_ARRAY 2 45
BEGIN_ARRAY 3 39 BEGIN_ARRAY 3 39
'DE-0421LE-0421 ' 'DE-0421LE-0421 '
'1203A21863267E^8' '1203A21863267E^8'
'1203A2253DC63C^8' '1203A2253D432A^8'
'A' 'A'
'0' '0'
'1' '1'
...@@ -164,7 +164,7 @@ END_ARRAY 3 39 ...@@ -164,7 +164,7 @@ END_ARRAY 3 39
BEGIN_ARRAY 4 45 BEGIN_ARRAY 4 45
'DE-0421LE-0421 ' 'DE-0421LE-0421 '
'1203A21863267E^8' '1203A21863267E^8'
'1203A2253DC63C^8' '1203A2253D432A^8'
'3' '3'
'0' '0'
'1' '1'
...@@ -218,25 +218,25 @@ BEGIN_ARRAY 4 45 ...@@ -218,25 +218,25 @@ BEGIN_ARRAY 4 45
END_ARRAY 4 45 END_ARRAY 4 45
TOTAL_ARRAYS 4 TOTAL_ARRAYS 4
~NAIF/SPC BEGIN COMMENTS~ ~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 ; BEGIN SPKMERGE COMMANDS
LEAPSECONDS_KERNEL = /usgs/cpkgs/isis3/data/base/kernels/lsk/naif0012.tls 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 SOURCE_SPK_KERNEL = /usgs/cpkgs/isis3/data/lro/kernels/spk/fdf29r_2009182_2009213_v01.bsp
INCLUDE_COMMENTS = NO INCLUDE_COMMENTS = NO
BODIES = -85 BODIES = -85
BEGIN_TIME = 2009 JUL 30 12:12:06.204 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 SOURCE_SPK_KERNEL = /usgs/cpkgs/isis3/data/lro/kernels/tspk/de421.bsp
INCLUDE_COMMENTS = NO INCLUDE_COMMENTS = NO
BODIES = 3, 10, 301 BODIES = 3, 10, 301
BEGIN_TIME = 2009 JUL 30 12:12:06.204 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 ; END SPKMERGE COMMANDS
~NAIF/SPC END COMMENTS~ ~NAIF/SPC END COMMENTS~
...@@ -6,7 +6,7 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE ...@@ -6,7 +6,7 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 44 BEGIN_ARRAY 1 44
'SPK_STATES_13 ' 'SPK_STATES_13 '
'1203A4135E494D^8' '1203A4135E494D^8'
'1203A41DC803AB^8' '1203A41DC78099^8'
'-55' '-55'
'12D' '12D'
'1' '1'
...@@ -60,7 +60,7 @@ END_ARRAY 1 44 ...@@ -60,7 +60,7 @@ END_ARRAY 1 44
BEGIN_ARRAY 2 45 BEGIN_ARRAY 2 45
'DE-0421LE-0421 ' 'DE-0421LE-0421 '
'1203A4135E494D^8' '1203A4135E494D^8'
'1203A41DC803AB^8' '1203A41DC78099^8'
'12D' '12D'
'3' '3'
'1' '1'
...@@ -115,7 +115,7 @@ END_ARRAY 2 45 ...@@ -115,7 +115,7 @@ END_ARRAY 2 45
BEGIN_ARRAY 3 39 BEGIN_ARRAY 3 39
'DE-0421LE-0421 ' 'DE-0421LE-0421 '
'1203A4135E494D^8' '1203A4135E494D^8'
'1203A41DC803AB^8' '1203A41DC78099^8'
'A' 'A'
'0' '0'
'1' '1'
...@@ -164,7 +164,7 @@ END_ARRAY 3 39 ...@@ -164,7 +164,7 @@ END_ARRAY 3 39
BEGIN_ARRAY 4 45 BEGIN_ARRAY 4 45
'DE-0421LE-0421 ' 'DE-0421LE-0421 '
'1203A4135E494D^8' '1203A4135E494D^8'
'1203A41DC803AB^8' '1203A41DC78099^8'
'3' '3'
'0' '0'
'1' '1'
...@@ -218,25 +218,25 @@ BEGIN_ARRAY 4 45 ...@@ -218,25 +218,25 @@ BEGIN_ARRAY 4 45
END_ARRAY 4 45 END_ARRAY 4 45
TOTAL_ARRAYS 4 TOTAL_ARRAYS 4
~NAIF/SPC BEGIN COMMENTS~ ~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 ; BEGIN SPKMERGE COMMANDS
LEAPSECONDS_KERNEL = /usgs/cpkgs/isis3/data/base/kernels/lsk/naif0012.tls 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 SOURCE_SPK_KERNEL = /usgs/cpkgs/isis3/data/lro/kernels/spk/fdf29r_2009182_2009213_v01.bsp
INCLUDE_COMMENTS = NO INCLUDE_COMMENTS = NO
BODIES = -85 BODIES = -85
BEGIN_TIME = 2009 JUL 30 12:20:33.185 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 SOURCE_SPK_KERNEL = /usgs/cpkgs/isis3/data/lro/kernels/tspk/de421.bsp
INCLUDE_COMMENTS = NO INCLUDE_COMMENTS = NO
BODIES = 3, 10, 301 BODIES = 3, 10, 301
BEGIN_TIME = 2009 JUL 30 12:20:33.185 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 ; END SPKMERGE COMMANDS
~NAIF/SPC END COMMENTS~ ~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
This diff is collapsed.
...@@ -6,35 +6,35 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE ...@@ -6,35 +6,35 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 19 BEGIN_ARRAY 1 19
'LRO_LROCNACL DATA TYPE 3 ' 'LRO_LROCNACL DATA TYPE 3 '
'1021C5962FF4^C' '1021C5962FF4^C'
'1021C5A30A9D^C' '1021C5A30A23^C'
'-14E60' '-14E60'
'-14C08' '-14C08'
'3' '3'
'1' '1'
19 19
'FFF91D64D19238^0' 'FFF91D64D19238^0'
'-3ABFADE78ED4EE^-1' '-3ABFADE78ED4F^-1'
'42A8C39E6613^-3' '42A8C39E66130C^-3'
'-893668BB093ED^-2' '-893668BB093EC^-2'
'34C15FCBF9D626^-6' '34C15FCBF9D626^-6'
'-38BAC10FCB0EF^-7' '-38BAC10FCB0EF^-7'
'-1A0BC4D9A9D106^-8' '-1A0BC4D9A9D106^-8'
'FFF91D6018BDB^0' 'FFF91D6018EA8^0'
'-3ABFC27A37375E^-1' '-3ABFC27973F4FA^-1'
'42A94F1BDFCF2^-3' '42A94F16B3E4BC^-3'
'-8936689831C63^-2' '-893668983310F^-2'
'37F79D727A8C^-6' '37F77EF68146EC^-6'
'-85C86A076739C^-7' '-85C58EB5195CB^-7'
'-3D6C5F78626F2A^-8' '-3D6B0FB3354448^-8'
'1021C5962FF4^C' '1021C5962FF4^C'
'1021C5A30A9D^C' '1021C5A30A23^C'
'1021C5962FF4^C' '1021C5962FF4^C'
'1^1' '1^1'
'2^1' '2^1'
END_ARRAY 1 19 END_ARRAY 1 19
TOTAL_ARRAYS 1 TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~ ~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: {} This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~ ~NAIF/SPC END COMMENTS~
...@@ -6,35 +6,35 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE ...@@ -6,35 +6,35 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 19 BEGIN_ARRAY 1 19
'LRO_LROCNACR DATA TYPE 3 ' 'LRO_LROCNACR DATA TYPE 3 '
'1021C5962FF4^C' '1021C5962FF4^C'
'1021C5A30A9D^C' '1021C5A30A23^C'
'-14E6A' '-14E6A'
'-14C08' '-14C08'
'3' '3'
'1' '1'
19 19
'4ABD7DFCD07A34^-2' '4ABD7DFCD07A2^-2'
'-28479DF5DC79DC^-2' '-28479DF5DC79DC^-2'
'-2782E9949E4FE4^-1' '-2782E9949E4FE6^-1'
'-FFFCE553D8AC18^0' '-FFFCE553D8AC1^0'
'-34C15FCBF6DABC^-6' '-34C15FCBF6DABE^-6'
'38BE074E98097C^-7' '38BE074E98097C^-7'
'-1184523E56ED56^-8' '-1184523E56ED56^-8'
'4ABD7E4470D09^-2' '4ABD7E446E28BC^-2'
'-2847A59D3FE5F4^-2' '-2847A59CF74132^-2'
'-2782FE27FE7FD6^-1' '-2782FE273B369C^-1'
'-FFFCE550AA5EE8^0' '-FFFCE550AA7D1^0'
'-37F79D7278059A^-6' '-37F77EF67EC082^-6'
'85D022D5E48D18^-7' '85CD4759607BB8^-7'
'-294F3CEB71375A^-8' '-294E5B19EA0B4A^-8'
'1021C5962FF4^C' '1021C5962FF4^C'
'1021C5A30A9D^C' '1021C5A30A23^C'
'1021C5962FF4^C' '1021C5962FF4^C'
'1^1' '1^1'
'2^1' '2^1'
END_ARRAY 1 19 END_ARRAY 1 19
TOTAL_ARRAYS 1 TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~ ~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: {} This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~ ~NAIF/SPC END COMMENTS~
...@@ -6,35 +6,35 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE ...@@ -6,35 +6,35 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 19 BEGIN_ARRAY 1 19
'LRO_LROCWAC DATA TYPE 3 ' 'LRO_LROCWAC DATA TYPE 3 '
'1021C5962FF4^C' '1021C5962FF4^C'
'1021C5A30A9D^C' '1021C5A30A23^C'
'-14E74' '-14E74'
'-14C08' '-14C08'
'3' '3'
'1' '1'
19 19
'FFFFFFFFD74A3^0' 'FFFFFFFFD74A2^0'
'-85214D1E75E7C8^-4' '-85214D1E75E7B8^-4'
'-37DB9E0D69AB8C^-4' '-37DB9E0D69AB7E^-4'
'-1D0990F9882A2D^-8' '-1D0990F9882A29^-8'
'2FD95956569878^-6' '2FD95956569876^-6'
'-3077ED33BD5752^-6' '-3077ED33BD5752^-6'
'-33849E0A29252C^-A' '-33849E0A29252C^-A'
'FFFFFFFFD6EEC^0' 'FFFFFFFFD6EEB^0'
'-864E46E8BBAEF^-4' '-864E3BC0240F5^-4'
'-36AAF4922FE936^-4' '-36AAFFDDC434E2^-4'
'-1CA79A86242617^-8' '-1CA79E371CC4EB^-8'
'31FCAC4480E09^-6' '31FC97F9CB6818^-6'
'-32B3E1A7EBD0F6^-6' '-32B3CC736FF64A^-6'
'-3677B95D32900E^-A' '-36779D5E668328^-A'
'1021C5962FF4^C' '1021C5962FF4^C'
'1021C5A30A9D^C' '1021C5A30A23^C'
'1021C5962FF4^C' '1021C5962FF4^C'
'1^1' '1^1'
'2^1' '2^1'
END_ARRAY 1 19 END_ARRAY 1 19
TOTAL_ARRAYS 1 TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~ ~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: {} This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~ ~NAIF/SPC END COMMENTS~
...@@ -6,7 +6,7 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE ...@@ -6,7 +6,7 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 19 BEGIN_ARRAY 1 19
'LRO_LROCNACL DATA TYPE 3 ' 'LRO_LROCNACL DATA TYPE 3 '
'1021C7912B1^C' '1021C7912B1^C'
'1021C79B94E3^C' '1021C79B9469^C'
'-14E60' '-14E60'
'-14C08' '-14C08'
'3' '3'
...@@ -15,26 +15,26 @@ BEGIN_ARRAY 1 19 ...@@ -15,26 +15,26 @@ BEGIN_ARRAY 1 19
'FFF91C6346CA18^0' 'FFF91C6346CA18^0'
'-3AC40FF39E8BD^-1' '-3AC40FF39E8BD^-1'
'428975384289D4^-3' '428975384289D4^-3'
'-89366F50DAFFA^-2' '-89366F50DB00A8^-2'
'3FEE0F16185CC6^-6' '3FEE0F16185CC6^-6'
'-5B3633299BE7FC^-6' '-5B3633299BE7FC^-6'
'-29E3BE8A7CD6B6^-7' '-29E3BE8A7CD6B6^-7'
'FFF91C5E6BFE18^0' 'FFF91C5E6C36F^0'
'-3AC42507844446^-1' '-3AC425068D5386^-1'
'42A6C5871CF93C^-3' '42A6C42FAEBE5^-3'
'-8936689318F04^-2' '-8936689367EA^-2'
'3C75E8B98A1F92^-6' '3C76115ED67A7^-6'
'-5F8BEE1495545^-6' '-5F8BBB4B51059C^-6'
'-2BE174B4E2DB8C^-7' '-2BE15D6141EE32^-7'
'1021C7912B1^C' '1021C7912B1^C'
'1021C79B94E3^C' '1021C79B9469^C'
'1021C7912B1^C' '1021C7912B1^C'
'1^1' '1^1'
'2^1' '2^1'
END_ARRAY 1 19 END_ARRAY 1 19
TOTAL_ARRAYS 1 TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~ ~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: {} This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~ ~NAIF/SPC END COMMENTS~
...@@ -6,35 +6,35 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE ...@@ -6,35 +6,35 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 19 BEGIN_ARRAY 1 19
'LRO_LROCNACR DATA TYPE 3 ' 'LRO_LROCNACR DATA TYPE 3 '
'1021C7912B1^C' '1021C7912B1^C'
'1021C79B94E3^C' '1021C79B9469^C'
'-14E6A' '-14E6A'
'-14C08' '-14C08'
'3' '3'
'1' '1'
19 19
'4ABD83D35E2EE^-2' '4ABD83D35E2DE^-2'
'-28456EF713458^-2' '-28456EF713458^-2'
'-27874B957BBE42^-1' '-27874B957BBE4^-1'
'-FFFCE4A6F74FF^0' '-FFFCE4A6F74FF^0'
'-3FEE0F161545E6^-6' '-3FEE0F161545E4^-6'
'5B3B776267AC08^-6' '5B3B776267AC04^-6'
'-1C2D1E91BE13FC^-7' '-1C2D1E91BE13FC^-7'
'4ABD888D8789^-2' '4ABD888D50269^-2'
'-284742EADDA96E^-2' '-284742D57345C6^-2'
'-278760C1D880EA^-1' '-278760C0E07192^-1'
'-FFFCE4A3675138^0' '-FFFCE4A3677AF8^0'
'-3C75E8B987677C^-6' '-3C76115ED3C254^-6'
'5F917262E098F8^-6' '5F913F96AD8054^-6'
'-1D83FC9C063FBE^-7' '-1D83ECEB17D24^-7'
'1021C7912B1^C' '1021C7912B1^C'
'1021C79B94E3^C' '1021C79B9469^C'
'1021C7912B1^C' '1021C7912B1^C'
'1^1' '1^1'
'2^1' '2^1'
END_ARRAY 1 19 END_ARRAY 1 19
TOTAL_ARRAYS 1 TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~ ~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: {} This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~ ~NAIF/SPC END COMMENTS~
...@@ -6,35 +6,35 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE ...@@ -6,35 +6,35 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 19 BEGIN_ARRAY 1 19
'LRO_LROCWAC DATA TYPE 3 ' 'LRO_LROCWAC DATA TYPE 3 '
'1021C7912B1^C' '1021C7912B1^C'
'1021C79B94E3^C' '1021C79B9469^C'
'-14E74' '-14E74'
'-14C08' '-14C08'
'3' '3'
'1' '1'
19 19
'FFFFFFFFDD124^0' 'FFFFFFFFDD124^0'
'-55C00A72539C3C^-4' '-55C00A72539C44^-4'
'-669E2602EFAE08^-4' '-669E2602EFAE0C^-4'
'-223143AB21DAC6^-8' '-223144AB21DAC8^-8'
'-8E91400FCEC9B^-6' '-8E91400FCEC9B^-6'
'8820BB752205D^-6' '8820BB752205D^-6'
'511262E8673D38^-A' '511262E8673D34^-A'
'FFFFFFFFDCEC98^0' 'FFFFFFFFDCEC9^0'
'-5355B9C49A6914^-4' '-5355D6109945BC^-4'
'-68F2D8270BAED^-4' '-68F2BCD855CF14^-4'
'-2204A6C85DECAA^-8' '-2204A945BF1C6E^-8'
'-960E7D47153A58^-6' '-960E2589483EB^-6'
'8EE5D15816B438^-6' '8EE58207C6E1A8^-6'
'52385BBA1D7A44^-A' '52384E4607121C^-A'
'1021C7912B1^C' '1021C7912B1^C'
'1021C79B94E3^C' '1021C79B9469^C'
'1021C7912B1^C' '1021C7912B1^C'
'1^1' '1^1'
'2^1' '2^1'
END_ARRAY 1 19 END_ARRAY 1 19
TOTAL_ARRAYS 1 TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~ ~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: {} This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~ ~NAIF/SPC END COMMENTS~
...@@ -6,7 +6,7 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE ...@@ -6,7 +6,7 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 1044 BEGIN_ARRAY 1 1044
'LRO BODY ATTITUDE - SEGMENT ' 'LRO BODY ATTITUDE - SEGMENT '
'1021C5962FF4^C' '1021C5962FF4^C'
'1021C5A30A9D^C' '1021C5A30A23^C'
'-14C08' '-14C08'
'1' '1'
'3' '3'
...@@ -14,8 +14,8 @@ BEGIN_ARRAY 1 1044 ...@@ -14,8 +14,8 @@ BEGIN_ARRAY 1 1044
1024 1024
'373EAF2ADAB8CE^0' '373EAF2ADAB8CE^0'
'F0256D5FCF0688^0' 'F0256D5FCF0688^0'
'6E9333601A66CC^-1' '6E9333601A66BC^-1'
'45095C2056B89C^0' '45095C2056B898^0'
'7B3F4109DA19A8^-3' '7B3F4109DA19A8^-3'
'-304553D0379114^-2' '-304553D0379114^-2'
'-16792E806A6854^-2' '-16792E806A6854^-2'
...@@ -915,13 +915,13 @@ BEGIN_ARRAY 1 1044 ...@@ -915,13 +915,13 @@ BEGIN_ARRAY 1 1044
'89C8B52170C368^-3' '89C8B52170C368^-3'
'-313792FB2A15B4^-2' '-313792FB2A15B4^-2'
'-158EEA1152F467^-2' '-158EEA1152F467^-2'
'374638CD503EA6^0' '3746389804E9C2^0'
'EFC7502E17D4^0' 'EFC753B6157568^0'
'69CE8054BB72^-1' '69CEADD0FA37FC^-1'
'464EEDD2AF19D^0' '464EE1AD2B3348^0'
'9BA57195676EB8^-3' '9B3F80295F36D8^-3'
'-319004603226DE^-2' '-318E0B9DB652C2^-2'
'-144827624D72D2^-2' '-144F7043B25D0E^-2'
'1021C5962FF4^C' '1021C5962FF4^C'
'1021C5964208CA^C' '1021C5964208CA^C'
'1021C5965BA263^C' '1021C5965BA263^C'
...@@ -1052,7 +1052,7 @@ BEGIN_ARRAY 1 1044 ...@@ -1052,7 +1052,7 @@ BEGIN_ARRAY 1 1044
'1021C5A2C20964^C' '1021C5A2C20964^C'
'1021C5A2DBA2FE^C' '1021C5A2DBA2FE^C'
'1021C5A2F53C98^C' '1021C5A2F53C98^C'
'1021C5A30A9D^C' '1021C5A30A23^C'
'1021C5A00E9403^C' '1021C5A00E9403^C'
'1021C5962FF4^C' '1021C5962FF4^C'
'1^1' '1^1'
...@@ -1060,7 +1060,7 @@ BEGIN_ARRAY 1 1044 ...@@ -1060,7 +1060,7 @@ BEGIN_ARRAY 1 1044
END_ARRAY 1 1044 END_ARRAY 1 1044
TOTAL_ARRAYS 1 TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~ ~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: {} This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~ ~NAIF/SPC END COMMENTS~
...@@ -6,19 +6,19 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE ...@@ -6,19 +6,19 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
BEGIN_ARRAY 1 852 BEGIN_ARRAY 1 852
'LRO BODY ATTITUDE - SEGMENT ' 'LRO BODY ATTITUDE - SEGMENT '
'1021C7912B1^C' '1021C7912B1^C'
'1021C79B94E3^C' '1021C79B9469^C'
'-14C08' '-14C08'
'1' '1'
'3' '3'
'1' '1'
852 852
'3773B7C00A0FA2^0' '3773B7C00A0FA2^0'
'DC448FA261C3D8^0' 'DC448FA261C3D^0'
'-4DB3F3216695CC^-1' '-4DB3F3216695E4^-1'
'75FB33B5949FE8^0' '75FB33B5949FE4^0'
'906E0DFDD0265^-3' '906E0DFDD0265^-3'
'-33F70107C1A258^-2' '-33F70107C1A256^-2'
'-15F97D94F326B7^-2' '-15F97D94F326B8^-2'
'3773A8F10EB4C2^0' '3773A8F10EB4C2^0'
'DC43651AEEF8B8^0' 'DC43651AEEF8B8^0'
'-4DBC4B01690C74^-1' '-4DBC4B01690C74^-1'
...@@ -747,13 +747,13 @@ BEGIN_ARRAY 1 852 ...@@ -747,13 +747,13 @@ BEGIN_ARRAY 1 852
'9BE4772F9F94F8^-3' '9BE4772F9F94F8^-3'
'-329F57ADAFA03^-2' '-329F57ADAFA03^-2'
'-1528D96B6DED27^-2' '-1528D96B6DED27^-2'
'376DFC306BD94A^0' '376DFC4C736F7^0'
'DBBF156576DD68^0' 'DBBF1B9AB01F4^0'
'-519EFFBAA464D8^-1' '-519ED302C86B58^-1'
'76F322F51EF3D^0' '76F3178ED3D65^0'
'9A3F7448C719^-3' '9A608F1CA248D8^-3'
'-3236D175681DA8^-2' '-323F0980122D42^-2'
'-155B839F329554^-2' '-155787C10CF4C^-2'
'1021C7912B1^C' '1021C7912B1^C'
'1021C79141C5D3^C' '1021C79141C5D3^C'
'1021C7915A1717^C' '1021C7915A1717^C'
...@@ -859,7 +859,7 @@ BEGIN_ARRAY 1 852 ...@@ -859,7 +859,7 @@ BEGIN_ARRAY 1 852
'1021C79B5BA043^C' '1021C79B5BA043^C'
'1021C79B7539DD^C' '1021C79B7539DD^C'
'1021C79B8ED376^C' '1021C79B8ED376^C'
'1021C79B94E3^C' '1021C79B9469^C'
'1021C79B0ED41F^C' '1021C79B0ED41F^C'
'1021C7912B1^C' '1021C7912B1^C'
'1^1' '1^1'
...@@ -867,7 +867,7 @@ BEGIN_ARRAY 1 852 ...@@ -867,7 +867,7 @@ BEGIN_ARRAY 1 852
END_ARRAY 1 852 END_ARRAY 1 852
TOTAL_ARRAYS 1 TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~ ~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: {} This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~ ~NAIF/SPC END COMMENTS~
This diff is collapsed.
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
=====================================================================
This diff is collapsed.
import pytest import pytest
import numpy as np import numpy as np
import os import os
import unittest
from unittest.mock import PropertyMock, patch from unittest.mock import PropertyMock, patch
import spiceypy as spice
import json
import ale import ale
from ale import util from ale import util
from ale.drivers import lro_drivers
from ale.drivers.lro_drivers import LroLrocPds3LabelNaifSpiceDriver 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 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(): def test_kernels():
kernels = get_image_kernels('M103595705LE') updated_kernels = {}
updated_kernels, binary_kernels = convert_kernels(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 yield updated_kernels
for kern in binary_kernels: for kern_list in binary_kernels.values():
for kern in kern_list:
os.remove(kern) os.remove(kern)
@pytest.fixture(params=["Pds3NaifDriver"]) @pytest.fixture(params=["Pds3NaifDriver"])
...@@ -135,8 +321,78 @@ def test_exposure_duration(driver): ...@@ -135,8 +321,78 @@ def test_exposure_duration(driver):
exposure_duration.return_value = 1 exposure_duration.return_value = 1
assert driver.exposure_duration == 1.0045 assert driver.exposure_duration == 1.0045
def test_load(test_kernels, usgscsm_comparison_isd): @pytest.mark.parametrize("label_type", ['isis3'])
label_file = get_image_label('M103595705LE') @pytest.mark.parametrize("formatter", ['isis'])
usgscsm_isd = ale.load(label_file, props={'kernels': test_kernels}, formatter='usgscsm') @pytest.mark.parametrize("image", image_dict.keys())
print(usgscsm_isd) def test_load_isis(test_kernels, label_type, formatter, image):
assert compare_dicts(usgscsm_isd, usgscsm_comparison_isd) == [] 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