Skip to content
Snippets Groups Projects
Unverified Commit 82b3d45b authored by Anton Hibl's avatar Anton Hibl Committed by GitHub
Browse files

Adding Ale dawn framing camera driver for ISIS3 Labels (#567)


* added dawn driver, tests need to be adjusted to use pds and isis driver

* updating tests for isis3label driver

* updated import dependencies

* updated import dependencies again

* updated ephemeris timings

* updating tests a bit more

* adding a test label for isis3 driver tests

* fixes to exposure duration references

* adding isis label ISD

* test data updates

* testing changes

* Fixed pds3 load test truth data

* Updated needed transfer kernels

* Removed unnecessary kernels

* Adds fail state to instrument_id property

* adding changelog comments for addition of isis dawnfc driver

---------

Co-authored-by: default avataracpaquette <acp263@nau.edu>
parent a06a2788
No related branches found
No related tags found
No related merge requests found
Showing
with 25740 additions and 6044 deletions
...@@ -37,6 +37,11 @@ release. ...@@ -37,6 +37,11 @@ release.
### Added ### Added
- Mariner10 IsisLabelNaifSpice driver, tests, and test data [#547](https://github.com/DOI-USGS/ale/pull/547) - Mariner10 IsisLabelNaifSpice driver, tests, and test data [#547](https://github.com/DOI-USGS/ale/pull/547)
- DawnFC IsisLabelNaifSpice driver, tests, and test data [#567](https://github.com/DOI-USGS/ale/pull/567)
### Fixed
- Fixed LRO MiniRF drivers naif keywords focal to pixel and pixel to focal translations to be correct. [#563](https://github.com/DOI-USGS/ale/pull/563)
## [0.9.1] - 2023-06-05 ## [0.9.1] - 2023-06-05
......
...@@ -6,8 +6,10 @@ from glob import glob ...@@ -6,8 +6,10 @@ from glob import glob
import ale import ale
from ale.base import Driver from ale.base import Driver
from ale.base.label_isis import IsisLabel
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.type_distortion import NoDistortion
from ale.base.type_sensor import Framer from ale.base.type_sensor import Framer
ID_LOOKUP = { ID_LOOKUP = {
...@@ -199,3 +201,195 @@ class DawnFcPds3NaifSpiceDriver(Framer, Pds3Label, NaifSpice, Driver): ...@@ -199,3 +201,195 @@ class DawnFcPds3NaifSpiceDriver(Framer, Pds3Label, NaifSpice, Driver):
center detector line center detector line
""" """
return float(spice.gdpool('INS{}_CCD_CENTER'.format(self.ikid), 0, 2)[1]) + 0.5 return float(spice.gdpool('INS{}_CCD_CENTER'.format(self.ikid), 0, 2)[1]) + 0.5
class DawnFcIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, NoDistortion, Driver):
"""
Driver for reading Dawn ISIS3 Labels. These are Labels that have been ingested
into ISIS from PDS EDR images but have not been spiceinit'd yet.
"""
@property
def instrument_id(self):
"""
Returns an instrument id for uniquely identifying the instrument,
but often also used to be piped into Spice Kernels to acquire
IKIDS. Therefor they are the same ID that Spice expects in bods2c
calls. Expect instrument_id to be defined in the IsisLabel mixin.
This should be a string of the form
Returns
-------
: str
instrument id
"""
if not hasattr(self, "_instrument_id"):
instrument_id = super().instrument_id
filter_number = self.filter_number
self._instrument_id = "{}_FILTER_{}".format(ID_LOOKUP[instrument_id], filter_number)
return self._instrument_id
@property
def filter_number(self):
"""
Returns the instrument filter number from the ISIS bandbin group.
This filter number is used in the instrument id to identify
which filter was used when aquiring the data.
Returns
-------
: int
The filter number from the instrument
"""
return self.label["IsisCube"]["BandBin"]["FilterNumber"]
@property
def spacecraft_name(self):
"""
Returns the name of the spacecraft
Returns
-------
: str
spacecraft name
"""
return self.label["IsisCube"]["Instrument"]["SpacecraftName"]
@property
def sensor_name(self):
"""
Returns the sensor name
Returns
-------
: str
sensor name
"""
return self.instrument_id
@property
def sensor_model_version(self):
"""
Returns ISIS sensor model version
Returns
-------
: int
ISIS sensor model version
"""
return 1
@property
def ikid(self):
"""
Overridden to grab the ikid from the Isis Cube since there is no way to
obtain this value with a spice bods2c call. Isis sets this value during
ingestion, based on the original fits file.
Returns
-------
: int
Naif ID used to for identifying the instrument in Spice kernels
"""
return self.label["IsisCube"]["Kernels"]["NaifFrameCode"]
def filter_name(self):
"""
Returns the filter used to identify the image
Returns
-------
: str
filter name
"""
return self.label["IsisCube"]["BandBin"]["FilterName"]
@property
def detector_center_sample(self):
"""
Returns center detector sample acquired from Spice Kernels.
Expects ikid to be defined. This should be the integer Naif ID code for
the instrument.
We have to add 0.5 to the CCD Center because the Dawn IK defines the
detector pixels as 0.0 being the center of the first pixel so they are
-0.5 based.
Returns
-------
: float
center detector sample
"""
return float(spice.gdpool('INS{}_CCD_CENTER'.format(self.ikid), 0, 2)[0]) + 0.5
@property
def detector_center_line(self):
"""
Returns center detector line acquired from Spice Kernels.
Expects ikid to be defined. This should be the integer Naif ID code for
the instrument.
We have to add 0.5 to the CCD Center because the Dawn IK defines the
detector pixels as 0.0 being the center of the first pixel so they are
-0.5 based.
Returns
-------
: float
center detector line
"""
return float(spice.gdpool('INS{}_CCD_CENTER'.format(self.ikid), 0, 2)[1]) + 0.5
@property
def ephemeris_start_time(self):
"""
Compute the starting ephemeris time for a Dawn Frame camera. This is done
via a spice call but 193 ms needs to be added to
account for the CCD being discharged or cleared.
Returns
-------
: float
ephemeris start time
"""
if not hasattr(self, '_ephemeris_start_time'):
sclock = self.spacecraft_clock_start_count
self._ephemeris_start_time = spice.scs2e(self.spacecraft_id, sclock)
self._ephemeris_start_time += 193.0 / 1000.0
return self._ephemeris_start_time
@property
def exposure_duration_ms(self):
"""
Return the exposure duration in ms for a Dawn Frame camera.
Returns
-------
: float
exposure duration
"""
return self.exposure_duration / 1000
@property
def ephemeris_stop_time(self):
"""
Compute the ephemeris stop time for a Dawn Frame camera
Returns
-------
: float
ephemeris stop time
"""
return self.ephemeris_start_time + self.exposure_duration_ms
@property
def ephemeris_center_time(self):
"""
Compute the center ephemeris time for a Dawn Frame camera.
Returns
-------
: float
center ephemeris time
"""
return self.ephemeris_start_time + (self.exposure_duration_ms / 2.0)
File mode changed from 100644 to 100755
Object = IsisCube
Object = Core
StartByte = 65537
Format = Tile
TileSamples = 512
TileLines = 512
Group = Dimensions
Samples = 1024
Lines = 1024
Bands = 1
End_Group
Group = Pixels
Type = Real
ByteOrder = Lsb
Base = 0.0
Multiplier = 1.0
End_Group
End_Object
Group = Instrument
SpacecraftName = DAWN
InstrumentId = FC2
SpacecraftClockStartCount = 488002612:246
SpacecraftClockStopCount = 488002614:244
StartTime = 2015-170T16:15:46.345
StopTime = 2015-170T16:15:48.337
ExposureDuration = 1800.000 <millisecond>
PixelAveragingWidth = 1
PixelAveragingHeight = 1
TargetName = CERES
OriginalTargetName = "1 CERES"
OrbitNumber = 0
FirstLine = 17
FirstLineSample = 35
End_Group
Group = Archive
FileName = FC21A0038582_15170161546F6G.IMG
SoftwareName = TRAP
SoftwareVersionId = "Trap v4.16"
DataSetName = "DAWN FC2 RAW (EDR) CERES IMAGES V1.0"
DataSetId = DAWN-A-FC2-2-EDR-CERES-IMAGES-V1.0
ProductId = 0038582
ProductType = DATA
StandardDataProductId = FC_IMAGE
ObservationId = FC2_CSS_C5NadirSouthColor_001
ProducerFullName = "PABLO GUTIERREZ-MARQUES"
ProducerInstitutionName = "MAX PLANCK INSTITUT FUER SONNENSYSTEMFORSCHUNG"
ProductCreationTime = 2017-11-25T21:56:50.000
ProductVersionId = G
ReleaseId = N/A
End_Group
Group = BandBin
FilterNumber = 6
Center = 829
Width = 33
FilterName = NIR_F6
End_Group
Group = Kernels
NaifFrameCode = -203126
LeapSecond = $base/kernels/lsk/naif0012.tls
TargetAttitudeShape = ($base/kernels/pck/pck00009.tpc,
$dawn/kernels/pck/dawn_ceres_SPG20160107.tpc,
$dawn/kernels/pck/dawn_ceres_v00.tf)
TargetPosition = (Table, $dawn/kernels/tspk/de421.bsp,
$dawn/kernels/tspk/sb_ceres_140724.bsp)
InstrumentPointing = (Table,
$dawn/kernels/ck/dawn_sc_150615_150621.bc,
$dawn/kernels/fk/dawn_v15.tf,
$dawn/kernels/fk/dawn_fc_v3.bc)
Instrument = $dawn/kernels/ik/dawn_fc_v10.ti
SpacecraftClock = $dawn/kernels/sclk/DAWN_203_SCLKSCET.00091.tsc
InstrumentPosition = (Table,
$dawn/kernels/spk/dawn_rec_150509-150630_1507-
30_v1.bsp)
InstrumentAddendum = $dawn/kernels/iak/dawnfcAddendum002.ti
ShapeModel = $base/dems/Ceres_Dawn_FC_HAMO_DTM_DLR_Global_-
60ppd_Oct2016_prep.cub
InstrumentPositionQuality = Reconstructed
InstrumentPointingQuality = Reconstructed
CameraVersion = 2
Source = isis
End_Group
End_Object
Object = Label
Bytes = 65536
End_Object
Object = Table
Name = InstrumentPointing
StartByte = 4272584
Bytes = 64
Records = 1
ByteOrder = Lsb
TimeDependentFrames = (-203120, -203000, 1)
ConstantFrames = (-203126, -203120)
ConstantRotation = (1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0)
CkTableStartTime = 488002614.62294
CkTableEndTime = 488002614.62294
CkTableOriginalSize = 1
FrameTypeCode = 3
Description = "Created by spiceinit"
Kernels = ($dawn/kernels/ck/dawn_sc_150615_150621.bc,
$dawn/kernels/fk/dawn_v15.tf,
$dawn/kernels/fk/dawn_fc_v3.bc)
Group = Field
Name = J2000Q0
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Q1
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Q2
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Q3
Type = Double
Size = 1
End_Group
Group = Field
Name = AV1
Type = Double
Size = 1
End_Group
Group = Field
Name = AV2
Type = Double
Size = 1
End_Group
Group = Field
Name = AV3
Type = Double
Size = 1
End_Group
Group = Field
Name = ET
Type = Double
Size = 1
End_Group
End_Object
Object = Table
Name = InstrumentPosition
StartByte = 4272648
Bytes = 56
Records = 1
ByteOrder = Lsb
CacheType = Linear
SpkTableStartTime = 488002614.62294
SpkTableEndTime = 488002614.62294
SpkTableOriginalSize = 1.0
Description = "Created by spiceinit"
Kernels = $dawn/kernels/spk/dawn_rec_150509-150630_150730_v1.b-
sp
Group = Field
Name = J2000X
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Y
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Z
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000XV
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000YV
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000ZV
Type = Double
Size = 1
End_Group
Group = Field
Name = ET
Type = Double
Size = 1
End_Group
End_Object
Object = Table
Name = BodyRotation
StartByte = 4272704
Bytes = 64
Records = 1
ByteOrder = Lsb
TimeDependentFrames = (2000001, 1)
CkTableStartTime = 488002614.62294
CkTableEndTime = 488002614.62294
CkTableOriginalSize = 1
FrameTypeCode = 2
PoleRa = (291.431, 0.0, 0.0)
PoleDec = (66.761, 0.0, 0.0)
PrimeMeridian = (170.488, 952.15323, 0.0)
Description = "Created by spiceinit"
Kernels = ($dawn/kernels/tspk/de421.bsp,
$dawn/kernels/tspk/sb_ceres_140724.bsp,
$base/kernels/pck/pck00009.tpc,
$dawn/kernels/pck/dawn_ceres_SPG20160107.tpc,
$dawn/kernels/pck/dawn_ceres_v00.tf)
SolarLongitude = 83.441085180005
Group = Field
Name = J2000Q0
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Q1
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Q2
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Q3
Type = Double
Size = 1
End_Group
Group = Field
Name = AV1
Type = Double
Size = 1
End_Group
Group = Field
Name = AV2
Type = Double
Size = 1
End_Group
Group = Field
Name = AV3
Type = Double
Size = 1
End_Group
Group = Field
Name = ET
Type = Double
Size = 1
End_Group
End_Object
Object = Table
Name = SunPosition
StartByte = 4272768
Bytes = 56
Records = 1
ByteOrder = Lsb
CacheType = Linear
SpkTableStartTime = 488002614.62294
SpkTableEndTime = 488002614.62294
SpkTableOriginalSize = 1.0
Description = "Created by spiceinit"
Kernels = ($dawn/kernels/tspk/de421.bsp,
$dawn/kernels/tspk/sb_ceres_140724.bsp)
Group = Field
Name = J2000X
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Y
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Z
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000XV
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000YV
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000ZV
Type = Double
Size = 1
End_Group
Group = Field
Name = ET
Type = Double
Size = 1
End_Group
End_Object
Object = History
Name = IsisCube
StartByte = 4272824
Bytes = 2010
End_Object
Object = OriginalLabel
Name = IsisCube
StartByte = 4259841
Bytes = 11656
End_Object
Object = NaifKeywords
BODY_CODE = 2000001
BODY2000001_RADII = (482.0, 482.0, 446.0)
BODY_FRAME_CODE = 2000001
INS-203126_FOCAL_LENGTH = 150.08
INS-203126_PIXEL_SIZE = (14.004, 13.995)
INS-203126_TRANSX = (0.0, 0.0140088, 0.0)
INS-203126_TRANSY = (0.0, 0.0, 0.014)
INS-203126_ITRANSS = (0.0, 71.383701673234, 0.0)
INS-203126_ITRANSL = (0.0, 0.0, 71.428571428571)
INS-203126_CCD_CENTER = (511.5, 511.5)
INS-203126_RAD_DIST_COEFF = 9.2e-06
CLOCK_ET_-203_488002612:246_COMPUTED = 76aa87355416bd41
End_Object
End
KPL/PCK
Asteroid Ceres SPICE PCK file, DAWN SPG 2016-01-07 Solution
===========================================================================
Pedigree and Intended Usage
--------------------------------------------------------
This PCK file contains Ceres rotation values that were determined
during the stereo photogrammetric analysis of Dawn images during
the creation of the HAMO DTM (see [1]). Users of this DTM should
also use this planetary constants kernel for SPICE based image
processing.
Organization
--------------------------------------------------------
The sections of this file are as follows.
Introductory Information:
-- Version description
-- Disclaimer
-- Sources
Pck Data:
-- Orientation constants for asteroid Ceres
-- Radii for asteroid Ceres
-- GM for asteroid Ceres
Version Description
--------------------------------------------------------
Version 1.0 -- August 29, 2016 -- Steve Joy, IGPP/UCLA
Boris Semenov, NAIF/JPL
Initial version.
Disclaimer
--------------------------------------------------------
This constants file may not contain the parameter values that you
prefer. Note that this file may be readily modified by you or
anyone else. NAIF suggests that you inspect this file visually
before proceeding with any critical or extended data processing.
NAIF requests that you update the ``Version Description'' section
if you modify the file.
Sources
--------------------------------------------------------
The sources for the constants listed in this are:
1) ``Dawn at Ceres - Shape Model and Rotational State'',
Frank Preusker, et al., Lunar and Planet. Sci.
Conf. abs. 1954, 2016.
2) Official DAWN project PCK ``dawn_ceres_v05.tpc''
Orientation constants for asteroid Ceres
--------------------------------------------------------
The inertial reference frame for Ceres constants is J2000; this is
the default reference frame for PCK orientation data.
The epoch of the constants is J2000; this is Julian ephemeris date
(JED) 2451545.0.
The NAIF integer code for Ceres is 2000001. See the NAIF_IDs
required reading for further information on NAIF integer codes.
The Ceres rotation constants provided below are from [1].
\begindata
BODY2000001_POLE_RA = ( 291.431 0.0 0.0 )
BODY2000001_POLE_DEC = ( 66.761 0.0 0.0 )
BODY2000001_PM = ( 170.488 952.15323 0.0 )
\begintext
Radii for asteroid Ceres
--------------------------------------------------------
The Ceres radii values provided below are from [2]. They are
included in this PCK for completeness.
\begindata
BODY2000001_RADII = ( 482 482 446 )
\begintext
GM for asteroid Ceres
--------------------------------------------------------
The Ceres GM value provided below is from [2]. It is included in
this PCK for completeness.
\begindata
BODY2000001_GM = ( 62.6325 )
\begintext
End of PCK file.
KPL/FK
Dawn Frames Kernel for Asteroid Ceres
========================================================================
This frame kernel contains definition of the body-fixed frame for
asteroid Ceres.
Version and Date
========================================================================
Version 0.0 -- May 9, 2005 -- Boris Semenov, NAIF
Preliminary Version.
References
========================================================================
1. ``Frames Required Reading''
2. ``Kernel Pool Required Reading''
3. ``PC-Kernel Required Reading''
Contact Information
========================================================================
Boris V. Semenov, NAIF/JPL, (818)-354-8136, boris.semenov@jpl.nasa.gov
Implementation Notes
========================================================================
This file is used by the SPICE system as follows: programs that make
use of this frame kernel must `load' the kernel, normally during
program initialization. The SPICELIB routine FURNSH and CSPICE
function furnsh_c load a kernel file into the kernel pool as shown
below.
CALL FURNSH ( 'frame_kernel_name' )
furnsh_c ( "frame_kernel_name" );
This file was created and may be updated with a text editor or word
processor.
Dawn Frames
========================================================================
The following Dawn frames are defined in this kernel file:
Name Relative to Type NAIF ID
====================== =================== ============ =======
Dawn Target frames:
-------------------
CERES_FIXED J2000 PCK 2000001
Dawn Target Frames
========================================================================
This section of the file contains the body-fixed frame definition
for one of the Dawn mission targets -- asteroids 1 Ceres.
A body-fixed frame is defined for Ceres using standard body-fixed,
PCK-based frame formation rules:
- +Z axis is toward the North pole;
- +X axis is toward the prime meridian;
- +Y axis completes the right hand frame;
- the origin of this frame is at the center of the body.
The orientation of this frame is computed by evaluating
corresponding rotation constants provided in the PCK file(s).
\begindata
FRAME_CERES_FIXED = 2000001
FRAME_2000001_NAME = 'CERES_FIXED'
FRAME_2000001_CLASS = 2
FRAME_2000001_CLASS_ID = 2000001
FRAME_2000001_CENTER = 2000001
OBJECT_2000001_FRAME = 'CERES_FIXED'
\begintext
KPL/IK KPL/IK
\beginlabel
PDS_VERSION_ID = PDS3
RECORD_TYPE = STREAM
RECORD_BYTES = "N/A"
^SPICE_KERNEL = "dawn_fc_v10.ti"
MISSION_NAME = "DAWN MISSION TO VESTA AND CERES"
SPACECRAFT_NAME = DAWN
DATA_SET_ID = "DAWN-M/A-SPICE-6-V1.0"
KERNEL_TYPE_ID = IK
PRODUCT_ID = "dawn_fc_v10.ti"
PRODUCT_CREATION_TIME = 2013-09-04T14:53:10
PRODUCER_ID = "FC TEAM/MPS"
MISSION_PHASE_NAME = {
"INITIAL CHECKOUT (ICO)",
"EARTH-MARS CRUISE (EMC)",
"MARS GRAVITY ASSIST (MGA)",
"MARS-VESTA CRUISE (MVC)",
"VESTA ENCOUNTER",
"VESTA-CERES CRUISE (VCC)",
"CERES ENCOUNTER",
"END OF MISSION"
}
PRODUCT_VERSION_TYPE = ACTUAL
PLATFORM_OR_MOUNTING_NAME = "DAWN SPACECRAFT"
START_TIME = "N/A"
STOP_TIME = "N/A"
SPACECRAFT_CLOCK_START_COUNT = "N/A"
SPACECRAFT_CLOCK_STOP_COUNT = "N/A"
TARGET_NAME = {
"4 VESTA",
"1 CERES"
}
INSTRUMENT_NAME = {
"FRAMING CAMERA 1",
"FRAMING CAMERA 2"
}
NAIF_INSTRUMENT_ID = {
-203129,
-203128,
-203127,
-203126,
-203125,
-203124,
-203123,
-203122,
-203121,
-203120,
-203119,
-203118,
-203117,
-203116,
-203115,
-203114,
-203113,
-203112,
-203111,
-203110
}
SOURCE_PRODUCT_ID = "N/A"
NOTE = "See comments in the file for details"
OBJECT = SPICE_KERNEL
INTERCHANGE_FORMAT = ASCII
KERNEL_TYPE = INSTRUMENT
DESCRIPTION = "DAWN SPICE IK file for the Framing Cameras
(FC) providing FOV definition and other geometric parameters for the
instrument, created by the FC Team, MPS and NAIF, JPL. "
END_OBJECT = SPICE_KERNEL
\endlabel
Dawn Framing Camera Instrument kernel Dawn Framing Camera Instrument kernel
============================================================================== ==============================================================================
......
...@@ -5,27 +5,27 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE ...@@ -5,27 +5,27 @@ DAFETF NAIF DAF ENCODED TRANSFER FILE
'DAWN FC ALIGNMENT ' 'DAWN FC ALIGNMENT '
BEGIN_ARRAY 1 10 BEGIN_ARRAY 1 10
'DAWN FC2 ALIGNMENT, 10/22/15 ' 'DAWN FC2 ALIGNMENT, 10/22/15 '
'1D164E7A02^A' '1D164E0701^A'
'1D165154AC^A' '1D165BE029^A'
'-31970' '-31970'
'-318F8' '-318F8'
'2' '2'
'1' '1'
10 10
'FFFFE89764F228^0' 'FFFFE89764F228^0'
'-19D0E9E6478CB6^-2' '-19D0E9E6478CB5^-2'
'62A2E9911F8D98^-2' '62A2E9911F8D94^-2'
'27DEA9760525CA^-2' '27DEA9760525C8^-2'
'0^0' '0^0'
'0^0' '0^0'
'0^0' '0^0'
'1000000602F071^-1' '1000000602F071^-1'
'1D164E7A02^A' '1D164E0701^A'
'1D165154AC^A' '1D165BE029^A'
END_ARRAY 1 10 END_ARRAY 1 10
TOTAL_ARRAYS 1 TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~ ~NAIF/SPC BEGIN COMMENTS~
This CK is for testing with the image: /home/pgiroux/Desktop/FC21A0038582_15170161546F6F.cub This CK is for testing with the image: ../tests/pytests/data/FC21A0038582_15170161546F6F/FC21A0038582_15170161546F6G_isis3.lbl
This CK was generated using the following command: {} This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~ ~NAIF/SPC END COMMENTS~
DAFETF NAIF DAF ENCODED TRANSFER FILE
'DAF/CK '
'2'
'6'
'DAWN FC ALIGNMENT '
BEGIN_ARRAY 1 10
'DAWN FC2 ALIGNMENT, 10/22/15 '
'1D16542FF6^A'
'1D165709F6^A'
'-31970'
'-318F8'
'2'
'1'
10
'FFFFE89764F228^0'
'-19D0E9E6478CB6^-2'
'62A2E9911F8D98^-2'
'27DEA9760525CA^-2'
'0^0'
'0^0'
'0^0'
'1000000602F071^-1'
'1D16542FF6^A'
'1D165709F6^A'
END_ARRAY 1 10
TOTAL_ARRAYS 1
~NAIF/SPC BEGIN COMMENTS~
This CK is for testing with the image: /home/pgiroux/Desktop/FC21A0038582_15170161546F6F.cub
This CK was generated using the following command: {}
~NAIF/SPC END COMMENTS~
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
This diff is collapsed.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
482.0, 482.0,
446.0 446.0
], ],
"BODY_FRAME_CODE": 10101, "BODY_FRAME_CODE": 2000001,
"BODY_CODE": 2000001, "BODY_CODE": 2000001,
"TKFRAME_-203126_SPEC": "ANGLES", "TKFRAME_-203126_SPEC": "ANGLES",
"INS-203126_FOV_FRAME": "DAWN_FC2", "INS-203126_FOV_FRAME": "DAWN_FC2",
...@@ -86,11 +86,16 @@ ...@@ -86,11 +86,16 @@
3.0 3.0
], ],
"BODY2000001_GM": 62.6325, "BODY2000001_GM": 62.6325,
"FRAME_2000001_CENTER": 2000001.0,
"FRAME_2000001_NAME": "CERES_FIXED",
"OBJECT_2000001_FRAME": "CERES_FIXED",
"FRAME_2000001_CLASS": 2.0,
"BODY2000001_PM": [ "BODY2000001_PM": [
170.65, 170.65,
952.1532, 952.1532,
0.0 0.0
], ],
"FRAME_2000001_CLASS_ID": 2000001.0,
"BODY2000001_POLE_DEC": [ "BODY2000001_POLE_DEC": [
66.764, 66.764,
0.0, 0.0,
...@@ -193,7 +198,7 @@ ...@@ -193,7 +198,7 @@
"body_rotation": { "body_rotation": {
"reference_frame" : 1, "reference_frame" : 1,
"time_dependent_frames": [ "time_dependent_frames": [
10101, 2000001,
1 1
], ],
"ck_table_start_time": 488002614.62294483, "ck_table_start_time": 488002614.62294483,
......
{
"isis_camera_version": 1,
"image_lines": 1024,
"image_samples": 1024,
"name_platform": "DAWN",
"name_sensor": "DAWN_FC2_FILTER_6",
"reference_height": {
"maxheight": 1000,
"minheight": -1000,
"unit": "m"
},
"name_model": "USGS_ASTRO_FRAME_SENSOR_MODEL",
"center_ephemeris_time": 488002614.62294483,
"radii": {
"semimajor": 482.0,
"semiminor": 446.0,
"unit": "km"
},
"body_rotation": {
"time_dependent_frames": [
2000001,
1
],
"ck_table_start_time": 488002614.62294483,
"ck_table_end_time": 488002614.62294483,
"ck_table_original_size": 1,
"ephemeris_times": [
488002614.62294483
],
"quaternions": [
[
-0.7323907260895571,
0.1890116253358707,
-0.06950386369161242,
0.6504211272382237
]
],
"angular_velocities": [
[
2.770977343153026e-05,
-7.064167352871139e-05,
0.00017673919183794291
]
],
"reference_frame": 1
},
"instrument_pointing": {
"time_dependent_frames": [
-203120,
-203000,
1
],
"ck_table_start_time": 488002614.62294483,
"ck_table_end_time": 488002614.62294483,
"ck_table_original_size": 1,
"ephemeris_times": [
488002614.62294483
],
"quaternions": [
[
0.5213647259158682,
-0.17475033868107043,
0.13616771930072985,
-0.8240749322251953
]
],
"angular_velocities": [
[
-2.0163095864499935e-05,
2.0665280555081777e-08,
3.996105121476586e-06
]
],
"reference_frame": 1,
"constant_frames": [
-203126,
-203120
],
"constant_rotation": [
1.0,
0.0,
0.0,
0.0,
1.0,
0.0,
0.0,
0.0,
1.0
]
},
"naif_keywords": {
"BODY2000001_RADII": [
482.0,
482.0,
446.0
],
"BODY_FRAME_CODE": 2000001,
"BODY_CODE": 2000001,
"TKFRAME_-203126_SPEC": "ANGLES",
"INS-203126_FOV_FRAME": "DAWN_FC2",
"INS-203126_PIXEL_SIZE": [
14.004,
13.995
],
"INS-203126_FOV_CLASS_SPEC": "ANGLES",
"TKFRAME_-203126_RELATIVE": "DAWN_FC2",
"INS-203126_ITRANSL": [
0.0,
0.0,
71.42857142857143
],
"INS-203126_IFOV": [
9.3238e-05,
9.3179e-05
],
"INS-203126_FOV_REF_VECTOR": [
1.0,
0.0,
0.0
],
"INS-203126_ITRANSS": [
0.0,
71.38370167323397,
0.0
],
"FRAME_-203126_NAME": "DAWN_FC2_FILTER_6",
"INS-203126_BANDCENTER": 829.0,
"TKFRAME_-203126_UNITS": "DEGREES",
"FRAME_-203126_CLASS_ID": -203126.0,
"INS-203126_TRANSX": [
0.0,
0.0140088,
0.0
],
"INS-203126_TRANSY": [
0.0,
0.0,
0.014
],
"INS-203126_FOV_ANGLE_UNITS": "DEGREES",
"INS-203126_PIXEL_LINES": 1024.0,
"INS-203126_FOV_REF_ANGLE": 2.7351859,
"TKFRAME_-203126_ANGLES": [
0.0,
0.0,
0.0
],
"FRAME_-203126_CENTER": -203.0,
"INS-203126_CCD_CENTER": [
511.5,
511.5
],
"INS-203126_FOV_ANGULAR_SIZE": [
0.095476,
0.095416
],
"INS-203126_F/RATIO": 7.5,
"INS-203126_FOCAL_LENGTH": 150.08,
"INS-203126_FOV_CROSS_ANGLE": 2.733467,
"INS-203126_BANDWIDTH": 36.0,
"INS-203126_BORESIGHT": [
0.0,
0.0,
150.08
],
"INS-203126_RAD_DIST_COEFF": 9.2e-06,
"INS-203126_PIXEL_SAMPLES": 1024.0,
"INS-203126_FOV_SHAPE": "RECTANGLE",
"FRAME_-203126_CLASS": 4.0,
"INS-203126_EFF_WAVELENGTH": 829.0,
"TKFRAME_-203126_AXES": [
1.0,
2.0,
3.0
],
"BODY2000001_GM": 62.6325,
"FRAME_2000001_CENTER": 2000001.0,
"FRAME_2000001_NAME": "CERES_FIXED",
"OBJECT_2000001_FRAME": "CERES_FIXED",
"FRAME_2000001_CLASS": 2.0,
"BODY2000001_PM": [
170.65,
952.1532,
0.0
],
"FRAME_2000001_CLASS_ID": 2000001.0,
"BODY2000001_POLE_DEC": [
66.764,
0.0,
0.0
],
"BODY2000001_POLE_RA": [
291.418,
0.0,
0.0
]
},
"detector_sample_summing": 1,
"detector_line_summing": 1,
"focal_length_model": {
"focal_length": 150.08
},
"detector_center": {
"line": 512.0,
"sample": 512.0
},
"focal2pixel_lines": [
0.0,
0.0,
71.42857142857143
],
"focal2pixel_samples": [
0.0,
71.38370167323397,
0.0
],
"optical_distortion": {
"radial": {
"coefficients": [
0.0,
0.0,
0.0
]
}
},
"starting_detector_line": 0,
"starting_detector_sample": 0,
"instrument_position": {
"spk_table_start_time": 488002614.62294483,
"spk_table_end_time": 488002614.62294483,
"spk_table_original_size": 1,
"ephemeris_times": [
488002614.62294483
],
"positions": [
[
-678.145360419934,
2026.1409618562566,
-4375.770027129584
]
],
"velocities": [
[
0.01836093913952242,
-0.10035442890342972,
-0.04929136913284714
]
],
"reference_frame": 1
},
"sun_position": {
"spk_table_start_time": 488002614.62294483,
"spk_table_end_time": 488002614.62294483,
"spk_table_original_size": 1,
"ephemeris_times": [
488002614.62294483
],
"positions": [
[
-184987783.06715,
343341745.2043138,
199532284.61700404
]
],
"velocities": [
[
-15.334993792176247,
-7.083164572559297,
-0.21518329562060534
]
],
"reference_frame": 1
}
}
\ No newline at end of file
...@@ -7,10 +7,12 @@ import json ...@@ -7,10 +7,12 @@ import json
import unittest import unittest
from unittest.mock import patch from unittest.mock import patch
from ale.drivers import AleJsonEncoder
from conftest import get_image_label, get_image_kernels, get_isd, convert_kernels, compare_dicts from conftest import get_image_label, get_image_kernels, get_isd, convert_kernels, compare_dicts
import ale import ale
from ale.drivers.dawn_drivers import DawnFcPds3NaifSpiceDriver from ale.drivers.dawn_drivers import DawnFcPds3NaifSpiceDriver, DawnFcIsisLabelNaifSpiceDriver
@pytest.fixture(scope="module", autouse=True) @pytest.fixture(scope="module", autouse=True)
def test_kernels(): def test_kernels():
...@@ -20,13 +22,20 @@ def test_kernels(): ...@@ -20,13 +22,20 @@ def test_kernels():
for kern in binary_kernels: for kern in binary_kernels:
os.remove(kern) os.remove(kern)
def test_load(test_kernels): @pytest.mark.parametrize("label_type", ['pds3', 'isis3'])
label_file = get_image_label('FC21A0038582_15170161546F6F') def test_load(test_kernels, label_type):
if label_type == 'isis3':
label_prefix_file = "FC21A0038582_15170161546F6G"
compare_dict = get_isd("dawnfc_isis")
else:
label_prefix_file = "FC21A0038582_15170161546F6F"
compare_dict = get_isd("dawnfc") compare_dict = get_isd("dawnfc")
label_file = get_image_label(label_prefix_file, label_type=label_type)
isd_str = ale.loads(label_file, props={'kernels': test_kernels}) isd_str = ale.loads(label_file, props={'kernels': test_kernels})
isd_obj = json.loads(isd_str) isd_obj = json.loads(isd_str)
print(json.dumps(isd_obj, indent=2)) # print(json.dumps(isd_obj, indent=2))
assert compare_dicts(isd_obj, compare_dict) == [] assert compare_dicts(isd_obj, compare_dict) == []
# ========= Test pds3label and naifspice driver ========= # ========= Test pds3label and naifspice driver =========
...@@ -91,3 +100,28 @@ class test_pds3_naif(unittest.TestCase): ...@@ -91,3 +100,28 @@ class test_pds3_naif(unittest.TestCase):
assert self.driver.detector_center_line == 100.5 assert self.driver.detector_center_line == 100.5
bods2c.assert_called_with('DAWN_FC2_FILTER_6') bods2c.assert_called_with('DAWN_FC2_FILTER_6')
gdpool.assert_called_with('INS54321_CCD_CENTER', 0, 2) gdpool.assert_called_with('INS54321_CCD_CENTER', 0, 2)
# ========= Test isis3label and naifspice driver =========
class test_isis3_naif(unittest.TestCase):
def setUp(self):
label = get_image_label("FC21A0038582_15170161546F6G", "isis3");
self.driver = DawnFcIsisLabelNaifSpiceDriver(label);
def test_short_mission_name(self):
assert self.driver.short_mission_name == 'dawn'
def test_instrument_id(self):
assert self.driver.instrument_id == 'DAWN_FC2_FILTER_6'
def test_spacecraft_name(self):
assert self.driver.spacecraft_name == 'DAWN'
def test_target_name(self):
assert self.driver.target_name == 'CERES'
def test_ephemeris_start_time(self):
with patch('ale.drivers.dawn_drivers.spice.scs2e', return_value=12345) as scs2e:
assert self.driver.ephemeris_start_time == 12345.193
scs2e.assert_called_with(-203, '488002612:246')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment