pysat/pysatNASA

ENH: Acknowledgements

Opened this issue · 5 comments

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

"""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'])

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

is "fcore" the skeleton name?

is "fcore" the skeleton name?

yes.

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