Open jklenzing opened 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'])
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
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)
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 theattrs
.Alternatives
Continue with copy and paste
Additional context
n/a