Skip to content
Snippets Groups Projects
Commit 2ef95bc8 authored by Kelvin's avatar Kelvin Committed by Jesse Mapel
Browse files

tests for formatter and kaguya

parent 52c71f0c
No related branches found
No related tags found
No related merge requests found
...@@ -812,3 +812,15 @@ class KaguyaMiPds3NaifSpiceDriver(LineScanner, Pds3Label, NaifSpice, Driver): ...@@ -812,3 +812,15 @@ class KaguyaMiPds3NaifSpiceDriver(LineScanner, Pds3Label, NaifSpice, Driver):
"boresight_y" : self.boresight_y "boresight_y" : self.boresight_y
} }
} }
@property
def sensor_model_version(self):
"""
Returns
-------
: int
ISIS sensor model version
"""
return 1
{
"IsisCameraVersion": 1,
"NaifKeywords": {
"BODY301_RADII": [
1737.4,
1737.4,
1737.4
],
"BODY_FRAME_CODE": 10020,
"BODY_CODE": 301,
"INS-131335_FOV_BOUNDARY_CORNERS": [
0.0005,
6.2668,
65.4,
-0.0125,
6.2668,
65.4,
-0.0125,
-6.2392,
65.4,
0.0005
],
"INS-131335_DISTORTION_COEF_X": [
2.8912e-19,
0.00020899000000000002,
4.7727000000000006e-05
],
"INS-131335_DISTORTION_COEF_Y": [
-1.0119e-18,
0.0034982,
1.9597e-05
],
"INS-131335_BORESIGHT": [
-0.006,
-0.0187,
65.4
],
"INS-131335_CENTER": [
484.0,
1.0
],
"INS-131335_PIXEL_SIZE": 0.013,
"INS-131335_FOV_SHAPE": "RECTANGLE",
"INS-131335_F_NUMBER": 3.7,
"INS-131335_PIXEL_LINES": 962.0,
"INS-131335_PIXEL_SAMPLES": 962.0,
"INS-131335_FOCAL_LENGTH": 65.4,
"INS-131335_FOV_FRAME": "LISM_MI_V_HEAD",
"BODY301_POLE_RA": [
269.9949,
0.0031,
0.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,
0.0072,
0.0,
0.0,
0.0,
-0.0052
],
"BODY301_LONG_AXIS": 0.0,
"BODY301_NUT_PREC_DEC": [
1.5419,
0.0239,
-0.0278,
0.0068,
0.0,
-0.0029,
0.0009,
0.0,
0.0,
0.0008
],
"BODY301_POLE_DEC": [
66.5392,
0.013,
0.0
],
"BODY301_PM": [
38.3213,
13.17635815,
-1.3999999999999999e-12
]
},
"detector_sample_summing": 1,
"detector_line_summing": 1,
"focal_length_model": {
"focal_length": 65.4
},
"detector_center": {
"line": 0.5,
"sample": 483.5
},
"starting_detector_line": 0,
"starting_detector_sample": 0,
"focal2pixel_lines": [
0,
76.92307692307692,
0
],
"focal2pixel_samples": [
0,
0,
-76.92307692307692
],
"optical_distortion": {
"kaguyalism": {
"x": [
2.8912e-19,
0.00020899000000000002,
4.7727000000000006e-05
],
"y": [
-1.0119e-18,
0.0034982,
1.9597e-05
],
"boresight_x": -0.006,
"boresight_y": -0.0187
}
},
"image_lines": 960,
"image_samples": 962,
"name_platform": "SELENE MAIN ORBITER",
"name_sensor": "MULTIBAND IMAGER VISIBLE",
"reference_height": {
"maxheight": 1000,
"minheight": -1000,
"unit": "m"
},
"name_model": "USGS_ASTRO_LINE_SCANNER_SENSOR_MODEL",
"interpolation_method": "lagrange",
"line_scan_rate": [
[
0.5,
-6.239987522363663,
0.012999974000000001
]
],
"starting_ephemeris_time": 261664552.50899568,
"center_ephemeris_time": 261664558.7489832,
"radii": {
"semimajor": 1737.4,
"semiminor": 1737.4,
"unit": "km"
},
"InstrumentPointing": {
"TimeDependentFrames": [
-131000,
1
],
"CkTableStartTime": 261664552.50899568,
"CkTableEndTime": 261664564.98897073,
"CkTableOriginalSize": 15,
"EphemerisTimes": [
261664552.50899568,
261664553.40042248,
261664554.29184926,
261664555.18327606,
261664556.07470283,
261664556.96612963,
261664557.8575564,
261664558.7489832,
261664559.64041,
261664560.53183678,
261664561.42326358,
261664562.31469035,
261664563.20611715,
261664564.09754393,
261664564.98897073
],
"Quaternions": [
[
-0.051661051153873275,
-0.7006601262613299,
-0.2157810772599907,
0.6781187580045638
],
[
-0.051562981044395585,
-0.7003880184403372,
-0.21580746855442728,
0.6783988643321591
],
[
-0.05146445606152621,
-0.700115253311309,
-0.2158346780237511,
0.6786791831237473
],
[
-0.05136708001228234,
-0.6998405030421031,
-0.21586458749172763,
0.6789603620682242
],
[
-0.05127046633531904,
-0.699564390964678,
-0.2158962831253876,
0.6792420754845951
],
[
-0.0511751795180098,
-0.6992873495647361,
-0.21592809762344845,
0.6795243633577421
],
[
-0.05108229328333569,
-0.6990087241733144,
-0.21596015512155592,
0.6798077774212238
],
[
-0.05098986775735178,
-0.6987299676309876,
-0.2159921020605492,
0.6800910803472959
],
[
-0.05090111629756331,
-0.6984509844706128,
-0.2160234293298993,
0.680374291572105
],
[
-0.05081235635432923,
-0.698171884777203,
-0.21605472054109798,
0.6806573892056684
],
[
-0.05072817570257887,
-0.6978937401407959,
-0.21608338484488482,
0.6809397553794
],
[
-0.05064467566415354,
-0.6976156413774419,
-0.21611162443919896,
0.6812219164961324
],
[
-0.050564860199468355,
-0.6973390832126966,
-0.21613496894835,
0.681503538607673
],
[
-0.050487244379830425,
-0.6970634017441713,
-0.21615537312482683,
0.6817847950585597
],
[
-0.050410617013086106,
-0.6967890114743863,
-0.2161734505037639,
0.6820651599944132
]
],
"AngularVelocity": [
[
-0.0009538064837455751,
-0.0012094992518424988,
0.0006069615960121158
],
[
-0.002153072667121888,
-0.0014504389524459844,
0.0004119513094425205
],
[
-0.003401070022583009,
-0.0016287242889404302,
0.00018909463882446273
],
[
-0.003792990374565126,
-0.0017000000000000003,
-8.726684451103225e-05
],
[
-0.0036147050380706787,
-0.0016999999999999997,
-0.0003992661833763125
],
[
-0.0027211413443088543,
-0.0018748458206653612,
-0.0005841049253940577
],
[
-0.0005371459722518923,
-0.0023651304960250856,
-0.0005395335912704471
],
[
0.0013395470857620242,
-0.002724433857202531,
-0.0005251887142658237
],
[
0.0008046910762786868,
-0.0020558638453483592,
-0.0007480453848838812
],
[
0.0002698351383209233,
-0.0013872939229011543,
-0.0009709020256996161
],
[
-0.001970097398757935,
-0.0009124826073646547,
-0.0013100139141082763
],
[
-0.004466092109680176,
-0.00046676926612853925,
-0.0016665845870971678
],
[
-0.003391602659225463,
-0.0002721055924892425,
-0.0013815838873386384
],
[
-0.00018246660232543966,
-0.00022753425836563107,
-0.0007130138754844664
],
[
0.0019874078333377834,
-6.37033939361569e-05,
-0.00023185169696807864
]
],
"ConstantFrames": [
-131330,
-131320,
-131000
],
"ConstantRotation": [
0.9999999022105177,
-0.00041337792156500403,
-0.00015715485723418282,
0.0004135737459753289,
0.9999991356305759,
0.0012480764632437768,
0.0001566387941399994,
-0.00124814133631803,
0.9999992088034335
]
},
"BodyRotation": {
"TimeDependentFrames": [
10020,
1
],
"CkTableStartTime": 261664552.50899568,
"CkTableEndTime": 261664564.98897073,
"CkTableOriginalSize": 15,
"EphemerisTimes": [
261664552.50899568,
261664553.40042248,
261664554.29184926,
261664555.18327606,
261664556.07470283,
261664556.96612963,
261664557.8575564,
261664558.7489832,
261664559.64041,
261664560.53183678,
261664561.42326358,
261664562.31469035,
261664563.20611715,
261664564.09754393,
261664564.98897073
],
"Quaternions": [
[
-0.9710661094490091,
0.18926293156500895,
0.035823610511098454,
-0.14116239848108694
],
[
-0.9710662770439805,
0.1892629734174178,
0.03582338632897354,
-0.14116124635701674
],
[
-0.9710664446375847,
0.18926301526956016,
0.03582316214679887,
-0.14116009423275103
],
[
-0.9710666122298297,
0.18926305712143787,
0.03582293796456346,
-0.1411589421082355
],
[
-0.9710667798206913,
0.18926309897304502,
0.03582271378229974,
-0.14115778998363532
],
[
-0.9710669474102016,
0.18926314082438966,
0.03582248959996462,
-0.14115663785872964
],
[
-0.9710671149983365,
0.18926318267546582,
0.035822265417590336,
-0.14115548573368458
],
[
-0.9710672825851125,
0.18926322452627745,
0.0358220412351556,
-0.1411543336083884
],
[
-0.9710674501705128,
0.1892632663768203,
0.03582181705268147,
-0.1411531814829536
],
[
-0.971067617754554,
0.18926330822709891,
0.03582159287014686,
-0.1411520293572682
],
[
-0.9710677853372359,
0.18926335007711273,
0.035821368687551584,
-0.14115087723133254
],
[
-0.9710679529185265,
0.18926339192685424,
0.0358211445049387,
-0.14114972510536786
],
[
-0.9710681204984658,
0.18926343377633303,
0.035820920322254486,
-0.14114857297909725
],
[
-0.9710682880770459,
0.1892634756255473,
0.03582069613950957,
-0.1411474208525769
],
[
-0.9710684556542424,
0.1892635174744909,
0.03582047195673622,
-0.14114626872597225
]
],
"AngularVelocity": [
[
4.161664897473834e-08,
-1.004371630350468e-06,
2.464628831254649e-06
],
[
4.161664885422191e-08,
-1.0043716308813643e-06,
2.4646288315121845e-06
],
[
4.1616648733707034e-08,
-1.004371631412263e-06,
2.464628831769719e-06
],
[
4.16166486131914e-08,
-1.0043716319431633e-06,
2.4646288320272517e-06
],
[
4.1616648492676444e-08,
-1.0043716324740668e-06,
2.464628832284783e-06
],
[
4.161664837216184e-08,
-1.0043716330049716e-06,
2.4646288325423125e-06
],
[
4.161664825164693e-08,
-1.004371633535879e-06,
2.464628832799842e-06
],
[
4.16166481311339e-08,
-1.0043716340667901e-06,
2.4646288330573695e-06
],
[
4.161664801061875e-08,
-1.0043716345977008e-06,
2.464628833314895e-06
],
[
4.1616647890104974e-08,
-1.0043716351286158e-06,
2.4646288335724185e-06
],
[
4.161664776959167e-08,
-1.0043716356595318e-06,
2.4646288338299428e-06
],
[
4.161664764907793e-08,
-1.0043716361904512e-06,
2.4646288340874636e-06
],
[
4.161664752856538e-08,
-1.0043716367213725e-06,
2.464628834344985e-06
],
[
4.1616647408052476e-08,
-1.0043716372522953e-06,
2.4646288346025046e-06
],
[
4.161664728753888e-08,
-1.0043716377832207e-06,
2.464628834860021e-06
]
]
},
"InstrumentPosition": {
"SpkTableStartTime": 261664552.50899568,
"SpkTableEndTime": 261664564.98897073,
"SpkTableOriginalSize": 15,
"EphemerisTimes": [
261664552.50899568,
261664553.40042248,
261664554.29184926,
261664555.18327606,
261664556.07470283,
261664556.96612963,
261664557.8575564,
261664558.7489832,
261664559.64041,
261664560.53183678,
261664561.42326358,
261664562.31469035,
261664563.20611715,
261664564.09754393,
261664564.98897073
],
"Positions": [
[
1779.1765541938503,
397.6505395849898,
149.9585676494352
],
[
1779.1726996991406,
398.19882555240866,
148.60196403717865
],
[
1779.1677124503892,
398.74685851343,
147.24526595675715
],
[
1779.1615932222896,
399.2946366799058,
145.88847341181543
],
[
1779.154341255063,
399.8421611247914,
144.53158811592658
],
[
1779.1459573830084,
400.3894300599344,
143.17461008763462
],
[
1779.136440771842,
400.9364446029984,
141.81754103306466
],
[
1779.125791853619,
401.4832036885585,
140.46038134702127
],
[
1779.1140110454915,
402.0297062213894,
139.10313156586872
],
[
1779.1010975429751,
402.57595329680214,
137.74579333985244
],
[
1779.087052180374,
403.1219431638951,
136.38836669496678
],
[
1779.071874183002,
403.6676768807256,
135.0308533447852
],
[
1779.055564340459,
404.2131526889458,
133.67325329667835
],
[
1779.03812187806,
404.75837166151257,
132.31556826049345
],
[
1779.0195476301076,
405.3033320400754,
130.957798262226
]
],
"Velocities": [
[
-0.003688959644644985,
0.615208251928988,
-1.521780235612949
],
[
-0.004959248964411199,
0.6149238025932658,
-1.521887172628387
],
[
-0.006229527337232522,
0.614638964323945,
-1.5219931421762114
],
[
-0.007499794140988983,
0.6143537372556477,
-1.522098144209672
],
[
-0.008770048414376274,
0.6140681215991783,
-1.5222021786542368
],
[
-0.010040289534500703,
0.6137821174891751,
-1.522305245463068
],
[
-0.011310516539232391,
0.613495725136574,
-1.5224073445621644
],
[
-0.01258072876261374,
0.6132089446855354,
-1.522508475901433
],
[
-0.013850925410832968,
0.6129217763088936,
-1.5226086394205134
],
[
-0.015121105562940636,
0.6126342202083058,
-1.522707835049596
],
[
-0.016391268593877,
0.6123462765183301,
-1.5228060627418618
],
[
-0.017661413539324235,
0.6120579454504373,
-1.5229033224246329
],
[
-0.01893153977328187,
0.6117692271392193,
-1.522999614051104
],
[
-0.020201646330485018,
0.6114801217963561,
-1.5230949375491383
],
[
-0.021471732583980305,
0.6111906295565285,
-1.5231892928719597
]
]
},
"SunPosition": {
"SpkTableStartTime": 261664558.7489832,
"SpkTableEndTime": 261664558.7489832,
"SpkTableOriginalSize": 1,
"EphemerisTimes": [
261664558.7489832
],
"Positions": [
[
133875301.95654832,
63045454.87068491,
27346357.260941397
]
],
"Velocities": [
[
-12.93006737143756,
25.242392040919338,
11.03273428906624
]
]
}
}
{
"IsisCameraVersion": 1,
"NaifKeywords": {
"BODY301_RADII": [
1737.4,
1737.4,
1737.4
],
"BODY_FRAME_CODE": 10020,
"BODY_CODE": 301,
"INS-131351_PIXEL_SAMPLES": 4096.0,
"INS-131351_BORESIGHT_SAMPLE": 2047.5,
"INS-131351_BORESIGHT": [
-0.0725,
0.0214,
72.45
],
"INS-131351_PIXEL_SIZE": 0.007,
"INS-131351_FOCAL_LENGTH": 72.45,
"INS-131351_FOV_SHAPE": "RECTANGLE",
"INS-131351_PIXEL_LINES": 1.0,
"INS-131351_F_NUMBER": 4.0,
"INS-131351_TRANSX": [
0.0,
0.0,
-0.007
],
"INS-131351_TRANSY": [
0.0,
-0.007,
0.0
],
"INS-131351_DISTORTION_COEF_X": [
-0.0009649900000000001,
0.00098441,
8.5773e-06,
-3.7438e-06
],
"INS-131351_DISTORTION_COEF_Y": [
-0.0013796,
1.3502e-05,
2.7251e-06,
-6.193800000000001e-06
],
"INS-131351_FOV_FRAME": "LISM_TC1_HEAD",
"INS-131351_ITRANSL": [
0.0,
-142.857142857,
0.0
],
"INS-131351_LT_SURFACE_CORRECT": "TRUE",
"INS-131351_ITRANSS": [
0.0,
0.0,
-142.857142857
],
"INS-131351_BORESIGHT_LINE": 0.0,
"INS-131351_SWAP_OBSERVER_TARGET": "TRUE",
"INS-131351_LIGHTTIME_CORRECTION": "LT+S",
"INS-131351_FOV_BOUNDARY_CORNERS": [
-0.069,
14.3574,
72.45,
-0.076,
14.3574,
72.45,
-0.076,
-14.3146,
72.45,
-0.069
],
"INS-131351_PIXEL_PITCH": 0.007,
"INS-131351_CENTER": [
2048.5,
1.0
],
"BODY301_POLE_RA": [
269.9949,
0.0031,
0.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,
0.0072,
0.0,
0.0,
0.0,
-0.0052
],
"BODY301_LONG_AXIS": 0.0,
"BODY301_NUT_PREC_DEC": [
1.5419,
0.0239,
-0.0278,
0.0068,
0.0,
-0.0029,
0.0009,
0.0,
0.0,
0.0008
],
"BODY301_POLE_DEC": [
66.5392,
0.013,
0.0
],
"BODY301_PM": [
38.3213,
13.17635815,
-1.3999999999999999e-12
]
},
"detector_sample_summing": 1,
"detector_line_summing": 1,
"focal_length_model": {
"focal_length": 72.45
},
"detector_center": {
"line": 0.5,
"sample": 2048.0
},
"starting_detector_line": 1,
"starting_detector_sample": 0.5,
"focal2pixel_lines": [
0,
142.85714285714286,
0
],
"focal2pixel_samples": [
0,
0,
-142.85714285714286
],
"optical_distortion": {
"kaguyalism": {
"x": [
-0.0009649900000000001,
0.00098441,
8.5773e-06,
-3.7438e-06
],
"y": [
-0.0013796,
1.3502e-05,
2.7251e-06,
-6.193800000000001e-06
],
"boresight_x": -0.0725,
"boresight_y": 0.0214
}
},
"image_lines": 400,
"image_samples": 3208,
"name_platform": "SELENE-M",
"name_sensor": "Terrain Camera 1",
"reference_height": {
"maxheight": 1000,
"minheight": -1000,
"unit": "m"
},
"name_model": "USGS_ASTRO_LINE_SCANNER_SENSOR_MODEL",
"interpolation_method": "lagrange",
"line_scan_rate": [
[
0.5,
-1.300000011920929,
0.006500000000000001
]
],
"starting_ephemeris_time": 292234259.82293594,
"center_ephemeris_time": 292234261.12293595,
"radii": {
"semimajor": 1737.4,
"semiminor": 1737.4,
"unit": "km"
},
"InstrumentPointing": {
"TimeDependentFrames": [
-131000,
1
],
"CkTableStartTime": 292234259.82293594,
"CkTableEndTime": 292234262.42293596,
"CkTableOriginalSize": 6,
"EphemerisTimes": [
292234259.82293594,
292234260.3429359,
292234260.86293596,
292234261.38293594,
292234261.902936,
292234262.42293596
],
"Quaternions": [
[
-0.11368345174719045,
0.09298596444784424,
0.2013930267438065,
-0.9684371595480613
],
[
-0.11372818465697028,
0.09275013166228546,
0.20136686301023998,
-0.9684599628134732
],
[
-0.11377291088720781,
0.09251429336685049,
0.2013406874257358,
-0.9684827091166966
],
[
-0.11381763041476521,
0.09227844968354312,
0.20131450000383497,
-0.9685053984459642
],
[
-0.11386136284512544,
0.09204252828147888,
0.20128777589296418,
-0.9685282620113198
],
[
-0.11390357201864484,
0.09180648978204593,
0.20126022810145933,
-0.968551426254611
]
],
"AngularVelocity": [
[
0.0030447825014591214,
0.00010000000000000005,
-0.0
],
[
0.002394782674312591,
9.999999999999994e-05,
-1.0842021724855044e-19
],
[
0.0017447826981544486,
0.00010000000000000002,
-1.0842021724855044e-19
],
[
0.0010947828710079189,
9.999999999999991e-05,
-5.421010862427522e-20
],
[
0.0007000000000000001,
0.00010000000000000005,
-0.0
],
[
0.0007,
9.999999999999999e-05,
-5.421010862427522e-20
]
],
"ConstantFrames": [
-131350,
-131320,
-131000
],
"ConstantRotation": [
0.9662180936858615,
-0.0009130086708890376,
-0.25772419725207507,
0.0007985363329952996,
0.9999995305599746,
-0.0005488347248289601,
0.25772457735688403,
0.0003244919061750129,
0.9662183691750111
]
},
"BodyRotation": {
"TimeDependentFrames": [
10020,
1
],
"CkTableStartTime": 292234259.82293594,
"CkTableEndTime": 292234262.42293596,
"CkTableOriginalSize": 6,
"EphemerisTimes": [
292234259.82293594,
292234260.3429359,
292234260.86293596,
292234261.38293594,
292234261.902936,
292234262.42293596
],
"Quaternions": [
[
-0.9366199858891122,
0.18349494110821096,
0.06855103875958304,
-0.2904709343561858
],
[
-0.9366201869031077,
0.1834949884829207,
0.06855091216702795,
-0.2904702861366526
],
[
-0.9366203879166877,
0.18349503585755036,
0.06855078557441907,
-0.29046963791687386
],
[
-0.9366205889297697,
0.1834950832320804,
0.06855065898180862,
-0.2904689896971154
],
[
-0.9366207899424527,
0.18349513060653444,
0.06855053238913389,
-0.29046834147705847
],
[
-0.9366209909546542,
0.18349517798089263,
0.06855040579644703,
-0.290467693256969
]
],
"AngularVelocity": [
[
5.82758225576212e-08,
-1.019441640177111e-06,
2.457874760396369e-06
],
[
5.827582244645205e-08,
-1.019441640485622e-06,
2.4578747604667534e-06
],
[
5.827582233528228e-08,
-1.0194416407941343e-06,
2.4578747605371393e-06
],
[
5.827582222411336e-08,
-1.0194416411026467e-06,
2.4578747606075235e-06
],
[
5.827582211294295e-08,
-1.0194416414111613e-06,
2.4578747606779094e-06
],
[
5.827582200177214e-08,
-1.0194416417196761e-06,
2.457874760748296e-06
]
]
},
"InstrumentPosition": {
"SpkTableStartTime": 292234259.82293594,
"SpkTableEndTime": 292234262.42293596,
"SpkTableOriginalSize": 6,
"EphemerisTimes": [
292234259.82293594,
292234260.3429359,
292234260.86293596,
292234261.38293594,
292234261.902936,
292234262.42293596
],
"Positions": [
[
242.79442620277422,
738.203001908958,
-1612.8925325032326
],
[
241.96952468156812,
738.0541005805137,
-1613.080201137811
],
[
241.14456766843796,
737.9050270542502,
-1613.2674980517477
],
[
240.31955525279045,
737.7557829990983,
-1613.4544224366548
],
[
239.49448725581178,
737.6063684523104,
-1613.6409743055701
],
[
238.66936379671102,
737.4567850753665,
-1613.827152851969
]
],
"Velocities": [
[
-1.5862908231149133,
-0.28618937128869254,
-0.3612582504333375
],
[
-1.5863982963215315,
-0.2865174779675076,
-0.36054196443450875
],
[
-1.5865054065150235,
-0.2868455207934169,
-0.3598255921378646
],
[
-1.5866121536530406,
-0.28717349961910793,
-0.3591091338577958
],
[
-1.586718537740638,
-0.28750141444799104,
-0.3583925895795086
],
[
-1.5868245587335799,
-0.2878292651335531,
-0.3576759596160613
]
]
},
"SunPosition": {
"SpkTableStartTime": 292234261.12293595,
"SpkTableEndTime": 292234261.12293595,
"SpkTableOriginalSize": 1,
"EphemerisTimes": [
292234261.12293595
],
"Positions": [
[
144178551.68571115,
37762451.38900038,
16383592.932550186
]
],
"Velocities": [
[
-7.182591994538903,
27.132956790118943,
11.856684753988956
]
]
}
}
import pytest
import json
import numpy as np
from ale.formatters import formatter
from ale.base.base import Driver
from ale.base.type_sensor import LineScanner, Framer
from ale.transformation import FrameChain
from ale.base.data_naif import NaifSpice
from ale.rotation import ConstantRotation, TimeDependentRotation
class TestDriver(Driver, NaifSpice):
"""
Test Driver implementation with dummy values
"""
@property
def target_body_radii(self):
return (1100, 1100, 1000)
@property
def frame_chain(self):
frame_chain = FrameChain()
body_rotation = TimeDependentRotation(
np.array([[0, 0, 0, 1], [0, 0, 0, 1]]),
np.array([800, 900]),
100,
1
)
frame_chain.add_edge(rotation=body_rotation)
spacecraft_rotation = TimeDependentRotation(
np.array([[0, 0, 0, 1], [0, 0, 0, 1]]),
np.array([800, 900]),
1000,
1
)
frame_chain.add_edge(rotation=spacecraft_rotation)
sensor_rotation = ConstantRotation(np.array([0, 0, 0, 1]), 1010, 1000)
frame_chain.add_edge(rotation=sensor_rotation)
return frame_chain
@property
def sample_summing(self):
return 2
@property
def line_summing(self):
return 4
@property
def focal_length(self):
return 500
@property
def detector_center_sample(self):
return 512
@property
def detector_start_line(self):
return 0
@property
def detector_start_sample(self):
return 8
@property
def usgscsm_distortion_model(self):
return {
'radial' : {
'coefficients' : [0.0, 1.0, 0.1]
}
}
@property
def platform_name(self):
return 'Test Platform'
@property
def ephemeris_start_time(self):
return 800
@property
def exposure_duration(self):
return 100
@property
def focal2pixel_lines(self):
return [0.1, 0.2, 0.3]
@property
def focal2pixel_samples(self):
return [0.3, 0.2, 0.1]
@property
def image_samples(self):
return 1024
@property
def sensor_frame_id(self):
return 1010
@property
def target_frame_id(self):
return 100
@property
def naif_keywords(self):
return {
'keyword_1' : 0,
'keyword_2' : 'test'
}
@property
def pixel2focal_x(self):
return [456, 3, 1]
@property
def pixel2focal_y(self):
return [28, 93, 5]
@property
def sensor_model_version(self):
return 1
@property
def target_name(self):
return 'Test Target'
class TestLineScanner(LineScanner, TestDriver):
"""
Test class for overriding properties from the LineScanner class.
"""
@property
def line_scan_rate(self):
return [[0.5], [-50], [0.01]]
@property
def sensor_name(self):
return 'Test Line Scan Sensor'
@property
def sensor_position(self):
return (
[[0, 1, 2], [3, 4, 5]],
[[0.03, 0.03, 0.03], [0.03, 0.03, 0.03]],
[800, 900]
)
@property
def sun_position(self):
return (
[[0, 1, 2], [3, 4, 5]],
[[0, -1, -2], [-3, -4, -5]],
[800, 900]
)
@property
def detector_center_line(self):
return 0.5
@property
def image_lines(self):
return 10000
@property
def exposure_duration(self):
return .01
@pytest.fixture
def driver():
return TestFramer('')
class TestFramer(Framer, TestDriver):
"""
Test class for overriding properties from the Framer class
"""
@property
def sensor_name(self):
return 'Test Frame Sensor'
@property
def sensor_position(self):
return (
[[0, 1, 2]],
[[0, -1, -2]],
[850]
)
@property
def sun_position(self):
return (
[[0, 1, 2]],
[[0, -1, -2]],
[850]
)
@property
def detector_center_line(self):
return 256
@property
def image_lines(self):
return 512
@pytest.fixture
def test_line_scan_driver():
return TestLineScanner("")
@pytest.fixture
def test_frame_driver():
return TestFramer("")
def test_frame_name_model(test_frame_driver):
isd = formatter.to_isd(test_frame_driver)
assert isd['name_model'] == 'USGS_ASTRO_FRAME_SENSOR_MODEL'
def test_line_scan_name_model(test_line_scan_driver):
isd = formatter.to_isd(test_line_scan_driver)
assert isd['name_model'] == 'USGS_ASTRO_LINE_SCANNER_SENSOR_MODEL'
def test_name_platform(test_frame_driver):
isd = formatter.to_isd(test_frame_driver)
assert isd['name_platform'] == 'Test Platform'
def test_name_sensor(test_frame_driver):
isd = formatter.to_isd(test_frame_driver)
assert isd['name_sensor'] == 'Test Frame Sensor'
def test_frame_center_ephemeris_time(test_frame_driver):
isd = formatter.to_isd(test_frame_driver)
assert isd['center_ephemeris_time'] == 850
def test_summing(test_frame_driver):
isd = formatter.to_isd(test_frame_driver)
assert isd['detector_sample_summing'] == 2
assert isd['detector_line_summing'] == 4
def test_focal_to_pixel(test_frame_driver):
isd = formatter.to_isd(test_frame_driver)
assert isd['focal2pixel_lines'] == [0.1, 0.2, 0.3]
assert isd['focal2pixel_samples'] == [0.3, 0.2, 0.1]
def test_focal_length(test_frame_driver):
isd = formatter.to_isd(test_frame_driver)
focal_model = isd['focal_length_model']
assert focal_model['focal_length'] == 500
def test_image_size(test_frame_driver):
isd = formatter.to_isd(test_frame_driver)
assert isd['image_lines'] == 512
assert isd['image_samples'] == 1024
def test_detector_center(test_frame_driver):
isd = formatter.to_isd(test_frame_driver)
detector_center = isd['detector_center']
assert detector_center['line'] == 256
assert detector_center['sample'] == 512
def test_distortion(test_frame_driver):
isd = formatter.to_isd(test_frame_driver)
optical_distortion = isd['optical_distortion']
assert optical_distortion['radial']['coefficients'] == [0.0, 1.0, 0.1]
def test_radii(test_frame_driver):
isd = formatter.to_isd(test_frame_driver)
radii_obj = isd['radii']
assert radii_obj['semimajor'] == 1100
assert radii_obj['semiminor'] == 1000
assert radii_obj['unit'] == 'km'
def test_reference_height(test_frame_driver):
isd = formatter.to_isd(test_frame_driver)
reference_height = isd['reference_height']
assert reference_height['maxheight'] == 1000
assert reference_height['minheight'] == -1000
assert reference_height['unit'] == 'm'
def test_detector_start(test_frame_driver):
isd = formatter.to_isd(test_frame_driver)
assert isd['starting_detector_line'] == 0
assert isd['starting_detector_sample'] == 8
def test_starting_ephemeris_time(test_line_scan_driver):
isd = formatter.to_isd(test_line_scan_driver)
assert isd['starting_ephemeris_time'] == 800
def test_line_scan_rate(test_line_scan_driver):
isd = formatter.to_isd(test_line_scan_driver)
assert isd['line_scan_rate'] == [[0.5, -50, 0.01]]
def test_interpolation_method(test_line_scan_driver):
isd = formatter.to_isd(test_line_scan_driver)
assert isd['interpolation_method'] == 'lagrange'
def test_camera_version(driver):
meta_data = formatter.to_isd(driver)
assert meta_data['IsisCameraVersion'] == 1
def test_instrument_pointing(driver):
meta_data = formatter.to_isd(driver)
pointing = meta_data['InstrumentPointing']
assert pointing['TimeDependentFrames'] == [1000, 1]
assert pointing['ConstantFrames'] == [1010, 1000]
np.testing.assert_equal(pointing['ConstantRotation'], np.array([1., 0., 0., 0., 1., 0., 0., 0., 1.]))
assert pointing['CkTableStartTime'] == 800
assert pointing['CkTableEndTime'] == 900
assert pointing['CkTableOriginalSize'] == 2
np.testing.assert_equal(pointing['EphemerisTimes'], np.array([800, 900]))
np.testing.assert_equal(pointing['Quaternions'], np.array([[-1, 0, 0, 0], [-1, 0, 0, 0]]))
def test_instrument_position(driver):
meta_data = formatter.to_isd(driver)
position = meta_data['InstrumentPosition']
assert position['SpkTableStartTime'] == 850
assert position['SpkTableEndTime'] == 850
assert position['SpkTableOriginalSize'] == 1
np.testing.assert_equal(position['EphemerisTimes'], np.array([850]))
np.testing.assert_equal(position['Positions'], np.array([[0, 0.001, 0.002]]))
np.testing.assert_equal(position['Velocities'], np.array([[0, -0.001, -0.002]]))
def test_body_rotation(driver):
meta_data = formatter.to_isd(driver)
rotation = meta_data['BodyRotation']
assert rotation['TimeDependentFrames'] == [100, 1]
assert rotation['CkTableStartTime'] == 800
assert rotation['CkTableEndTime'] == 900
assert rotation['CkTableOriginalSize'] == 2
np.testing.assert_equal(rotation['EphemerisTimes'], np.array([800, 900]))
np.testing.assert_equal(rotation['Quaternions'], np.array([[-1, 0, 0, 0], [-1, 0, 0, 0]]))
def test_sun_position(driver):
meta_data = formatter.to_isd(driver)
position = meta_data['SunPosition']
assert position['SpkTableStartTime'] == 850
assert position['SpkTableEndTime'] == 850
assert position['SpkTableOriginalSize'] == 1
np.testing.assert_equal(position['EphemerisTimes'], np.array([850]))
np.testing.assert_equal(position['Positions'], np.array([[0.0, 0.001, 0.002]]))
np.testing.assert_equal(position['Velocities'], np.array([[0.0, -0.001, -0.002]]))
def test_naif_keywords(driver):
meta_data = formatter.to_isd(driver)
assert meta_data['NaifKeywords'] == {
'keyword_1' : 0,
'keyword_2' : 'test'
}
...@@ -9,187 +9,15 @@ import json ...@@ -9,187 +9,15 @@ import json
import unittest import unittest
from unittest.mock import MagicMock, PropertyMock, patch from unittest.mock import MagicMock, PropertyMock, patch
from conftest import get_image_label, get_image_kernels, convert_kernels, compare_dicts from conftest import get_isd, get_image_label, get_image_kernels, convert_kernels, compare_dicts
import ale import ale
from ale.drivers.selene_drivers import KaguyaTcPds3NaifSpiceDriver from ale.drivers.selene_drivers import KaguyaTcPds3NaifSpiceDriver
image_dict = { image_dict = {
# Kaguya TC1 'TC1S2B0_01_06691S820E0465' : get_isd("kaguyatc"),
'TC1S2B0_01_06691S820E0465' : { 'MVA_2B2_01_02329N002E0302' : get_isd("kaguyami")
'usgscsm': {
'radii': {
'semimajor': 1737.4,
'semiminor': 1737.4,
'unit': 'km'},
'sensor_position': {
'positions': np.array([[195490.61933009, 211972.79163854, -1766965.21759375],
[194934.34274256, 211332.14192709, -1767099.36601459],
[194378.02078141, 210691.44358962, -1767233.10640484],
[193821.65246371, 210050.69819792, -1767366.43865632],
[193265.23762617, 209409.90567475, -1767499.36279925],
[192708.77531467, 208769.0676026, -1767631.87872367]]),
'velocities': np.array([[-1069.71186948, -1231.97377674, -258.3672068 ],
[-1069.80166655, -1232.06495814, -257.58238805],
[-1069.89121909, -1232.15585752, -256.7975062 ],
[-1069.98052705, -1232.24647484, -256.01256158],
[-1070.06959044, -1232.3368101, -255.2275542 ],
[-1070.15840923, -1232.42686325, -254.44248439]]),
'unit': 'm'},
'sun_position': {
'positions': np.array([[9.50465237e+10, 1.15903815e+11, 3.78729685e+09]]),
'velocities': np.array([[285707.13474515, -232731.15884149, 592.91742112]]),
'unit': 'm'},
'sensor_orientation': {
'quaternions': np.array([[-0.19095485, -0.08452708, 0.88748467, -0.41080698],
[-0.19073945, -0.08442789, 0.88753312, -0.41082276],
[-0.19052404, -0.08432871, 0.88758153, -0.41083852],
[-0.19030862, -0.08422952, 0.88762988, -0.41085426],
[-0.19009352, -0.08412972, 0.88767854, -0.41086914],
[-0.18987892, -0.08402899, 0.88772773, -0.41088271]])},
'detector_sample_summing': 1,
'detector_line_summing': 1,
'focal_length_model': {
'focal_length': 72.45},
'detector_center': {
'line': 0.5,
'sample': 2048.0},
'starting_detector_line': 1,
'starting_detector_sample': .5,
'focal2pixel_lines': [0, 142.85714285714286, 0],
'focal2pixel_samples': [0, 0, -142.85714285714286],
'optical_distortion': {
'kaguyalism': {
'x': [-0.0009649900000000001, 0.00098441, 8.5773e-06, -3.7438e-06],
'y': [-0.0013796, 1.3502e-05, 2.7251e-06, -6.193800000000001e-06],
'boresight_x' : -0.0725,
'boresight_y' : 0.0214}},
'image_lines': 400,
'image_samples': 3208,
'name_platform': 'SELENE-M',
'name_sensor': 'Terrain Camera 1',
'reference_height': {
'maxheight': 1000,
'minheight': -1000,
'unit': 'm'},
'name_model': 'USGS_ASTRO_LINE_SCANNER_SENSOR_MODEL',
'interpolation_method': 'lagrange',
'line_scan_rate': [[0.5, -1.300000011920929, 0.006500000000000001]],
'starting_ephemeris_time': 292234259.82293594,
'center_ephemeris_time': 292234261.12293595,
't0_ephemeris': -1.300000011920929,
'dt_ephemeris': 0.5200000047683716,
't0_quaternion': -1.300000011920929,
'dt_quaternion': 0.5200000047683716
}
},
'MVA_2B2_01_02329N002E0302' : {
'usgscsm': {
"radii": {
"semimajor": 1737.4,
"semiminor": 1737.4,
"unit": "km"
},
"sensor_position": {
"positions":
[[1581631.170967984, 918816.7454749601, 17359.778053074166],
[1581653.6518666577, 918814.107469728, 15896.70384782562],
[1581675.125610955, 918810.8848940814, 14433.619458749732],
[1581695.5934041755, 918807.0763904197, 12970.525577080793],
[1581715.0540239091, 918802.6833137124, 11507.423371723235],
[1581733.5087290092, 918797.7043282809, 10044.31354866982],
[1581750.956214992, 918792.1408047304, 8581.197251839967],
[1581767.397120705, 918785.9920686551, 7118.075256110188],
[1581782.832060649, 918779.2574662118, 5654.948478420991],
[1581797.2597721093, 918771.9383358458, 4191.818019885403],
[1581810.6815028861, 918764.0333783475, 2728.6845793242946],
[1581823.0960200944, 918755.5439313636, 1265.5493310270317],
[1581834.5045334753, 918746.4686686409, -197.58704133484173],
[1581844.9058070402, 918736.8089392016, -1660.7233725491283],
[1581854.3010902032, 918726.5634377429, -3123.8589609802857]],
"velocities":
[[25.783286973637825, -2.6305942733908934, -1641.2662531260032],
[24.6541610233529, -3.2871454607723085, -1641.2783248089215],
[23.52502323352204, -3.943685198289895, -1641.289353750218],
[22.395874155219467, -4.600213174108102, -1641.2993399473512],
[21.26671464756069, -5.256728894126663, -1641.3082833954215],
[20.137545263644594, -5.913232045800747, -1641.3161840918588],
[19.008366863699095, -6.5697221353508475, -1641.3230420322975],
[17.87918004057494, -7.226198826543763, -1641.3288572140555],
[16.749985499845394, -7.88266171782453, -1641.3336296337216],
[15.620784065823575, -8.539110335934271, -1641.337359287963],
[14.491576292730104, -9.19554436926745, -1641.3400461741676],
[13.36236304437793, -9.85196332233081, -1641.3416902893532],
[12.23314487464595, -10.508366882000841, -1641.3422916309216],
[11.103922649257456, -11.164754553522712, -1641.341850196455],
[9.974696922853957, -11.821126023917325, -1641.3403659833964]],
"unit": "m"
},
"sun_position": {
"positions": [[108404801770.5306, 104307744789.75961, 3666393216.4922094]],
"velocities": [[257322.0926607856, -265899.8379709762, 700.5524232754503]],
"unit": "m"
},
"sensor_orientation": {
"quaternions":
[[0.6841290215141231, 0.18168313624920118, -0.6816280982629065, 0.18531555677620887],
[0.6838528388829476, 0.18161279386087273, -0.6819012144243979, 0.18539908744196368],
[0.6835758239500531, 0.18154309699572227, -0.6821746518347966, 0.18548299447195182],
[0.6832967471554302, 0.18147561929758188, -0.6824496703005432, 0.18556562837456525],
[0.6830162583395626, 0.18140960968119488, -0.6827257032744798, 0.18564740355713963],
[0.6827351210778349, 0.18134352304219054, -0.6830025370795092, 0.18572779932049618],
[0.6824529044894799, 0.1812773209250331, -0.6832809057747644, 0.18580573154704597],
[0.6821706589155502, 0.18121103113539608, -0.6835592153840321, 0.18588317130159213],
[0.681888970523384, 0.18114425688445818, -0.683837844473224, 0.1859569642217031],
[0.6816071682054932, 0.1810774530787411, -0.6841163595700203, 0.1860307254355251],
[0.681327502040239, 0.18100853678321963, -0.6843942771188167, 0.18610002155351393],
[0.6810480612976251, 0.1809392785030075, -0.6846720093765764, 0.18616862054008748],
[0.6807714840034947, 0.18086571980771243, -0.6849487531729829, 0.18623367980280572],
[0.6804965752593046, 0.18078957882144664, -0.6852248624334619, 0.1862966106856612],
[0.6802234034550377, 0.18071156643840802, -0.6854997575134238, 0.1863586155681002]]
},
"detector_sample_summing": 1,
"detector_line_summing": 1,
"focal_length_model": {
"focal_length": 65.4
},
"detector_center": {
"line": 0.5,
"sample": 483.5
},
"starting_detector_line": 0,
"starting_detector_sample": 0,
"focal2pixel_lines": [0, 76.92307692307692, 0],
"focal2pixel_samples": [0, 0, -76.92307692307692],
"optical_distortion": {
"kaguyalism": {
"x": [2.8912e-19, 0.00020899000000000002, 4.7727000000000006e-05],
"y": [-1.0119e-18, 0.0034982, 1.9597e-05],
"boresight_x": -0.0060,
"boresight_y": -0.0187
}
},
"image_lines": 960,
"image_samples": 962,
"name_platform": "SELENE MAIN ORBITER",
"name_sensor": "MULTIBAND IMAGER VISIBLE",
"reference_height": {
"maxheight": 1000,
"minheight": -1000,
"unit": "m"
},
"name_model": "USGS_ASTRO_LINE_SCANNER_SENSOR_MODEL",
"interpolation_method": "lagrange",
"line_scan_rate": [[0.5, -6.239987522363663, 0.012999974000000001]],
"starting_ephemeris_time": 261664552.50899568,
"center_ephemeris_time": 261664558.7489832,
"t0_ephemeris": -6.239987522363663,
"dt_ephemeris": 0.8914267889090947,
"t0_quaternion": -6.239987522363663,
"dt_quaternion": 0.8914267889090947
}
}
} }
...@@ -206,16 +34,16 @@ def test_kernels(): ...@@ -206,16 +34,16 @@ def test_kernels():
os.remove(kern) os.remove(kern)
@pytest.mark.parametrize("label_type", ['pds3']) @pytest.mark.parametrize("label_type", ['pds3'])
@pytest.mark.parametrize("formatter", ['usgscsm'])
@pytest.mark.parametrize("image", image_dict.keys()) @pytest.mark.parametrize("image", image_dict.keys())
def test_kaguya_load(test_kernels, label_type, formatter, image): def test_kaguya_load(test_kernels, label_type, image):
label_file = get_image_label(image, label_type) label_file = get_image_label(image, label_type)
usgscsm_isd_str = ale.loads(label_file, props={'kernels': test_kernels[image]}, formatter=formatter) isd_str = ale.loads(label_file, props={'kernels': test_kernels[image]})
usgscsm_isd_obj = json.loads(usgscsm_isd_str) isd_obj = json.loads(isd_str)
print(json.dumps(usgscsm_isd_obj, indent=2)) print(json.dumps(isd_obj, indent=2))
assert compare_dicts(isd_obj, image_dict[image]) == []
assert compare_dicts(usgscsm_isd_obj, image_dict[image][formatter]) == []
# ========= Test pdslabel and naifspice driver ========= # ========= Test pdslabel and naifspice driver =========
class test_pds_naif(unittest.TestCase): class test_pds_naif(unittest.TestCase):
......
...@@ -106,7 +106,7 @@ class TestDriver(Driver, NaifSpice): ...@@ -106,7 +106,7 @@ class TestDriver(Driver, NaifSpice):
return 100 return 100
@property @property
def naif_keywords(self): def isis_naif_keywords(self):
return { return {
'keyword_1' : 0, 'keyword_1' : 0,
'keyword_2' : 'test' 'keyword_2' : 'test'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment