Select to view content in your preferred language

help turning input into user input in arcgis

2228
14
Jump to solution
11-10-2017 12:28 PM
bradbrewer
Emerging Contributor

velocity = float(input("Input asteroid velocity: "))
mass = float(input("Input asteroid mass: "))
ice = float(1.8)
iron = float(7.3)
rock = float(2.3)
comp = input("input 1 for ice, 2 for iron, or 3 for rock: ")
grav = float(0.16667)
const = float(0.007)
colrt = float(1.3)
soil = float(2.65)
power = (int(1)/float(3.4))
vel = (velocity * 1000)
kilotons = (4184000000000)
if comp == 1:
comp = ice
elif comp == 2:
comp = iron
elif comp == 3:
comp = rock
kinetic = (0.5 * mass * (vel * vel))
energy = (kinetic * kilotons)
part1 = (const * colrt * grav)
part2 = (comp / soil)
part3 = (energy * part2)
part4 = (part3 ** power)
crater = (part1 * part4)
final = (crater / int(1000))
print(final)

sorry for the length but i'm trying to take the velocity, mass, and comp and turn them into user input parameters that will be run through the equation and then have it spit out a diameter

my problem is trying to set up the user input part to work with my script. i eventually want to take the script add it to model builder and do more with the output of this script. 

any help would be greatly accepted

0 Kudos
14 Replies
bradbrewer
Emerging Contributor

i'm a student at Illinois state and none of my professors know anything about python or how it works with arcgis. Thanks for the links i will be sure to start looking into them. 

0 Kudos
DanPatterson_Retired
MVP Emeritus

sadly... only a few of my students know about python or how it works with ArcGIS.  

0 Kudos
bradbrewer
Emerging Contributor

i wish we had a class that focused on using python to create models in arcgis. I think i may propose it to our department though so that other students don't get stuck like i did.

XanderBakker
Esri Esteemed Contributor

That would be great! Hope they will accept it