repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
itsMagondu/IoTNeuralNetworks
noisefilter/apps/filter/migrations/0004_kalmanresult.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-09-08 22:23 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('filter', '0003_annresult'), ] operations = [ migrations.CreateModel( ...
itsMagondu/IoTNeuralNetworks
noisefilter/generate_noisy_signal.py
<reponame>itsMagondu/IoTNeuralNetworks import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "noisefilter.settings.development") import django django.setup() from filter.models import TrainingExample import numpy as np pure = np.linspace(18, 22, 100) noise = np.random.normal(0, 0.5, 100) signal = pure + noise co...
itsMagondu/IoTNeuralNetworks
noisefilter/noisefilter/settings/development.py
<gh_stars>0 from .base import * DEBUG = True INTERNAL_IPS = ["127.0.0.1"] SECRET_KEY = "secret" ## DATABASE SETTINGS # https://docs.djangoproject.com/en/1.10/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'development.sqlite3', 'USER': ...
itsMagondu/IoTNeuralNetworks
noisefilter/noisefilter/settings/__init__.py
""" Settings for noisefilter """
itsMagondu/IoTNeuralNetworks
kalmanfilter.py
<filename>kalmanfilter.py # Kalman filter in Python adopted from http://scipy-cookbook.readthedocs.io/items/KalmanFiltering.html import numpy as np import matplotlib.pyplot as plt import time class KalmanFilter: def __init__(self,base_value=24,iterations=200,initial_guess=20.0,posteri_estimate=4.0,data=[],plot=False)...
itsMagondu/IoTNeuralNetworks
noisefilter/apps/filter/apps.py
from __future__ import unicode_literals from django.apps import AppConfig class FilterConfig(AppConfig): name = 'filter'
itsMagondu/IoTNeuralNetworks
noisefilter/apps/filter/migrations/0001_initial.py
<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-09-07 18:48 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( n...
itsMagondu/IoTNeuralNetworks
noisefilter/apps/filter/migrations/0002_auto_20160907_1203.py
<reponame>itsMagondu/IoTNeuralNetworks<filename>noisefilter/apps/filter/migrations/0002_auto_20160907_1203.py<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-09-07 19:03 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): ...
hezuoguang/ZGVL
WLServer/api/admin.py
<reponame>hezuoguang/ZGVL #coding:utf-8 from django.contrib import admin from api.models import * # Register your models here. class UserAdmin(admin.ModelAdmin): list_display = ('uid', 'name', 'sex', 'birthday', 'city', 'pwd', 'access_token') class MessageAdmin(admin.ModelAdmin): list_display = ('id', 'text'...
hezuoguang/ZGVL
WLServer/api/function.py
<gh_stars>0 # -*- coding: UTF-8 -*- __author__ = 'weimi' from api.models import * from django.db.models import Q import hashlib import re import json from qiniu import Auth access_key = "<KEY>" secret_key = "IujhqwUXdusrrLYooPA4WZdJtS7RR6r65TALg2p_" bucket_name = "weiliao" pwdfix = "weimi" photoCount = 43 photoUrl = "...
hezuoguang/ZGVL
WLServer/api/models.py
# coding:utf-8 from django.db import models # Create your models here. # 用户模型 class User(models.Model): # 账号,唯一标识 uid = models.CharField(max_length = 16, primary_key = True, verbose_name = "用户名") # 密码 pwd = models.CharField(max_length = 255, verbose_name = "密码") # 昵称 name = models.CharField(ma...
hezuoguang/ZGVL
WLServer/zgvl/urls.py
#coding:utf-8 from django.conf.urls import patterns, include, url from django.contrib import admin from api.views import doc admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'zgvl.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin', include(admin....
hezuoguang/ZGVL
WLServer/api/views.py
# coding:utf-8 from django.shortcuts import render, render_to_response, HttpResponse from api.function import * from api.models import * defaultCount = 40 # Create your views here. # API文档 def doc(request): return render_to_response("doc/doc.html", {}) # 登录处理 POST方式, 参数 uid, pwd, pwd须进行MD5加密 def login(request):...
hezuoguang/ZGVL
WLServer/zgvl/settings.py
#coding:utf-8 """ Django settings for zgvl project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_D...
hezuoguang/ZGVL
WLServer/zgvl/wsgi.py
#coding:utf-8 """ WSGI config for zgvl project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os import sys root = os.path.dirname(__file__) sys.path.insert(0, os.path.join...
hezuoguang/ZGVL
WLServer/api/urls.py
#coding:utf-8 from django.conf.urls import patterns, include, url from api.views import * urlpatterns = patterns('', # Examples: # url(r'^$', 'zgvl.views.home', name='home'), # url(r'^blog/', include('blog.urls')), # 登录 url(r'^login.json', login), # 注册 url(r'^register.json', register),...
sowmyamanojna/BT2020-Numerical-methods-in-Biology
class_hw/cos_taylor_pi_by_4.py
import numpy as np import math def factorial(n): fact = 1 for i in range(1,n+1): fact *= i return fact summation = 1 for i in range(1,7): val = (-1)**i * (math.pi/3)**(2*i) / factorial(2*i) summation += val print "val: ", val print "summation: ", summation print "Final summation: ", summation
miya779/crawler-poder360
main.py
#poder360 crawler import requests from bs4 import BeautifulSoup from selenium import webdriver import re import mysql.connector #used to convert the string month to mysql numerical format month = {'jan': '01', 'fev': '02', 'mar': '03', 'abr': '04', 'mai': '05', 'jun': '06', 'jul': '07', 'ago': '08', 'set': '09', 'out'...
hsgwa/ros2cli
ros2doctor/setup.py
from setuptools import find_packages from setuptools import setup package_name = 'ros2doctor' setup( name=package_name, version='0.10.1', packages=find_packages(exclude=['test']), data_files=[ ('share/' + package_name, ['package.xml']), ('share/ament_index/resource_index/packages', ...
hsgwa/ros2cli
ros2cli/setup.py
from setuptools import find_packages from setuptools import setup setup( name='ros2cli', version='0.10.1', packages=find_packages(exclude=['test']), extras_require={ 'completion': ['argcomplete'], }, data_files=[ ('share/ament_index/resource_index/packages', [ 'resou...
hsgwa/ros2cli
ros2param/ros2param/verb/list.py
<reponame>hsgwa/ros2cli<gh_stars>0 # Copyright 2018 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
coeusite/cnemc_calculator
cnemc_calculator/functions.py
import numpy as np import pandas as pd def sci_round(df, digi=0): ''' sci_round function 四舍六入五成双修约函数近似算法 ''' return np.round(np.round(df, 15), digi)
coeusite/cnemc_calculator
bin/calculate_aqi.py
<reponame>coeusite/cnemc_calculator import pandas as pd import numpy as np import cnemc_calculator from importlib import reload ## calculate_daily_aqi cnemc_calculator = reload(cnemc_calculator) data = pd.read_excel('data/审核后点位日均值.xlsx', header=0, index_col=[3,4], na_values=[-1,-99], sheetname='2016') column_names =...
coeusite/cnemc_calculator
setup.py
from distutils.core import setup setup( name='cnemc_calculator', version='0.1.0', author='CoeusITE', author_email='<EMAIL>', packages=['cnemc_calculator', 'cnemc_calculator.test'], scripts=[], url='https://github.com/coeusite/cnemc_calculator', license='LICENSE', description='Unoffi...
coeusite/cnemc_calculator
cnemc_calculator/__init__.py
from .calculate_aqi import calculate_daily_aqi, calculate_hourly_aqi, calculate_aqi
coeusite/cnemc_calculator
cnemc_calculator/calculate_aqi.py
<reponame>coeusite/cnemc_calculator import numpy as np import pandas as pd from .constants import * from .functions import * def calculate_daily_aqi(data, column_names): ''' calculate_daily_aqi funcion data: a pandas dataframe column_names: names of factor columns insequence of ['SO2', 'NO2', 'PM10',...
amit0902/Topic-Modeling
lda.py
<filename>lda.py # -*- coding: utf-8 -*- """ Created on Tue Jul 27 20:01:00 2021 @author: <NAME> """ #Data import sys import re, numpy as np, pandas as pd from pprint import pprint # Gensim import gensim, spacy, logging, warnings import gensim.corpora as corpora from gensim.utils import lemmatize, sim...
dimamelnik22/drawfulru
game/migrations/0011_onlinegame_playersready.py
# Generated by Django 3.0 on 2019-12-23 06:19 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('game', '0010_auto_20191223_0818'), ] operations = [ migrations.AddField( model_name='onlinegame', name='...
dimamelnik22/drawfulru
game/models.py
from django.db import models import datetime from user_profile.models import Profile import random class Phrase(models.Model): name = models.CharField(max_length=100) author = models.ForeignKey(Profile, on_delete=models.SET_NULL, null=True) gamesCount = models.IntegerField(default=0) rating = models.D...
dimamelnik22/drawfulru
user_profile/migrations/0007_auto_20191226_0128.py
# Generated by Django 3.0 on 2019-12-25 22:28 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user_profile', '0006_profile_number'), ] operations = [ migrations.AddField( model_name='profile', name=...
dimamelnik22/drawfulru
game/views.py
from django.shortcuts import render, redirect from django.http import HttpResponse,HttpResponseRedirect from game.models import PhrasePack, Phrase, PlayedGame, Image, OnlineGame, Round, PlayersChoice, PlayersNewPhrase from user_profile.models import Profile from .forms import RoundResultFull, RoundResultScoreOnly, ...
dimamelnik22/drawfulru
user_profile/models.py
from django.db import models from django.contrib.auth.models import User from allauth.socialaccount.models import SocialAccount # Create your models here. class Profile(models.Model): status = models.CharField(default="user",max_length=100) score = models.IntegerField(default=0) numOfAuthoredPhrases = models....
dimamelnik22/drawfulru
user_profile/migrations/0003_auto_20191222_1829.py
<gh_stars>0 # Generated by Django 3.0 on 2019-12-22 15:29 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('socialaccount', '0003_extra_data_default_dict'), ('user_profile', '0002_auto_20191217_1342'), ...
dimamelnik22/drawfulru
game/migrations/0012_playerschoice_playersnewphrase.py
<filename>game/migrations/0012_playerschoice_playersnewphrase.py # Generated by Django 3.0 on 2019-12-25 22:28 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('user_profile', '0007_auto_20191226_0128'), ...
dimamelnik22/drawfulru
user_profile/migrations/0008_auto_20191226_0231.py
# Generated by Django 3.0 on 2019-12-25 23:31 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user_profile', '0007_auto_20191226_0128'), ] operations = [ migrations.RemoveField( model_name='profile', ...
dimamelnik22/drawfulru
user_profile/migrations/0002_auto_20191217_1342.py
# Generated by Django 3.0 on 2019-12-17 10:42 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user_profile', '0001_initial'), ] operations = [ migrations.AlterField( model_name='profile', name='stat...
dimamelnik22/drawfulru
game/migrations/0010_auto_20191223_0818.py
<gh_stars>0 # Generated by Django 3.0 on 2019-12-23 05:18 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('game', '0009_onlinegame_curround'), ] operations = [ migrations.RemoveField( model_name='round', nam...
dimamelnik22/drawfulru
game/urls.py
<reponame>dimamelnik22/drawfulru<gh_stars>0 from django.conf.urls import url from . import views from django.urls import path, include urlpatterns = [ path('', views.home_view, name="game-home"), path('auth/', views.auth_view, name="game-auth"), path('nick/', views.nick_view, name="game-nick"), path('num...
dimamelnik22/drawfulru
game/migrations/0016_auto_20191226_0326.py
# Generated by Django 3.0 on 2019-12-26 00:26 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('game', '0015_auto_20191226_0320'), ] operations = [ migrations.AlterField( model_na...
dimamelnik22/drawfulru
game/migrations/0002_phrase_author.py
# Generated by Django 3.0 on 2019-12-17 02:34 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('user_profile', '0001_initial'), ('game', '0001_initial'), ] operations = [ migrations.A...
dimamelnik22/drawfulru
game/forms.py
<reponame>dimamelnik22/drawfulru from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm class UserRegisterForm(UserCreationForm): email = forms.EmailField() class Meta: model = User fields = ['username', 'email', '...
dimamelnik22/drawfulru
game/migrations/0014_auto_20191226_0320.py
# Generated by Django 3.0 on 2019-12-26 00:20 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('game', '0013_auto_20191226_0150'), ] operations = [ migrations.AlterField( model_na...
dimamelnik22/drawfulru
game/migrations/0008_remove_onlinegame_password.py
# Generated by Django 3.0 on 2019-12-22 23:44 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('game', '0007_auto_20191223_0240'), ] operations = [ migrations.RemoveField( model_name='onlinegame', name='passw...
dimamelnik22/drawfulru
user_profile/migrations/0006_profile_number.py
# Generated by Django 3.0 on 2019-12-23 07:31 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user_profile', '0005_auto_20191222_1911'), ] operations = [ migrations.AddField( model_name='profile', n...
dimamelnik22/drawfulru
game/admin.py
<gh_stars>0 from django.contrib import admin from .models import Phrase, PhrasePack, PlayedGame, OnlineGame, Image, Round, PlayersChoice, PlayersNewPhrase # Register your models here. admin.site.register(Phrase) admin.site.register(PhrasePack) admin.site.register(PlayedGame) admin.site.register(Online...
dimamelnik22/drawfulru
game/migrations/0003_auto_20191217_0708.py
<gh_stars>0 # Generated by Django 3.0 on 2019-12-17 04:08 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('game', '0002_phrase_author'), ] operations = [ migrations.AlterField( model_name='phrase', n...
dimamelnik22/drawfulru
game/migrations/0004_onlinegame.py
<reponame>dimamelnik22/drawfulru<filename>game/migrations/0004_onlinegame.py # Generated by Django 3.0 on 2019-12-22 01:32 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('user_profile', '0002_auto_20191217_1342'...
dimamelnik22/drawfulru
game/migrations/0007_auto_20191223_0240.py
# Generated by Django 3.0 on 2019-12-22 23:40 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('user_profile', '0005_auto_20191222_1911'), ('game', '0006_remove_image_name'), ] operations = [ ...
dimamelnik22/drawfulru
game/migrations/0001_initial.py
# Generated by Django 3.0 on 2019-12-16 20:56 import datetime from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('user_profile', '0001_initial'), ] operations = [ migratio...
dimamelnik22/drawfulru
user_profile/migrations/0005_auto_20191222_1911.py
# Generated by Django 3.0 on 2019-12-22 16:11 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('user_profile', ...
10sr/suniq
sample/gen_data.py
#!/usr/bin/env python3 from sys import argv from random import randint chars = ["a", "b", "c", "d", "\n"] with open(argv[1], mode="w") as f: for i in range(10000*1000): print(chars[randint(0, 4)], end="", file=f)
blech/Python-Calendar-Converter
calendar.py
<reponame>blech/Python-Calendar-Converter<filename>calendar.py # This Python file uses the following encoding: utf-8 # MIT Licensed 2013 <NAME> from datetime import datetime import roman class Calendar(object): # Correct input "<number in month> <month> <year>" def to_french_revolutionary(self, date): ...
FrancescoFabiano/E-PDDL
EPDDL.py
<gh_stars>1-10 #!/usr/bin/env python # Four spaces as indentation [no tabs] import re import itertools import warnings import copy from pathlib import Path from action import Action class EPDDL_Parser: SUPPORTED_REQUIREMENTS = [':strips', ':negative-preconditions', ':typing', ':no-duplicates', ':mep'] #-...
mkocot/fungus
pelicanconf.py
<filename>pelicanconf.py #!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = u'm' SITENAME = u'FungUs' SITEURL = '' PATH = 'content' STATIC_PATHS = ["bua", "cake"] TIMEZONE = 'Europe/Warsaw' TYPOGRIFY = True THEME = "themes/pl/notmyidea" DEFAULT_LANG = u'pl' # Feed gene...
liuxb555/earthengine-py-examples
Datasets/Water/jrc_yearly_history.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) dataset = ee.ImageCollection('JRC/GSW1_1/YearlyHistory') \ .filter(ee.Filter.date('2015-01-01', '2015-12-31')) waterClass = dataset.select('waterClass') waterClassVis = { 'min': 0.0, 'max'...
liuxb555/earthengine-py-examples
ImageCollection/landsat_simple_composite.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) # Composite 6 months of Landsat 8. # Note that the input to simpleComposite is raw data. l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1') # The asFloat parameter gives floating-point TOA output instead of # the...
liuxb555/earthengine-py-examples
AssetManagement/export_FeatureCollection.py
<reponame>liuxb555/earthengine-py-examples import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) fromFT = ee.FeatureCollection('ft:1CLldB-ULPyULBT2mxoRNv7enckVF0gCQoD2oH7XP') polys = fromFT.geometry() centroid = polys.centroid() lng, lat = centroid.getInfo()['coo...
liuxb555/earthengine-py-examples
Image/image_stats_by_band.py
<filename>Image/image_stats_by_band.py import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) image = ee.Image('USDA/NAIP/DOQQ/m_3712213_sw_10_1_20140613') Map.setCenter(-122.466123, 37.769833, 17) Map.addLayer(image, {'bands': ['N', 'R','G']}, 'NAIP') geometry =...
liuxb555/earthengine-py-examples
Datasets/Terrain/srtm_mtpi.py
<gh_stars>10-100 import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) dataset = ee.Image('CSP/ERGo/1_0/Global/SRTM_mTPI') srtmMtpi = dataset.select('elevation') srtmMtpiVis = { 'min': -200.0, 'max': 200.0, 'palette': ['0b1eff', '4be450', 'fffca4', 'ffa011',...
liuxb555/earthengine-py-examples
Image/pansharpen.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) # Load a Landsat 8 top-of-atmosphere reflectance image. image = ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_044034_20140318') Map.addLayer( image, {'bands': ['B4', 'B3', 'B2'], 'min': 0, 'max': 0.25, 'gamma'...
liuxb555/earthengine-py-examples
Datasets/Vectors/global_land_ice_measurements.py
<filename>Datasets/Vectors/global_land_ice_measurements.py import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) dataset = ee.FeatureCollection('GLIMS/current') visParams = { 'palette': ['gray', 'cyan', 'blue'], 'min': 0.0, 'max': 10.0, 'opacity': 0.8, } ...
liuxb555/earthengine-py-examples
FeatureCollection/add_new_attribute.py
<reponame>liuxb555/earthengine-py-examples import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) # This function creates a new property that is the sum of two existing properties. def addField(feature): sum = ee.Number(feature.get('property1')).add(feature.get('...
liuxb555/earthengine-py-examples
Datasets/Terrain/us_ned_mtpi.py
<filename>Datasets/Terrain/us_ned_mtpi.py import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) dataset = ee.Image('CSP/ERGo/1_0/US/mTPI') usMtpi = dataset.select('elevation') usMtpiVis = { 'min': -200.0, 'max': 200.0, 'palette': ['0b1eff', '4be450', 'fffca4...
liuxb555/earthengine-py-examples
Image/get_band_name_and_type.py
<filename>Image/get_band_name_and_type.py import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) roi = ee.Geometry.Point([-99.2182, 46.7824]) collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA') \ .filterBounds(roi) \ .filter(ee.Filter.calendarRange(...
liuxb555/earthengine-py-examples
AssetManagement/export_TimeSeries.py
# from IPython.display import Image import ee # define the geometry geometry = ee.Geometry.Polygon([[116.49078369140625, 39.82219623803342], [116.49456024169922, 39.763105626443306], [116.57455444335938, 39.76336953661037], ...
liuxb555/earthengine-py-examples
Datasets/Vectors/us_census_counties.py
<reponame>liuxb555/earthengine-py-examples<filename>Datasets/Vectors/us_census_counties.py #!/usr/bin/env python """Display US Counties. """ # import datetime import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) Map.setCenter(-110, 40, 5) states = ee.FeatureCol...
liuxb555/earthengine-py-examples
Image/from_name.py
#!/usr/bin/env python """Display an image given its ID.""" import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) image = ee.Image('srtm90_v4') vis_params = {'min': 0, 'max': 3000} Map.addLayer(image, vis_params,"SRTM") Map.setCenter(0,0, 2) # Display the map. Map...
liuxb555/earthengine-py-examples
Datasets/Water/jrc_global_surface_water.py
<reponame>liuxb555/earthengine-py-examples<gh_stars>10-100 import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) dataset = ee.Image('JRC/GSW1_1/GlobalSurfaceWater') occurrence = dataset.select('occurrence'); occurrenceVis = {'min': 0.0, 'max': 100.0, 'palette': ['ff...
liuxb555/earthengine-py-examples
Datasets/naip_imagery.py
<filename>Datasets/naip_imagery.py import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) image = ee.Image('USDA/NAIP/DOQQ/m_4609915_sw_14_1_20100629') Map.addLayer(image, {'bands': ['N', 'R', 'G']}, 'NAIP') # Display the map. Map
liuxb555/earthengine-py-examples
MachineLearning/svm_classifier.py
<reponame>liuxb555/earthengine-py-examples import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) # Input imagery is a cloud-free Landsat 8 composite. l8 = ee.ImageCollection('LANDSAT/LC08/C01/T1') image = ee.Algorithms.Landsat.simpleComposite(**{ 'collection': ...
liuxb555/earthengine-py-examples
Datasets/Terrain/us_ned_topo_diversity.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) dataset = ee.Image('CSP/ERGo/1_0/US/topoDiversity') usTopographicDiversity = dataset.select('constant') usTopographicDiversityVis = { 'min': 0.0, 'max': 1.0, } Map.setCenter(-111.313, 39.724, 6) Map.addLaye...
liuxb555/earthengine-py-examples
Filter/filter_string_ends_with.py
<filename>Filter/filter_string_ends_with.py import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) states = ee.FeatureCollection('TIGER/2018/States') # Select states with its name ending with 'ia' selected = states.filter(ee.Filter.stringEndsWith('NAME', 'ia')) ...
liuxb555/earthengine-py-examples
Datasets/Vectors/us_census_states.py
<gh_stars>10-100 #!/usr/bin/env python """Display US States. """ import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) fc = ee.FeatureCollection('TIGER/2018/States') # .filter(ee.Filter.eq('STUSPS', 'MN')) image = ee.Image().paint(fc, 0, 2) Map.setCenter(-9...
liuxb555/earthengine-py-examples
Image/get_image_resolution.py
<reponame>liuxb555/earthengine-py-examples import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) naip = ee.Image('USDA/NAIP/DOQQ/m_3712213_sw_10_1_20140613') Map.setCenter(-122.466123, 37.769833, 17) Map.addLayer(naip, {'bands': ['N', 'R','G']}, 'NAIP') naip_res...
liuxb555/earthengine-py-examples
Visualization/random_color_visualizer.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) dataset = ee.Image('USGS/NLCD/NLCD2016') landcover = ee.Image(dataset.select('landcover')) Map.setCenter(-95, 38, 5) Map.addLayer(landcover.randomVisualizer(), {}, 'Landcover') # Display the map. Map
liuxb555/earthengine-py-examples
Image/landcover_cleanup.py
<filename>Image/landcover_cleanup.py<gh_stars>10-100 #!/usr/bin/env python """Landcover cleanup. Display the MODIS land cover classification image with appropriate colors. """ import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) Map.setCenter(-113.41842, 40.0554...
liuxb555/earthengine-py-examples
Gena/map_set_center.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) # Add some data to the Map dem = ee.Image("JAXA/ALOS/AW3D30_V1_1").select('MED') Map.addLayer(dem, {'min': 0, 'max': 5000, 'palette': ['000000', 'ffffff'] }, 'DEM', True) # TEST Map.setCenter Map.setCenter(0, 2...
liuxb555/earthengine-py-examples
Image/canny_edge_detector.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) # Canny Edge Detector example. # Load an image and compute NDVI from it. image = ee.Image('LANDSAT/LT05/C01/T1_TOA/LT05_031034_20110619') ndvi = image.normalizedDifference(['B4','B3']) # Detect edges in the c...
liuxb555/earthengine-py-examples
ImageCollection/filtering_by_band_names.py
<filename>ImageCollection/filtering_by_band_names.py<gh_stars>10-100 import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) roi = ee.Geometry.Point([-99.2182, 46.7824]) collection = ee.ImageCollection('USDA/NAIP/DOQQ') \ .filterBounds(roi) \ .filter(ee.Fi...
liuxb555/earthengine-py-examples
Join/save_best_joins.py
<gh_stars>10-100 import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) # Load a primary 'collection': Landsat imagery. primary = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA') \ .filterDate('2014-04-01', '2014-06-01') \ .filterBounds(ee.Geometry.Point(-122....
liuxb555/earthengine-py-examples
Join/save_all_joins.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) # Load a primary 'collection': Landsat imagery. primary = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA') \ .filterDate('2014-04-01', '2014-06-01') \ .filterBounds(ee.Geometry.Point(-122.092, 37.42)) # L...
liuxb555/earthengine-py-examples
Reducer/stats_by_group.py
<reponame>liuxb555/earthengine-py-examples import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) # Load a collection of US census blocks. blocks = ee.FeatureCollection('TIGER/2010/Blocks') # Compute sums of the specified properties, grouped by state code. sums = ...
liuxb555/earthengine-py-examples
HowEarthEngineWorks/Projections.py
import ee image = ee.Image('LANDSAT/LC8_L1T/LC80440342014077LGN00').select(0) print('Projection, crs, and crs_transform:', image.projection().getInfo()) print('Scale in meters:', image.projection().nominalScale().getInfo()) # Display the map. Map
liuxb555/earthengine-py-examples
NAIP/ndwi_map.py
<reponame>liuxb555/earthengine-py-examples<filename>NAIP/ndwi_map.py import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) collection = ee.ImageCollection('USDA/NAIP/DOQQ') fromFT = ee.FeatureCollection('ft:1CLldB-ULPyULBT2mxoRNv7enckVF0gCQoD2oH7XP') polys = from...
liuxb555/earthengine-py-examples
Gena/test_sentinel2.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) image = ee.ImageCollection('COPERNICUS/S2') \ .filterDate('2017-01-01', '2017-01-02').median() \ .divide(10000).visualize(**{'bands': ['B12', 'B8', 'B4'], 'min': 0.05, 'max': 0.5}) Map.setCenter(35.2, 31,...
liuxb555/earthengine-py-examples
FeatureCollection/simplify_polygons.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) waterSurface = ee.Image('JRC/GSW1_0/GlobalSurfaceWater') waterChange = waterSurface.select('transition') # Select Permanent Water Only: Permanent_Water = 1 # value 1 represents pixels of permenant water, no c...
liuxb555/earthengine-py-examples
Reducer/weighted_reductions.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) # Load a Landsat 8 input image. image = ee.Image('LANDSAT/LC08/C01/T1/LC08_044034_20140318') # Creat an arbitrary region. geometry = ee.Geometry.Rectangle(-122.496, 37.532, -121.554, 37.538) # Make an NDWI im...
liuxb555/earthengine-py-examples
Datasets/Terrain/srtm.py
<reponame>liuxb555/earthengine-py-examples import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) image = ee.Image('srtm90_v4') # path = image.getDownloadUrl({ # 'scale': 30, # 'crs': 'EPSG:4326', # 'region': '[[-120, 35], [-119, 35], [-119, 34], [-120, 3...
liuxb555/earthengine-py-examples
Datasets/Terrain/alos_chili.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) dataset = ee.Image('CSP/ERGo/1_0/Global/ALOS_CHILI') alosChili = dataset.select('constant') alosChiliVis = { 'min': 0.0, 'max': 255.0, } Map.setCenter(-105.8636, 40.3439, 11) Map.addLayer(alosChili, alosChi...
liuxb555/earthengine-py-examples
Image/image_smoothing.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) image = ee.Image('srtm90_v4') smoothed = image.reduceNeighborhood(**{ 'reducer': ee.Reducer.mean(), 'kernel': ee.Kernel.square(3), }) # vis_params = {'min': 0, 'max': 3000} # Map.addLayer(image, vis_...
liuxb555/earthengine-py-examples
GetStarted/03_finding_images.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) collection = ee.ImageCollection('LANDSAT/LC08/C01/T1') point = ee.Geometry.Point(-122.262, 37.8719) start = ee.Date('2014-06-01') finish = ee.Date('2014-10-01') filteredCollection = ee.ImageCollection('LANDSAT...
liuxb555/earthengine-py-examples
ImageCollection/filtered_composite.py
#!/usr/bin/env python """Filter an image collection by date and region to make a median composite. See also: Clipped composite, which crops the output image instead of filtering the input collection. """ import datetime import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100]...
liuxb555/earthengine-py-examples
FeatureCollection/buffer.py
#!/usr/bin/env python """Buffer Example. Display the area within 2 kilometers of any San Francisco BART station. """ import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) Map.setCenter(-122.4, 37.7, 11) bart_stations = ee.FeatureCollection('GOOGLE/EE/DEMOS/bart-...
liuxb555/earthengine-py-examples
FeatureCollection/reducing_feature_collection.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) def areaDiff(feature): area = feature.geometry().area().divide(1000 * 1000) # Compute the differece between computed area and the area property. diff = area.subtract(ee.Number.parse(feature.get('areasqkm'...
liuxb555/earthengine-py-examples
Visualization/visualizing_feature_collection.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) # Load a FeatureCollection from a table dataset: 'RESOLVE' ecoregions. ecoregions = ee.FeatureCollection('RESOLVE/ECOREGIONS/2017') # Display as default and with a custom color. Map.addLayer(ecoregions, {}, 'd...
liuxb555/earthengine-py-examples
JavaScripts/FromName.py
<reponame>liuxb555/earthengine-py-examples import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) # Display an image given its ID. image = ee.Image('CGIAR/SRTM90_V4') # Center the Map. Map.setCenter(-110, 40, 5) # Display the image. Map.addLayer(image, {'min': 0, ...
liuxb555/earthengine-py-examples
Image/hsv_pan_sharpen.py
<filename>Image/hsv_pan_sharpen.py<gh_stars>10-100 #!/usr/bin/env python """HSV-based Pan-Sharpening example.""" import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) # There are many fine places to look here is one. Comment # this out if you want to twiddle knob...
liuxb555/earthengine-py-examples
Visualization/image_color_ramp.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) # Load SRTM Digital Elevation Model data. image = ee.Image('CGIAR/SRTM90_V4'); # Define an SLD style of discrete intervals to apply to the image. sld_intervals = \ '<RasterSymbolizer>' + \ '<ColorMap typ...
liuxb555/earthengine-py-examples
ImageCollection/reducing_collection.py
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) def addTime(image): return image.addBands(image.metadata('system:time_start').divide(1000 * 60 * 60 * 24 * 365)) # Load a Landsat 8 collection for a single path-row. collection = ee.ImageCollection('LANDS...
liuxb555/earthengine-py-examples
NAIP/filtering.py
<reponame>liuxb555/earthengine-py-examples import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) collection = ee.ImageCollection('USDA/NAIP/DOQQ') fromFT = ee.FeatureCollection('ft:1CLldB-ULPyULBT2mxoRNv7enckVF0gCQoD2oH7XP') polys = fromFT.geometry() centroid =...