DOI-USGS / ale

Abstraction Layer for Ephemerides (ALE)
Other
13 stars 33 forks source link

PVLObject is unreadable when passed into ale.load(s) #586

Closed antonhibl closed 9 months ago

antonhibl commented 10 months ago

It should be possible to pass a PVLObject into ale.load/loads rather than just an image path but currently it causes an error wherein an exception is raised regarding No such driver available for label. It's likely this is happening in ale/ale/drivers/__init__.py in a function called parse_label which doesn't check to see if the label passed in is already a PVL label/object rather than a file path.

An example of the error described is shown in the screenshot below after I tried to call the method ale.loads() using this code in a larger script:

# Run spiceinit with ISIS
run_spiceinit_isis(image_isis_path)

# try ale.loads
isis_kerns = ale.util.generate_kernels_from_cube(image_isis_path, expand=True)
isis_label = pvl.load(image_isis_path)
ale.loads(isis_label, props={"kernels": isis_kerns}, only_naif_spice=True)
Screenshot 2024-01-10 at 1 44 45 PM
Kelvinrr commented 10 months ago

semantics, but I feel this is more of a feature add.

acpaquette commented 10 months ago

@Kelvinrr There has been precedent in the past that ALE could ingest in memory PVL objects as the "file" into a driver. Expose that here may be somewhat difficult given the swig wrapper/bindings situation in ALE