Skip to content

Support command-line arguments#1

Open
switch-blade-stuff wants to merge 2 commits intohersfeldtn:mainfrom
switch-blade-stuff:main
Open

Support command-line arguments#1
switch-blade-stuff wants to merge 2 commits intohersfeldtn:mainfrom
switch-blade-stuff:main

Conversation

@switch-blade-stuff
Copy link

Hello, I have been working on a mapping project, and frequently needed to create a series of projections at a time. This has been somewhat tedious since all of the options need to be specified by hand through the interactive interface and cannot be automated.

I have implemented a headless interface that takes the projection options from command-line arguments. When no arguments are specified, it will fall back to the existing interactive interface.

@hersfeldtn
Copy link
Owner

The main function is designed to be callable as a python function, e.g. here's a script I use to project out from a global equirectangular map to several recentered hammer maps:

import projectionpasta as proj

infile = 'grey_1.png'
outfile = 'grey2'
interp = 2

proj.MainDeg(infile, outfile+'_C.png', 0, 3, 0, 0, 0, -10, -20, 0, interp=interp)
proj.MainDeg(infile, outfile+'_NE.png', 0, 3, 0, 0, 0, 60, 30, 0, interp=interp)
proj.MainDeg(infile, outfile+'_E.png', 0, 3, 0, 0, 0, 140, 10, 0, interp=interp)
proj.MainDeg(infile, outfile+'_W.png', 0, 3, 0, 0, 0, -120, 10, 0, interp=interp)
proj.MainDeg(infile, outfile+'_S.png', 0, 3, 0, 0, 0, 180, -50, 0, interp=interp)

Nevertheless this is easy enough to fold into the next update, whenever I do one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants