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: Acknowledgements #207

Open
jklenzing opened this issue Sep 20, 2023 · 5 comments
Open

ENH: Acknowledgements #207

jklenzing opened this issue Sep 20, 2023 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@jklenzing
Copy link
Member

jklenzing commented Sep 20, 2023

Description

Currently, acknowledgement statements are manually copied into the code. This can be an issue if these change down the line (new data version, etc). As the number of instruments increase, this will become a problem.

We need a more maintainable version of this.

Potential impact

  • Is the feature related to an existing problem? - maintainability
  • How critical is this feature to your workflow?
  • How wide of an impact to you anticipate this enhancement having?
  • Would this break any existing functionality?

Potential solution(s)

  • cdasws can get this information, but you can't access the acknowledgement statement directly. You need to download a packet of data and extract this from the attrs.
  • Import and read from the json files for the master cdfs: https://cdaweb.gsfc.nasa.gov/pub/software/cdawlib/0JSONS/
  • The info is present in the files themselves. This could be initialized as 'Please load data for acknowledgements', then updated after data is loaded.
  • Store web info and point people to the website with ackn info in the saved string.

Alternatives

Continue with copy and paste

Additional context

n/a

@jklenzing jklenzing added the enhancement New feature or request label Sep 20, 2023
@jklenzing jklenzing mentioned this issue Sep 20, 2023
11 tasks
@jklenzing
Copy link
Member Author

"""Sample automated acquisition of acknowledgements."""

import json
import requests

fcore = 'reach-vid-101_dosimeter-l1c_00000000_v01'
json_url = ''.join(('https://cdaweb.gsfc.nasa.gov/pub/software/cdawlib/0JSONS/',
                    fcore, '.json'))

with requests.get(json_url) as req:
    if req.status_code != 404:
        data = json.loads(req.content)

key = ''.join((fcore, '.cdf'))

for attr in data[key]['CDFglobalAttributes']:
    if 'Acknowledgement' in attr.keys():
        print(attr['Acknowledgement'][0]['0'])

@jklenzing
Copy link
Member Author

There is not yet an automated way of setting the skeleton file name, though this is in the queue for an updated release of the web services

@JonathonMSmith
Copy link
Collaborator

is "fcore" the skeleton name?

@jklenzing
Copy link
Member Author

is "fcore" the skeleton name?

yes.

@jklenzing jklenzing added this to the Future milestone Oct 2, 2023
@jklenzing
Copy link
Member Author

Flagging this as "future" since it depends on updates to cdasws

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

No branches or pull requests

2 participants