new move towards cloud of 3D points
[JPSSData.git] / GOES16.py
blob78ffecb097d7b8e2f01bbb533a72fa71063b7402
1 '''
2 Developed in Python 2.7.15 :: Anaconda 4.5.10, on Windows
3 Lauren Hearn (lauren@robotlauren.com) 2018-10
5 Requirements:
6 - must have rclone installed
7 - configure new remote via rclone titled 'goes16aws'
8 - must have subdirectory with rclone in path
9 '''
11 from subprocess import call, PIPE, STDOUT
12 from netCDF4 import Dataset
13 from datetime import datetime, timedelta
14 import numpy as np
15 import matplotlib.pyplot as plt
17 args = ['rclone', 'lsd', 'ls', 'goes16aws:noaa-goes16', './rclone']
19 buckets = call([args[0], args[1], args[3]], cwd=args[4], shell=True)
20 date = raw_input("What date/time would you like to see(please use format <Year>/<Day of Year>/<Hour>)? ")
21 type(str)
22 # todo - change date format to be consistent with JPSS/datetime
24 path = 'goes16aws:noaa-goes16/ABI-L2-MCMIPC/' + date
25 print path
27 # get all files for given date/time, i.e. 2018/262/02
28 files = call([args[0],args[2], path], cwd=args[4])
29 process = call([args[0],args[2], path], cwd=args[4], stdout=PIPE, stderr=STDOUT)
30 output = process.communicate()[0]
31 print 'available files for ' + date + ' are:', output # list available files for the given hour
33 # copy all files to given local directory
34 download = call([args[0], 'copyto', path, './'], cwd=args[4])
36 #now we open files to look around
37 C_file = './' + args[0] + "/" + raw_input("What file would you like to see? ") # allow a moment for download to complete
38 C = Dataset(C_file, 'r')
40 # add mapping from https://github.com/blaylockbk/pyBKB_v2/blob/master/BB_GOES16/mapping_GOES16_FireTemperature.ipynb
41 '''
42 Notes:
43 -may need "shell=True" only for Windows environment.
44 -call still not working, properly. Will adjust in the next couple days
45 '''