Skip to content

Commit

Permalink
Minor bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
BStoneLASP committed Oct 24, 2024
1 parent 80b01ec commit 707da32
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions curryer/compute/spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,11 +1020,11 @@ def __call__(self, ugps_times: np.ndarray) -> xr.Dataset:

dataset = xr.Dataset(
{
'attitude': (['frame', 'euclidian_dim'], sc_state_df[['ex', 'ey', 'ez']].values),
'position': (['frame', 'euclidian_dim'], sc_state_df[['x', 'y', 'z']].values),
'velocity': (['frame', 'euclidian_dim'], sc_state_df[['vx', 'vy', 'vz']].values),
'attitude': (['frame', 'euclidean_dim'], sc_state_df[['ex', 'ey', 'ez']].values),
'position': (['frame', 'euclidean_dim'], sc_state_df[['x', 'y', 'z']].values),
'velocity': (['frame', 'euclidean_dim'], sc_state_df[['vx', 'vy', 'vz']].values),

vector_name: (['frame', 'spatial_pixel', 'euclidian_dim'],
vector_name: (['frame', 'spatial_pixel', 'euclidean_dim'],
pnt_xyz_df[['x', 'y', 'z']].values.reshape((ugps_times.size, -1, 3))),

'altitude_ellipsoidal': (['frame', 'spatial_pixel'], ellips_lla_df['alt'].values),
Expand All @@ -1042,7 +1042,7 @@ def __call__(self, ugps_times: np.ndarray) -> xr.Dataset:
'quality_flags': (['frame', 'spatial_pixel'], all_qfs_ds.values),
},
coords={
'euclidian_dim': ('euclidian_dim', ['x', 'y', 'z']),
'euclidean_dim': ('euclidean_dim', ['x', 'y', 'z']),
'frame': ('frame', ugps_times / 1e6),
'spatial_pixel': ('spatial_pixel', pixel_ids.values),
'spectral_pixel': ('spectral_pixel', []),
Expand Down
2 changes: 2 additions & 0 deletions curryer/kernels/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def load_input_data(self, input_obj, parent_dir: Path = None, input_columns: dic
# Optionally remap the columns.
if input_columns is not None and len(input_columns):
if isinstance(input_columns, dict):
if input_data.index.name in input_columns:
input_data = input_data.reset_index()
input_data = input_data.rename(columns=input_columns)
input_data = input_data[list(input_columns.values())]
else:
Expand Down
2 changes: 1 addition & 1 deletion curryer/kernels/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def write_setup(setup_file, template, configs, mappings=None, overwrite=False, v
msg = '\n\t'.join(f'{msg}:\n\t\t{ln}' for msg, ln in issues)
raise ValueError(f'Final text failed validation. Issues[{len(issues)}]:\n\t{msg}')

logger.info('Created setup:\n%s', setup_txt)
logger.debug('Created setup:\n%s', setup_txt)

if isinstance(setup_file, str):
if os.path.isfile(setup_file) and not overwrite:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "lasp-curryer"
version = "0.0.6"
version = "0.0.7"
packages = [
{ include = "curryer" }
]
Expand Down

0 comments on commit 707da32

Please sign in to comment.