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

ENH: REACH data #206

Merged
merged 9 commits into from
Oct 5, 2023
Merged

ENH: REACH data #206

merged 9 commits into from
Oct 5, 2023

Conversation

jklenzing
Copy link
Member

Description

  • Adds reach dosimeter data
  • Fixes docstring copy paste issues

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

import datetime as dt
import pysat
import pysatNASA

reach = pysat.Instrument(inst_module=pysatNASA.instruments.reach_dosimeter, inst_id='101')
reach.remote_file_list()

reach.download(dt.datetime(2017, 4, 10))
reach.load(date=dt.datetime(2017, 4, 10))
reach.data

Test Configuration:

  • Operating system: Ventura
  • Version number: Python 3.9.12

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

If this is a release PR, replace the first item of the above checklist with the release
checklist on the wiki: https://github.com/pysat/pysat/wiki/Checklist-for-Release

@jklenzing
Copy link
Member Author

jklenzing commented Sep 18, 2023

Still needs:

  • acknowledgement string (can I import this from cdasws?)
  • reference string
  • double-check meta translation

@jklenzing jklenzing added the enhancement New feature or request label Sep 18, 2023
@jklenzing jklenzing added this to the 0.1.0 Release milestone Sep 18, 2023
@jklenzing
Copy link
Member Author

The acknowledgement string is more complicated than expected. Using standard copy paste for now, documented potential paths forward in #207.

@jklenzing jklenzing marked this pull request as ready for review October 2, 2023 18:23
@jklenzing
Copy link
Member Author

Note for testing:

import pysat
import pysatNASA
reach = pysat.Instrument(inst_module=pysatNASA.instruments.reach_dosimeter, inst_id='101')
reach.acknowledgements

yields

'Please load a file for full acknowledgments.'

Assuming you have downloaded files, running

reach.load(date=reach.files.files.index[0])
reach.acknowledgements

will then yield the full acknowledgement string.

pysatNASA/instruments/methods/reach.py Outdated Show resolved Hide resolved
pysatNASA/instruments/reach_dosimeter.py Outdated Show resolved Hide resolved
pysatNASA/instruments/reach_dosimeter.py Outdated Show resolved Hide resolved
Co-authored-by: Angeline Burrell <[email protected]>
@jklenzing jklenzing requested a review from aburrell October 2, 2023 20:42
@aburrell
Copy link
Member

aburrell commented Oct 3, 2023

Ok, the data loads well, but the global file attributes in MetaHeader have problems. A benign example that I would let pass is reach.meta.header.Notes is nan. A malignant example is Temperature_Sensitivity_43-65_deg, whose string format is not appropriate for an attribute name and so is not accessible. I think this can be fixed by replacing the - with a _ in the load function.

Note: you can access the object using getattr(reach.meta.header, 'Temperature_Sensitivity_43-65_deg'), but not reach.meta.header.Temperature_Sensitivity_43-65_deg. This raises SyntaxError: invalid decimal literal.

Copy link
Member

@aburrell aburrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix load routine so that all meta header attributes are accessible using standard attribute access method.

@jklenzing jklenzing requested a review from aburrell October 4, 2023 20:45
@jklenzing jklenzing merged commit 4afe2e6 into develop Oct 5, 2023
18 checks passed
@jklenzing jklenzing deleted the inst/reach branch October 5, 2023 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants