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