Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Creating Multiple TimeSeries #113

Open
Alrobbertz opened this issue Apr 22, 2024 · 2 comments
Open

Enable Creating Multiple TimeSeries #113

Alrobbertz opened this issue Apr 22, 2024 · 2 comments
Assignees

Comments

@Alrobbertz
Copy link
Member

For instruments that collect multiple sensor measurements, at different time cadences, they require multiple time axes to be present in the same HermesData object and CDF file. This is regulated by each of the different measurement's having unique DEPEND_0 metadata attributes that reference their respective time axes with the appropriate cadence.

To achieve this we need to make updates to the HermesData container to allow for multiple time axes with different cadences, or time deltas. Currently the HermesData class only supports on "Epoch" variable encapsulated in the timeseries attribute. This needs to be extended, or another data structure added so that multiple "Epoch" variables can be added to the same data container and written to the same CDF.

@Alrobbertz
Copy link
Member Author

@ehsteve How would you feel if we had something like this:

class HermesData:

  def __init__(timeseries, ..., meta):
    if isinstance(timeseries, TimeSeries):
      self._timeseries = {"Epoch": timeseries.copy()}
    elif isinstance(timeseries, dict):
      self._timeseries = deepcopy(timeseries)
      
  @property
  def timeseries(self):
    if len(self._timeseries.keys()) == 1: # Only one Epoch
      return self.timeseries["Epoch"]
    else:
      return self._timeseries

This keeps the existing API functionality in-tact, but allows us to group all of the TimeSeries structures together for easier handling and IO.

@Alrobbertz Alrobbertz self-assigned this Apr 23, 2024
@Alrobbertz
Copy link
Member Author

I started a draft PR #114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant