Skip to content
Snippets Groups Projects

make-dot-r

Converts 31-column NIWC data files that look like this:

Schwerdtfeger C203	C203
Location: -79.816 -170.358 177ft
February 2021

Day	Time	Temp	Pres	Alt	Sea	Speed	Dir	Gust	Peak	Min	Max	RH	DewPt	Vis	VVis	Cloud1	Cover1	Cloud2	Cover2	Cloud3	Cover3	Sky	Ceil	SkyCond	Surf	Horiz	PresWx	Batt	Remarks     
	(Z)	(C)	(mb)	(inHg)	(mb)	(kts)	(T)	(kts)	(kts)	(kts)	(kts)	(%)	(C)	(m)	(ft)	(ft)		(ft)		(ft)		(/8)	(ft)					(vdc)
05	2350	-185.4	969.0			0.0	0					-97.9	-185.4															15.4	AO1
06	0000	0.0					464					0.0	0.0																AO1

...to 8-column ".r" files that look like this:

  Feb  21   Station : 7203  Schwerdtfeger NIWC
  Lat : 79.82S  Long : 170.36E  Elev :   54 M
   32    1  444.0  444.0  444.0  444.0  444.0  444.0
   32    2  444.0  444.0  444.0  444.0  444.0  444.0

Usage

usage: make-dot-r FILE...

Convert NIWC data files to .r files.

Options:
  FILE         files to convert, default stdin
  --dir DIR    place to save .r files, default cwd
  --overwrite  overwrite existing .r files
  --stdout     print .r file to stdout instead of saving
  -h, --help   print this help message and exit

Run without installing

git clone https://gitlab.ssec.wisc.edu/ograham/make-dot-r.git
python3 make-dot-r/make_dot_r/ --help

Install from a local copy that you can edit

git clone https://gitlab.ssec.wisc.edu/ograham/make-dot-r.git
python3 -m pip install -Ue ./make-dot-r/

Install directly from the SSEC GitLab

python3 -m pip install -U git+https://gitlab.ssec.wisc.edu/ograham/make-dot-r.git