0% found this document useful (0 votes)
6 views2 pages

Latihan Visualisasi API

Uploaded by

VIQRI FAHREZI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Latihan Visualisasi API

Uploaded by

VIQRI FAHREZI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

from pathlib import Path

import pandas as pd
import plotly.express as px

file_path = Path("weather_data/MODIS_C6_1_SouthEast_Asia_7d.csv")
data_kebakaran = pd.read_csv(file_path)

kecerahan = data_kebakaran['brightness']
lons = data_kebakaran['longitude']
lats = data_kebakaran['latitude']
data_1 = data_kebakaran['track']

latitude = data_kebakaran['latitude']
longitude = data_kebakaran['longitude']
brightness = data_kebakaran['brightness']
scan = data_kebakaran['scan']
acq_date = data_kebakaran['acq_date']
acq_time = data_kebakaran['acq_time']
satellite = data_kebakaran['satellite']
confidence = data_kebakaran['confidence']
version = data_kebakaran['version']
bright_t31 = data_kebakaran['bright_t31']
frp = data_kebakaran['frp']
daynight = data_kebakaran['daynight']

judul = 'Kebakaran Aktif di Asia Tenggara (7 hari Terakhir)'


fig = px.scatter_geo(data_kebakaran, lat=lats, lon=lons, size=kecerahan,
title=judul,
color=kecerahan,
color_continuous_scale='icefire',
labels={'color': 'Brightness'},
projection='natural earth',
hover_name=data_1,
hover_data={'latitude': True, 'longitude': True,
'brightness': True,
'scan': True, 'acq_date': True, 'acq_time':
True,
'satellite': True, 'confidence': True,
'version': True,
'bright_t31': True, 'frp': True, 'daynight':
True},
custom_data=[latitude, longitude, brightness, scan,
acq_date, acq_time,
satellite, confidence, version, bright_t31,
frp, daynight]
)
fig.update_geos(showcoastlines=True, coastlinecolor="Black", showland=True,
landcolor="LightGray")

fig.show()
fig.write_html('visualpetakebakaran.html')

You might also like