Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
feb5817
safety push
jnspitale Dec 10, 2025
aff24c2
Merge branch 'main' into jns-metadata-updates
jnspitale Dec 10, 2025
0f6090b
coderabbit fixes
jnspitale Dec 11, 2025
8e26cde
Merge branch 'jns-metadata-updates' of https://github.com/SETI/rms-oo…
jnspitale Dec 11, 2025
2ae7145
coderabbit
jnspitale Feb 3, 2026
782474a
remove superfluous _fill_limb_intercepts code block in limb_clock_angle
jnspitale Feb 9, 2026
b57b8a7
- fix missing import in tests/hosts/hst/__init__.py
jnspitale Feb 11, 2026
4bca3b1
coderabbit
jnspitale Feb 11, 2026
d867a71
Merge branch 'jns-cleanup' into jns-metadata-updates
jnspitale Feb 18, 2026
ef5e9aa
Use 'fast' method for reading label in galileo ssi.
jnspitale Feb 20, 2026
9d0858c
Merge branch 'main' into jns-host-updates
jnspitale Feb 20, 2026
8edd4e8
Fix imports in junocam/standard_obs.py
jnspitale Feb 23, 2026
cbb650f
convert galileo ssi to use fcpath instead of local path in from _index
jnspitale Apr 28, 2026
ae883c6
Removed FCPath.retrieve where possible
jnspitale Apr 29, 2026
9b9ad98
Removed FCPath.retrieve from jiram modules.
jnspitale Apr 29, 2026
c7143ee
coderabbit
jnspitale Apr 30, 2026
39edf53
Propagate method argument in second call to Pds3Label in voyager/iss.py
jnspitale May 2, 2026
b16102c
coderabbit
jnspitale May 2, 2026
5116ca1
coderabbit
jnspitale May 2, 2026
33943d6
Merge branch 'main' into jns-host-updates
jnspitale May 2, 2026
5fcaf76
Rob comments
jnspitale May 4, 2026
6bf91fb
Remove explicit use of filecache.retrieve()
jnspitale May 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 16 additions & 39 deletions oops/gold_master/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,31 +1147,19 @@ def run_tests(self):
log_path = (BACKPLANE_OUTPUT_PREFIX / self.output_dir /
f'{self.task}.log')

localpath = None
try:
localpath = log_path.retrieve()
except FileNotFoundError:
pass

if localpath:
localpath = log_path.get_local_path()
if os.path.exists(localpath):

# Append the latest modification date to the pre-existing file
dt = datetime.datetime.fromtimestamp(os.path.getmtime(localpath))
suffix = dt.strftime('-%Y-%m-%dT%H-%M-%S')
dated_localpath = localpath[:-4] + suffix + '.log'
dated_logpath = log_path[:-4] + suffix + '.log'
# Note that for a cloud destination, this doesn't actually delete
# the original summary.py file in the cloud, since you can't rename
# files in the cloud. Instead we upload a copy with the new dated
# name and then the write below will overwrite the old version.
# Also notice that this attempt to use the modification date of the
# original summary.py file won't work in the cloud, because
# creation/modification times are not preserved when a file is
# retrieved. Instead, it will use the time the file was downloaded.
os.rename(localpath, dated_localpath)
(BACKPLANE_OUTPUT_PREFIX / dated_logpath).upload()

abs_log_path = log_path.get_local_path()
handler = logging.FileHandler(abs_log_path)

# Move or copy the old log to its timestamped filename using
# filecache-aware replacement semantics.
log_path.replace(dated_logpath)

handler = logging.FileHandler(localpath)
LOGGING.logger.addHandler(handler)

# Run the tests
Expand Down Expand Up @@ -2325,28 +2313,17 @@ def write_summary(self, outdir):

filepath = outdir / 'summary.py'

localpath = None
try:
localpath = str(filepath.retrieve(filepath))
except FileNotFoundError:
pass

if localpath:
localpath = filepath.get_local_path()
if os.path.exists(localpath):

# Append the latest modification date to any pre-existing file
dt = datetime.datetime.fromtimestamp(os.path.getmtime(localpath))
suffix = dt.strftime('-%Y-%m-%dT%H-%M-%S')
dated_localpath = localpath[:-3] + suffix + '.py'
dated_filepath = filepath[:-3] + suffix + '.py'
# Note that for a cloud destination, this doesn't actually delete
# the original summary.py file in the cloud, since you can't rename
# files in the cloud. Instead we upload a copy with the new dated
# name and then the write below will overwrite the old version.
# Also notice that this attempt to use the modification date of the
# original summary.py file won't work in the cloud, because
# creation/modification times are not preserved when a file is
# retrieved. Instead, it will use the time the file was downloaded.
os.rename(localpath, dated_localpath)
dated_filepath.upload()

# Move or copy the old summary to its timestamped filename using
# filecache-aware replacement semantics.
filepath.replace(dated_filepath)
LOGGING.info('Previous summary moved to:', dated_filepath.name)

titles = list(self.summary.keys())
Expand Down
6 changes: 2 additions & 4 deletions oops/hosts/cassini/iss.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ def from_file(filespec, fast_distortion=True,

# Load the VICAR file
filespec = FCPath(filespec)
local_path = filespec.retrieve()
vic = vicar.VicarImage.from_file(local_path, strict=False)
vic = vicar.VicarImage.from_file(filespec, strict=False)
vicar_dict = vic.as_dict()

# Get key information from the header
Expand Down Expand Up @@ -108,8 +107,7 @@ def from_index(filespec, **parameters):
# Read the index file
COLUMNS = [] # Return all columns
TIMES = ['START_TIME']
local_path = filespec.retrieve()
table = pdstable.PdsTable(local_path, columns=COLUMNS, times=TIMES)
table = pdstable.PdsTable(filespec, columns=COLUMNS, times=TIMES)
row_dicts = table.dicts_by_row()

# Create a list of Snapshot objects
Expand Down
5 changes: 3 additions & 2 deletions oops/hosts/cassini/uvis.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Standard class methods
##########################################################################################

def from_file(filespec, data=True, enclose=False, **parameters):
def from_file(filespec, data=True, enclose=False, method='strict', **parameters):
"""A general, static method to return one or more Observation subclass
objects based on a label for a given Cassini UVIS file.

Expand All @@ -34,13 +34,14 @@ def from_file(filespec, data=True, enclose=False, **parameters):
enclosing limits in line and band, and the binning is assumed to
be 1. If False and multiple windows are used, the function returns
a tuple of observations rather than a single observation.
method: Label reading method to be passed to Pds3Label.
"""

UVIS.initialize() # Define everything the first time through; use defaults unless
# initialize() is called explicitly.

# Get the label dictionary and data array dimensions
label = pdsparser.Pds3Label(filespec, method='fast').as_dict()
label = pdsparser.Pds3Label(filespec, method=method).as_dict()

# Load any needed SPICE kernels
tstart = julian.tdb_from_tai(julian.tai_from_iso(label['START_TIME']))
Expand Down
5 changes: 3 additions & 2 deletions oops/hosts/cassini/vims.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
# Standard class methods
##########################################################################################

def from_file(filespec, data=True):
def from_file(filespec, data=True, method='strict'):
"""A general, static method to return a pair of Observation objects based on a given
Cassini VIMS data file or label file.

Expand All @@ -198,6 +198,7 @@ def from_file(filespec, data=True):
data if True, data arrays are included in the returned observation
objects. Use a tuple of two booleans to specify whether to include
the VIS and IR data independently.
method Label reading method to be passed to Pds3Label.

Return: (vis, ir)
vis the VIS observation, or None if the VIS channel was inactive.
Expand All @@ -212,7 +213,7 @@ def from_file(filespec, data=True):

filespec = FCPath(filespec)

label = pdsparser.Pds3Label(filespec, method='fast').as_dict()
label = pdsparser.Pds3Label(filespec, method=method).as_dict()

# Insert "data_file" and "header_recs"
# Convert ISIS .qub info to a standard PDS3 label dictionary
Expand Down
11 changes: 5 additions & 6 deletions oops/hosts/galileo/ssi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Standard class methods
################################################################################
def from_file(filespec,
return_all_planets=False, full_fov=False, **parameters):
return_all_planets=False, full_fov=False, method='strict', **parameters):
"""A general, static method to return a Snapshot object based on a given
Galileo SSI image file. By default, only the valid image region is
returned.
Expand All @@ -33,6 +33,7 @@ def from_file(filespec,

full_fov: If True, the full image is returned with a mask
describing the regions with no data.
method: Label reading method to be passed to Pds3Label.
"""

SSI.initialize() # Define everything the first time through; use defaults
Expand All @@ -41,7 +42,7 @@ def from_file(filespec,
filespec = FCPath(filespec)

# Load the PDS label
label = pdsparser.Pds3Label(filespec).as_dict()
label = pdsparser.Pds3Label(filespec, method=method).as_dict()

# Load the data array
vic = vicar.VicarImage.from_file(filespec)
Expand Down Expand Up @@ -87,15 +88,13 @@ def from_index(filespec, supplemental_filespec=None, full_fov=False, **parameter

# Read the index file
COLUMNS = [] # Return all columns
local_path = filespec.retrieve(filespec)
table = pdstable.PdsTable(local_path, columns=COLUMNS)
table = pdstable.PdsTable(filespec, columns=COLUMNS)
row_dicts = table.dicts_by_row()

# Read the supplemental index file
if supplemental_filespec is not None:
supplemental_filespec = FCPath(supplemental_filespec)
supplemental_local_path = supplemental_filespec.retrieve()
table = pdstable.PdsTable(supplemental_local_path)
table = pdstable.PdsTable(supplemental_filespec)
supplemental_row_dicts = table.dicts_by_row()

# # Sort supplemental rows to match index file
Expand Down
17 changes: 7 additions & 10 deletions oops/hosts/juno/jiram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,21 @@
################################################################################
# Standard class methods
################################################################################
def from_file(filespec, return_all_planets=False, **parameters):
def from_file(filespec, return_all_planets=False, method='strict', **parameters):
"""A general, static method to return a Snapshot object based on a given
JIRAM image or spectrum file.

Inputs:
return_all_planets Include kernels for all planets not just
Jupiter or Saturn.
method Label reading method to be passed to Pds3Label.
"""
JIRAM.initialize() # Define everything the first time through; use
# defaults unless initialize() is called explicitly.

# Load the PDS label
filespec = FCPath(filespec)
lbl_filespec = filespec.with_suffix('.LBL')
local_filespec = filespec.retrieve()
local_lbl_filespec = lbl_filespec.retrieve()
recs = pdsparser.PdsLabel.load_file(local_lbl_filespec)
label = pdsparser.PdsLabel.from_string(recs).as_dict()
label = pdsparser.Pds3Label(filespec, method=method).as_dict()

# Get common metadata
meta = Metadata(label)
Expand All @@ -49,14 +46,14 @@ def from_file(filespec, return_all_planets=False, **parameters):
# Image
if ext.upper() == '.IMG':
from . import img
return img.from_file(local_filespec, label,
return_all_planets=False, **parameters)
return img.from_file(filespec, label,
return_all_planets=return_all_planets, **parameters)

# Spectrum
if ext.upper() == '.DAT':
from . import spe
return spe.from_file(local_filespec, label,
return_all_planets=False, **parameters)
return spe.from_file(filespec, label,
return_all_planets=return_all_planets, **parameters)

return None

Expand Down
16 changes: 6 additions & 10 deletions oops/hosts/juno/junocam/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
# oops/inst/juno/junocam.py
# oops/inst/juno/junocam/__init__.py
################################################################################

import re
Expand All @@ -25,7 +25,7 @@
#===============================================================================
### Avoid two horizontal separators in a row. One should suffice.
def from_file(filespec, fast_distortion=True,
return_all_planets=False, snap=False, **parameters):
return_all_planets=False, snap=False, method='strict', **parameters):
"""A general, static method to return a Pushframe object based on a given
JUNOCAM image file.

Expand All @@ -41,20 +41,16 @@ def from_file(filespec, fast_distortion=True,

snap True to model the image as a Snapshot rather than as
a TimedImage.
method Label reading method to be passed to Pds3Label.
"""
JUNOCAM.initialize() # Define everything the first time through; use
# defaults unless initialize() is called explicitly.
### I think we recommend a blank line after a multi-line docstring.

filespec = FCPath(filespec)

# Load the PDS label
lbl_filespec = filespec.with_suffix('.LBL')
### This failed for me because the files come off the PDS archive volumes in
### upper case, so they end in '.IMG', not 'img'. You need to find a way to make
### this work regardless of the case of either file extension.
local_lbl_filespec = lbl_filespec.retrieve()
recs = pdsparser.PdsLabel.load_file(local_lbl_filespec)
label = pdsparser.PdsLabel.from_string(recs).as_dict()
label = pdsparser.Pds3Label(filespec, method=method).as_dict()

# Get composite image metadata
meta = Metadata(label)
Expand Down Expand Up @@ -118,7 +114,7 @@ def from_file(filespec, fast_distortion=True,
# item.insert_subfield('spice_kernels', \
# Juno.used_kernels(item.time, 'junocam', return_all_planets))
item.insert_subfield('filespec', filespec)
item.insert_subfield('basename', os.path.basename(filespec))
item.insert_subfield('basename', filespec.name)
obs.append(item)

return obs
Expand Down
3 changes: 1 addition & 2 deletions oops/hosts/newhorizons/lorri.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,7 @@ def from_index(filespec, fov_type='fast', asof=None, meta=None, **parameters):
# Read the index file
COLUMNS = [] # Return all columns
TIMES = ['START_TIME'] # Convert this one to TAI
local_path = filespec.retrieve()
table = pdstable.PdsTable(local_path, columns=COLUMNS, times=TIMES)
table = pdstable.PdsTable(filespec, columns=COLUMNS, times=TIMES)
row_dicts = table.dicts_by_row()

# Create a list of Snapshot objects
Expand Down
Loading
Loading