From c6a769ab284266679913c697ff3d6ceee81054bb Mon Sep 17 00:00:00 2001 From: Adam Theisen Date: Wed, 12 Apr 2023 12:28:01 -0500 Subject: [PATCH] Doi Bug Fix (#659) * ENH: AirNow API must have updating some algorithms. What it's displaying now is what I would have assumed would be the closed reported station. * ENH: Adding feature for users to be able to get the citation for a datastream. Also adds text after data are done downloading from ARM to please reference the citation of the datastream * ENH: Changing doi.org to just doi * ENH: Moving into if loop for successful file generation --- act/discovery/get_armfiles.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/act/discovery/get_armfiles.py b/act/discovery/get_armfiles.py index 3d730212e1..4af7fd584f 100644 --- a/act/discovery/get_armfiles.py +++ b/act/discovery/get_armfiles.py @@ -163,6 +163,12 @@ def download_data(username, token, datastream, startdate, enddate, time=None, ou print(f'[DOWNLOADING] {fname}') open_bytes_file.write(data) file_names.append(output_file) + # Get ARM DOI and print it out + print(datastream, start_datetime, end_datetime) + doi = get_arm_doi(datastream, start_datetime.strftime('%Y-%m-%d'), end_datetime.strftime('%Y-%m-%d')) + print('\nIf you use these data to prepare a publication, please cite:\n') + print(textwrap.fill(doi, width=80)) + print('') else: print( 'No files returned or url status error.\n' 'Check datastream name, start, and end date.'