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

BUG: TIMED SABER and xarray #175

Merged
merged 10 commits into from
Jun 1, 2023
Merged

BUG: TIMED SABER and xarray #175

merged 10 commits into from
Jun 1, 2023

Conversation

jklenzing
Copy link
Member

Description

Addresses #174

TIMED SABER has an extra variable for time, for use with the tpaltitude profiles. This means that 'Epoch' will not be renamed 'time', breaking the new expand_dims code in pysat 3.1.0.

BONUS BUG: when multiple xarray files are combined via xr.combine_nested, the attrs for each variable are dropped, meaning that meta is not set for each variable.

  • Renames the profile time variable as 'tp_time', fixing the bug.
  • xr.combine_nested now uses the kwarg combine_attrs='override' to use the attrs from the first file.
  • Uses the kwarg use_cdflib=True for xarray objects to suppress warning message. pysatCDF does not currently support xarray, so this can be hard wired

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Loading a day of data and inspecting the metadata.

import pysat
saber = pysat.Instrument('timed', 'saber', use_header=True)
saber.load(2019, 1)
saber.meta['tp_time']

Test Configuration

  • Operating system: Monterrey
  • Version number: python 3.9.7
  • pysat 3.1.0

Checklist:

  • Make sure you are merging into the develop (not main) branch
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • Add a note to CHANGELOG.md, summarizing the changes
  • Update zenodo.json file for new code contributors

@jklenzing
Copy link
Member Author

Additional meta header issues out of scope, documented as #176

@jklenzing jklenzing marked this pull request as ready for review June 1, 2023 15:02
@jklenzing jklenzing requested review from aburrell and JonathonMSmith and removed request for aburrell June 1, 2023 15:03
@jklenzing
Copy link
Member Author

This should fix the issues seen in the other PRs

@jklenzing jklenzing requested a review from aburrell June 1, 2023 17:58
@jklenzing jklenzing merged commit 1353cf9 into develop Jun 1, 2023
@jklenzing jklenzing deleted the bug/xarray branch June 1, 2023 21:27
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

Successfully merging this pull request may close these issues.

2 participants