Apply isis command spice to cube created from jp2

I am just beginning my journey with ISIS, so maybe my questions are a bit naive, but I want to know how can I apply spice command to a ISIS Cube that I got from jp2 file?

So, I have a Mars HiRISE jp2 image + corresponding lbl file and what I did was:

  1. hi2isis from=ESP_046929_2050_RED.LBL to=test.cub.

In the corresponding section for working with HiRISE images it is mentioned, that I need to use hi2isis command, but by default it expects .IMG file whereas I have jp2 and corresponding .lbl

So, for this command I saw error

‘ESP_046929_2050_RED.LBL file appears to be a rdar file. Use pds2isis’

I thought maybe it does not like .lbl and tried to feed jp2 file itself, but it complained on missing DATA_SET_ID section, so for sure .lbl is better, just this command hi2isis is not good for it

  1. as it was suggested in the error message I ran

pds2isis from=ESP_046929_2050_RED.LBL to=test.cub

After some time I saw cub, so for now it is Ok.

But when I try to run

spiceinit from=test.cub

I see error “Can not initialize SPICE for a map projected cube”

Why is this so? Is it because jp2 file has spatial reference info and spice does not like it?

In general, what are the commands need to be used for applying spice for HiRISE jp2 files?


if I run

hirdr2isis from=ESP_066551_2050_RED.LBL to=test2.cub

I got error

ERROR* No existing files found with a numerial version matching [pck???.tpc] in [/opt/anaconda3/envs/isis/data/base/kernels/pck].

but the cube file is created (even though it is very large - around 4.5 Gb) and spiceinit runs with same error “Can not initialize SPICE for a map projected cube”

Ok, so let me rephrase a bit my question.

Can we work in ISIS the same way with the cubes we got from .JP2 files for HiRISE images as we work with the cubes that were created from .IMG files?

ISIS documentation in this place it is written “RDR or EDR - for Isis processing, you’ll want to browse the EDR directory”

Even though ISIS has routines for importing RDR files (like JP2) for me It was impossible e.g. to apply spiceinit to those cubes.

I need .JP2 files - not .IMG cause for the area I am interested only JP2 (and LBL) files are available.

Does anybody have experience with this?

Hi Mikita,
The JP2s (and the detached labels that point to JP2s) are HiRISE RDRs, but the programs you’re trying to run are meant to take EDRs as input.

spiceinit is used to initialize a camera model for lower level data in their original camera geometry, such as HiRISE EDRs. The HiRISE RDRs, which are distributed in JP2 format, are higher level products. The RDRs are derived from EDRs, and have been radiometrically corrected and map projected. spiceinit doesn’t work with RDRs because there’s nothing for the program to do.

You can find the documentation for hi2isis here.

Information about the format and content of HiRISE EDRs and RDRs is described in the corresponding Software Interface Specifications in the official PDS archive:

What do you want to do with HiRISE data? The answer to that question will determine which product type and processing steps will be most appropriate for you.

Hello, David!
Thanks a lot for your reply.

What I want to do is to coregister pairs of HiRISE images and then feed this images to AI pipeline that will detect changes. For this the best data source is *_RED.JP2 files that have great resolution and are obviously RDR data.

My original problem I described here Batch coregistering of HiRISE images - #4 by mikita87
Suggested approaches required ISIS involvement and when I started digging into ISIS world in many places I saw the step of applying spiceinit to the cube.

Since I want to use many pairs of JP2 files my plan was to do with ISIS something like this

And again, here is is mentioned

“Autoseed requires the success of ISIS3’s spiceinit , footprintinit and findimageoverlaps applications”. So, spiceinit is a prerequisite.

As I inderstand, spiceinit should be applied to the cubes regardless of how they were produced (from EDR. or RDR), so I was wondering how to work with spice for RDR.

spiceinit is not applicable to HiRISE RDRs. spiceinit is used to attach spacecraft pointing/timing information and a camera model to an EDR so that each pixel can be located in a geographic space. The RDRs are map-projected products derived from the EDRs (which is a more “raw” product). The RDRs contain image data that have not only been transformed by applying the camera model, they have been projected into a geographic coordinate system and orthorectified onto a global 3D shape model for Mars.

If you want to follow the autoseed workflow, you will need to start with EDRs, not RDRs.

I see that Andrew Annex had an interesting suggestion about using his wrapper for ASP’s ipfind/ipmatch in your other thread. I think you could use the RDRs as input to that process.

Good luck.

@dpmayer David, thanks a lot for your reply.
ok, then as I see if I want to use RDR, then the only option for me is to use approach of @AndrewAnnex - use his wrapper. The will stick to this.

Anyway, thanks for your clarification