https://colab.research.google.com/assets/colab-badge.svg

Collar Voltage#

Setup#

Ecoscope#

[ ]:
!pip install ecoscope &> /dev/null
[ ]:
import getpass
import os
import sys

import pandas as pd

import ecoscope

ecoscope.init()

Google Drive Setup#

[ ]:
output_dir = "Ecoscope-Outputs"

if "google.colab" in sys.modules:
    from google.colab import drive

    drive.mount("/content/drive/", force_remount=True)
    output_dir = os.path.join("/content/drive/MyDrive/", output_dir)

os.makedirs(output_dir, exist_ok=True)

Connect EarthRanger#

[ ]:
ER_SERVER = os.getenv("ER_SERVER", "https://mep-dev.pamdas.org")
ER_USERNAME = os.getenv("ER_USERNAME", "username")  # replace with your username

ER_PASSWORD = os.getenv("ER_PASSWORD", "")

if not ER_PASSWORD:
    ER_PASSWORD = getpass.getpass("Please enter your ER password: ")

er_io = ecoscope.io.EarthRangerIO(
    server=ER_SERVER,
    username=ER_USERNAME,
    password=ER_PASSWORD,
    tcp_limit=5,
    sub_page_size=4000,
)

Download Observations with Details#

[ ]:
observations = er_io.get_subjectgroup_observations(
    group_name="Elephants_Shimba",
    include_subject_details=True,
    include_subjectsource_details=True,
    include_details=True,
)
[ ]:
observations.head()

Plot Collar Voltage#

[ ]:
start_time = pd.Timestamp("2022-06-02").isoformat()
start_time
[ ]:
ecoscope.plotting.plot_collar_voltage(observations, start_time=start_time)