This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def dd2dms(dd): | |
if dd < 0: | |
degrees = math.ceil(dd) | |
else: | |
degrees = math.floor(dd) | |
minutes = 60 * (dd%1) | |
seconds = 60 * (minutes%1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
vrg2timeseries.py, SERVIR-Mekong (2017-07-26) | |
Downloads data from SERVIR-Mekong's Virtual Rain and Stream Gauge (VRSG) | |
(vrsg-servir.adpc.net) and calculates a time series of the daily data over | |
an area | |
______________________________________________________________________ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def dd2meters(inPt,scale=0.1): | |
"""Function to convert decimal degrees to meters based on the approximation | |
given by: https://en.wikipedia.org/wiki/Geographic_coordinate_system | |
Args: | |
inPt (list or array): A Y,X point provided in geographic coordinates | |
in that order. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#***************************************************************************** | |
# FILE: grid_amsrL2Swath.py | |
# AUTHOR: Kel Markert | |
# EMAIL: [email protected] | |
# MODIFIED BY: N/A | |
# ORGANIZATION: UAH/ESSC | |
# CREATION DATE: 02/10/2017 | |
# LAST MOD DATE: 02/11/2017 | |
# PURPOSE: This scripts takes LANCE L2 swath AMSR2 data from GHRC, grids the | |
# data, and outputs a geotiff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import xmltodict | |
import numpy as np | |
import pandas as pd | |
""" | |
XML metata data file is take from https://landsat.usgs.gov/landsat-bulk-metadata-service | |
""" | |
# Define input files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import glob | |
import urllib2 | |
import numpy as np | |
outFolder = "J:/africa_srtm/org_zip/" #change output path | |
lats = np.arange(-35,33)#change lat bounds | |
lons = np.arange(-18,52)#change lon bounds |
NewerOlder