pysat / pysatNASA

pysat support for NASA Instruments
BSD 3-Clause "New" or "Revised" License
21 stars 6 forks source link

ENH: Acknowledgements #207

Open jklenzing opened 1 year ago

jklenzing commented 1 year ago

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

Potential solution(s)

Alternatives

Continue with copy and paste

Additional context

n/a

jklenzing commented 1 year ago
"""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 commented 1 year ago

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 commented 1 year ago

is "fcore" the skeleton name?

jklenzing commented 1 year ago

is "fcore" the skeleton name?

yes.

jklenzing commented 1 year ago

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