Posts

Showing posts from June, 2010

Getting MODIS Image Automatically From FTP in Python

# This is a Python script that automatically downloads historical # MODIS data from the LP DAAC FTP site # This version should work for all of the tiled datasets # It is currently hard-coded to downloaded specific MODIS tiles for # the northern Great Plains & upper midwest # Initailly historical date for Data transfer must be set on "lpdacc.txt". import os, ftplib,sys,string # Login information for accessing the LP DAAC FTP site Hostname = "e4ftl01u.ecs.nasa.gov" Username = "anonymous" Password = "@anonymous" # Get user inputs # Base directory for the MODIS data # Basedir = input("Enter the LP DAAC directory containing the dataset you want to download:") Basedir="MOLT/MOD11A2.005" print "The LP DAAC directory containing the dataset you want to download" +str(Basedir) # Local directory for data storage #Hdfdir = input("Enter the local directory where you w...

Simple GUI Demo in Python

from Tkinter import* mainForm=Tk() lblWelcome = Label(mainForm, text="Welcome to SSEBB Model") lblWelcome.pack() lblDisplay=Listbox(mainForm) txtMyval=Entry(mainForm) txtMyval.focus_set() txtMyval.pack() btnQuit=Button(mainForm,text="Close",command=quit) btnQuit.pack(side="left",padx=10,pady=10) def ShowVal(): lblDisplay.insert(0,txtMyval.get()) btnStart=Button(mainForm,text="Show in list",command=ShowVal) btnStart.pack() lblDisplay.pack(padx=20,pady=10) mainForm.mainloop()