import os from gen_geotiff2 import gen_geotiff2 from sentinelhub import get_area_info from sentinelhub import AwsTile from sentinelhub import SHConfig from oct2py import octave from io import BytesIO import base64 from google.cloud import storage from oauth2client.service_account import ServiceAccountCredentials import os import firebase_admin from firebase_admin import credentials from firebase_admin import db from PIL import Image, ImageFilter import PIL from send_notification import send_notification from sendemail import sendemail from sen_start_noti import sen_start_noti import json import scipy from scipy import ndimage from google.cloud import bigquery import datetime import time from sentinelhub import AwsTileRequest import numpy as np from gen_geotiff2 import gen_geotiff2 uid = 'KZQ7TZIYXnXN0b07OtrL1hlyYij1' fieldid = '1653834416376' aa = 1 cred = credentials.Certificate('servicekey2.json') client = bigquery.Client().from_service_account_json('servicekey2.json') # Initialize the app with a service account, granting admin privileges firebase_admin.initialize_app(cred, {'databaseURL': 'https://farmbase-b2f7e-31c0c.firebaseio.com/'}) map_fields = db.reference('PaidMonitoredFields').child('PMF').child(uid).child(fieldid).get() file_names = os.listdir(uid) for file_name in file_names: print(file_name) file_tiff = file_name.replace(".png",".tif") file_name = file_name.replace(".png","") gen_geotiff2(map_fields,uid,file_name,file_tiff)