From 7511b30f16e7b98785baf02265c58bd6ae8394b4 Mon Sep 17 00:00:00 2001 From: Eddie McWhirter <emcwhirter@usgs.gov> Date: Mon, 22 Jun 2015 11:41:24 -0600 Subject: [PATCH] Fix header output to use input parameters. --- geomagio/pcdcp/PCDCPWriter.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/geomagio/pcdcp/PCDCPWriter.py b/geomagio/pcdcp/PCDCPWriter.py index 10fa02855..5f292195e 100644 --- a/geomagio/pcdcp/PCDCPWriter.py +++ b/geomagio/pcdcp/PCDCPWriter.py @@ -35,9 +35,9 @@ class PCDCPWriter(object): Parameters ---------- - name: str + name : str the name to be written - value: str + value : str the value to written. Returns @@ -45,13 +45,16 @@ class PCDCPWriter(object): str a string formatted to be a single header line in a PCDCP file """ - observatory = 'BOU' - year = '2015' - date = '01-Jan-15' + buf = [] + observatory = name.station + year = str(name.starttime.year) + yearday = str(name.starttime.julday).zfill(3) + date = name.starttime.strftime("%d-%b-%y") space = ' ' + buf.append(observatory + ' ' + year + ' ' + yearday + ' ' + + date + ' HEZF 0.01nT File Version 2.00\n') - return ''.join(observatory, space, year, space, '001', space, - date, space, 'HEZF 0.01nT File Version 2.00') + return ''.join(buf) def _format_data(self, timeseries, channels): """Format all data lines. -- GitLab