stud

study spacejunk
Log | Files | Refs | LICENSE

commit e9c23a6ded504be7b268a60874b74b740ad1b604 (tree)
parent e502d4ec385f43505f0e1daf20b93d5905f4ee2c
Author: Motiejus Jakštys <motiejus@uber.com>
Date:   Wed, 16 Dec 2020 00:12:25 +0200

add clip-2009.awk

Diffstat:
Mcontours/Makefile | 3+--
Acontours/clip-2009.awk | 7+++++++
Acontours/clip-2017.awk | 11+++++++++++
Dcontours/clip.awk | 8--------
4 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/contours/Makefile b/contours/Makefile @@ -39,8 +39,7 @@ all.xyz: $(XYZ) .INTERMEDIATE: $(XYZ) %.xyz: %.zip unzip -qq -c $< $@ | \ - sed -e 's/^ \+//' -e 's/ \+/,/g' | \ - ./clip.awk $(addprefix -v ,$(BOUNDS)) | \ + ./clip-2009.awk $(addprefix -v ,$(BOUNDS)) | \ $(SORT) > $@ db/.ready: managedb diff --git a/contours/clip-2009.awk b/contours/clip-2009.awk @@ -0,0 +1,7 @@ +#!/usr/bin/awk -f + +# this file works with SEZP from circa 2009, where x coordinate (the 6-digit one) +# is first, and the field separator is ' ' or more spaces. +$1 > xmin && $1 < xmax && $2 > ymin && $2 < ymax { + print $1 "," $2 "," $3 +} diff --git a/contours/clip-2017.awk b/contours/clip-2017.awk @@ -0,0 +1,11 @@ +#!/usr/bin/awk -f +# +# this file works with SEZP circa ~2017 where y coordinate (the 7-digit one) is +# first, and the field separator is ',' +BEGIN { + FS = "," +} + +$1 > ymin && $1 < ymax && $2 > xmin && $2 < xmax { + print $2 "," $1 "," $3 +} diff --git a/contours/clip.awk b/contours/clip.awk @@ -1,8 +0,0 @@ -#!/usr/bin/awk -f -BEGIN { - FS = "," -} - -$1 > ymin && $1 < ymax && $2 > xmin && $2 < xmax { - print $2 "," $1 "," $3 -}