Skip to content

Instantly share code, notes, and snippets.

@NimishMishra
Created April 22, 2019 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NimishMishra/18e3a4ff1ff0d1ec28f716e98b1424ad to your computer and use it in GitHub Desktop.
Save NimishMishra/18e3a4ff1ff0d1ec28f716e98b1424ad to your computer and use it in GitHub Desktop.
import glob
scattering_angle = []
deep_blue_AOD_Land = []
cloud_fraction = []
file_names = []
latitude = []
longitude = []
combined_AOD = []
angstrom_exponent = []
directory = '/Users/nimishmishra/Downloads/Kanpur MODIS Data/November'
for file in glob.glob(directory + '/*.hdf'):
FILEPATH = file
print(FILEPATH)
scattering_angle_value, lat, lon = create_list('Scattering Angle', 26.8467, 80.9462, FILEPATH)
deep_blue_AOD_Land_value, lat, lon = create_list('AOD', 26.8467, 80.9462, FILEPATH)
cloud_fraction_value, lat, lon = create_list('Cloud Fraction', 26.8467, 80.9462, FILEPATH)
combined_AOD_value, lat, lon = create_list('Combined', 26.8467, 80.9462, FILEPATH)
angstrom_exponent_value, lat, lon = create_list('Angstrom Exponent', 26.8467, 80.9462, FILEPATH)
print("Data collected for: " + str(lat) + " N (26.8467 N for Kanpur) and " + str(lon) + " E.(80.9462 for Kanpur)")
file_names.append(file)
scattering_angle.append(scattering_angle_value)
deep_blue_AOD_Land.append(deep_blue_AOD_Land_value)
latitude.append(lat)
longitude.append(lon)
cloud_fraction.append(cloud_fraction_value)
combined_AOD.append(combined_AOD_value)
angstrom_exponent.append(angstrom_exponent_value)
final_list = pd.DataFrame()
final_list['File Name'] = pd.Series(file_names)
final_list['Scattering_angle'] = pd.Series(scattering_angle)
final_list['Deep Blue AOD'] = pd.Series(deep_blue_AOD_Land)
final_list['Cloud Fraction'] = pd.Series(cloud_fraction)
final_list['Combined AOD'] = pd.Series(combined_AOD)
final_list['Angstrom Exponent'] = pd.Series(angstrom_exponent)
final_list['Latitude'] = pd.Series(latitude)
final_list['Longitude'] = pd.Series(longitude)
path = '/Users/nimishmishra/Desktop/2018_Sep.csv'
final_list.to_csv(path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment