@@ -409,27 +409,24 @@ end
409
409
# Parse the command line.
410
410
options = { }
411
411
OptionParser . new do |opts |
412
- opts . banner = "Usage: test.rb [options]"
412
+ opts . banner = "Usage: genmap [options]"
413
413
414
- opts . on ( "-w" , "--width " , String , "Width of image" ) do |v |
414
+ opts . on ( "-w" , "--width SPEC " , String , "Width of image, e.g. 6in " ) do |v |
415
415
options [ :width ] = v
416
416
end
417
- opts . on ( "-r" , "--margin PIXELS" , Integer , "Margin outside map" ) do |v |
418
- options [ :margin ] = v
419
- end
420
417
opts . on ( "-m" , "--map NUM" , Integer , "Sky Atlas 2000 map number" ) do |v |
421
418
options [ :map ] = v
422
419
end
423
- opts . on ( "-u" , "--ul DDDD.D+DDDD " , String , "Upper-left coordinate" ) do |v |
420
+ opts . on ( "-u" , "--ul DDDD.D+DDDD " , String , "Upper-left map coordinate" ) do |v |
424
421
options [ :ul ] = v
425
422
end
426
- opts . on ( "-l" , "--lr DDDD.D+DDDD" , String , "Lower-right coordinate" ) do |v |
423
+ opts . on ( "-l" , "--lr DDDD.D+DDDD" , String , "Lower-right map coordinate" ) do |v |
427
424
options [ :lr ] = v
428
425
end
429
426
opts . on ( "-S" , "--stars MAG" , Float , "Plot stars" ) do |v |
430
427
options [ :stars ] = v
431
428
end
432
- opts . on ( "-g " , "--grid" , "Plot grid" ) do |v |
429
+ opts . on ( "-G " , "--grid" , "Plot grid" ) do |v |
433
430
options [ :grid ] = v
434
431
end
435
432
opts . on ( "-H" , "--herschel" , "Plot Herschel 400 objects" ) do |v |
@@ -456,7 +453,6 @@ OptionParser.new do |opts|
456
453
end . parse!
457
454
458
455
Width = options [ :width ] || "6in"
459
- Margin = options [ :margin ] || 0
460
456
461
457
# Establish some globals to specify the map to be generated.
462
458
if options [ :map ]
@@ -496,8 +492,8 @@ amt, units = parse_width(Width)
496
492
Height = ( amt *( ymax -ymin ) /( xmax -xmin ) ) . to_s + units
497
493
498
494
# Print the header material.
499
- puts %Q[<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 #{ g ( xmax -xmin + 2 * Margin ) } #{ g ( ymax -ymin + 2 * Margin ) } " width="#{ Width } " height="#{ Height } ">]
500
- puts %Q[<g transform="translate(#{ g ( -xmin + Margin ) } , #{ g ( -ymin + Margin ) } )">]
495
+ puts %Q[<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 #{ g ( xmax -xmin ) } #{ g ( ymax -ymin ) } " width="#{ Width } " height="#{ Height } ">]
496
+ puts %Q[<g transform="translate(#{ g ( -xmin ) } , #{ g ( -ymin ) } )">]
501
497
puts %Q[<clipPath id="CP">]
502
498
puts %Q[<rect x=#{ f ( xmin ) } y=#{ f ( ymin ) } width=#{ f ( xmax -xmin ) } height=#{ f ( ymax -ymin ) } stroke="black" stroke-width="1" fill="white"/>]
503
499
puts %Q[</clipPath>]
0 commit comments