WEATHER FORECASTING
WEATHER FORECASTING
WEATHER FORECASTING
JULY 2024
I
SHADAN WOMEN’S COLLEGE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, New Delhi & Affiliated to JNTUH,
Hyderabad) Khairatabad, Hyderabad – 500 004
1 Abstract 10
2&3 Survey
10
4&5 Analysis
6 Design 10
7 Seminar-1+Report 20
Mid-1Total 50
8,9&10 Implementation 10
11 Testing 10
12 Execution 10
13 Seminar-2+ 20
Report
Mid-2Total 50
Incharge HOD
II
TABLE OF CONTENTS
CHAPTER PAGE
TITLE
NO. NO.
ABSTRACT 1
1 INTRODUCTION 2
1.1 General 2
1.2 Objective 2
2 LITERATURE SURVEY 4
2.1 General 4
3 REQUIREMENT ANALYSIS 6
3.1 General 6
III
3.3 Software Requirement 6
5 SYSTEM DESIGN 10
5.1 General 10
6 TESTING 17
6.1 General 17
IV
6.2 Unit Testing 18
7 IMPLEMENTATION 20
7.1 General 20
7.3 Screenshots 29
CONCLUSION 32
REFERENCES 33
V
LIST OF FIGURES
VI
ABSTRACT
On the fronted, HTML and CSS are employed to design an intuitive and user-friendly
interface. The design prioritizes simplicity and clarity, ensuring that users can easily interpret
the weather information displayed. This ensures that users can access weather forecasts
conveniently regardless of the device they are using. Overall, this project demonstrates a
robust and user-friendly weather forecast application. By providing accurate and accessible
weather information, the application aims to enhance users' ability to plan their activities
effectively based on current and forecasted weather conditions.
VII
Chapter 1
INTRODUCTION
1.1 GENERAL
Current weather apps lack simplicity and speed, making it challenging for users
to quickly access accurate information for specific cities. There is a need for streamlined web
application that prioritizes user-friendly interfaces, delivering real-time, precise weather
details for informed decision-making in travel, planning, and daily activities.
1.2 OBJECTIVE
The objective of this weather project is to design and implement an efficient and
user-friendly system that helps user to know about weather details of any city using its name
only.
User-friendly Interface
Accurate weather Details
Fast data Fetching
VIII
2. The data is then compiled, redistributed in the GTS, and used in various numerical
forecasting models. Typically, these numerical models begin with data collected between
the hours of 0000 and 1200 UTC (7 A.M. and 7 P.M. Eastern Standard Time, respectively).
3. To aid the forecaster, the data is printed, mapped, and graphed in several ways.
Furthermore, some "initialization" routines slightly change the data when it enters a
prediction model only for that model.
RB Multicast is a receiver-based protocol, which means that the relay node of a packet
transmission is decided by the potential receivers of the packet in a distributed manner.
In RB Multicast, the multicast routing uses the concepts of “virtual node” and “multicast region” for
forwarding packets closer to the destination multicast members and determining when
packets should be split into separate routes to finally reach the multicast members.
These networks are dynamic due to the mobility of the nodes in the network and/or the
random sleep/awake cycles that are often utilized to minimize energy dissipation of the devices the
performance of RB Multicast is compared to that of the unicast protocol to show the
performance gain achieved by the proposed multicast routing protocol.
The results show that RB Multicast achieves much better performance in terms of latency and
network traffic.
RB Multicast includes a list of the multicast members’ locations in the packet header, which
prevents the overhead of building and maintaining a multicast tree at intermediate sensor
nodes, because all the necessary information for routing the packet is included with in the
packet header
IX
Chapter 2
LITERATURE SURVEY
2.1 GENERAL
This chapter gives the literature survey about the various important techniques and
algorithms such as robust active shape model approach and local shape analysis method
needed to carry out the project. It also gives the information about drawbacks in the existing
robust active shape model approach and the advantages of local shape analysis.
Weather forecasting has been one of the most challenging difficulties around the world
because of both its practical value in popular scope for scientific study and meteorology.
Weather is a continuous, dynamic ,multidimensional chaotic process, and data-intensive and
these properties make weather forecasting a stimulating challenge. It is one of the most
imperious and demanding operational responsibilities that must be carried out by many
meteorological services all over the globe. Various organizations / workers in India and
abroad have done demonstrating using supported time series data manipulation. The various
methodologies viz. statistic decomposition models, Exponential smoothing models, ARIMA
models and their dissimilarities like seasonal ARIMA models, vector ARIMA models using
flexible time series, ARMAX models i.e. ARIMA with following informative variables etc.,
which has been used for forecasting purposes. Many training have taken place within the
analysis of pattern and circulation of rainfall in many regions of the world. Totally altered
time series methods with different purposes are used to investigate weather information in
many different literatures. Accurate and timely weather forecasting is a major challenge for
the scientific research.
X
Weather prediction modelling involves a combination of many computer models,
observations and acquaintance of trends and designs. Using these methods, practically
accurate forecasts can be made up. Regression is a statistical experimental technique and it
must be widely used in many business, the behaviour sciences, social and climate recasting
and many other areas. Agrawal et al. (1980) explained the phenomena for time series
regression models for forecasting the yield of rice in Raipur district on weekly data using
weather parameters [1]. In [2] the author Kuo and Sun, (1993) was used to Associate in
having intervention model for average10 days stream flow forecast and synthesis that was
investigated by to effect the extraordinary phenomena caused by typhoons and different
serious irregularities of the weather of the Tanshui geographical area in Taiwan. In [3] Chiew
et al, (1993) conducted a comparison of six rainfall-runoff modeling approaches to pretend
daily, monthly and annual flows in eight tolerant catchments. They concluded that time-series
approaches will agreement adequate estimates of monthly and annual yields within the water
capitals of the catchments. In [4] Langu, (1993) is another approach which used statistical
analysis to observe changes in weather and runoff patterns to go and look for important
changes inside the parts of variety of weather statistic. Box and Jenkins (1994), in early 1970's,
pioneered in developing methodologies for statistic indicating within the uni variate case often
known to Univariate Box-Jenkins (UBJ) ARIMA modeling in this approach of author[5].The
variables which describes weather conditions vary continuously with time in this explanation
we found that the author [6], describing time series of each and every parameter and can be
used to develop a forecasting model either statistically or using some new means that uses this
time series data (Chatfield 1994; Montgomery and Lynwood 1996). Several authors have
discussed the fuzziness associated with the weather systems.
In [7] Chaotic features are associated with the atmospheric phenomena also have fascinated
the attention of the modern scientists (Sivakumar 2001; Sivakumar et al. 1999; Men et al.
2004). At present, the valuation of the nature and causes of seasonal climate variability is still
formation. Since, it is a complicated phenomenon that includes many specialized fields of
know-how to work for weather prediction (Guhathakurata, 2006); therefore, in the field of
meteorology all assumptions are to be taken in the visage of uncertainty connected with local
of and global climatic variablesexplained that the modelled weather parameter using some of
the random methods.
Chapter 3
XI
REQUIREMENT ANALYSIS
3.1 GENERAL
This chapter provides details about the system requirements. The functional, non-
functional, hardware and software requirements are explained in detail. The functional
requirements define a function of system. The function is described as a set of input, the
behaviour and outputs. The non-functional requirement is a requirement that specifies criteria
that can be used to judge the operation of a system, rather than specific behaviors. The
hardware and software requirements describe about the tool and the languages used to build
the system.
XII
3.4 FUNCTIONAL REQUIREMENTS
The operator shall be able to input the weather periods to the system to view the
desired weather parameters within the particular periods.
The system shall be able to produce minimum, maximum and the average data of
a particular weather parameter when it is requested by an operator.
The system shall provide the following weather parameters: temperature,
pressure, wind speed & direction, rainfall, and humidity.
Chapter 4
XIII
METHODOLOGY
4.2 SYSTEM ARCHITECTURE
XIV
4.2 DATA FLOW DIAGRAM:
XV
Chapter 5
SYSTEM DESIGN
5.1 GENERAL
This chapter deals with unified modelling language. UML is a language for visualizing,
specifying, constructing and documenting artefacts of software intensive systems. The UML
has emerged as the de facto and de jure standard diagramming notation for object-oriented
modelling. UML includes a set of graphic notation techniques to create visual model of
object-oriented software-intensive systems.
UML notations are the most important elements in modelling. Efficient and
appropriate use of notations is very important for making a complete and meaningful model.
Different notations are available for things and relationships. And the UML diagrams are
made using the notations of things and relationships.
XVI
A classifier describes a set of instances that
Classifier have common behavioural and structural
Role features.
XVII
A node represents a physical component of
Node the system. Node is used to represent
physical part of a system like server,
network etc.
Component is used to represent any part of
Component a system for which UML diagrams are
made.
The top section is used to name the class.
The second one is used to show the
Class attributes of the class. The third section is
used to describe the operations performed
by the class.
Use case diagrams describe the functional behaviour of the system as seen by the user.
It shows a set of actors and use cases and their relationships. It is important for organizing and
modelling the external behaviour of the system. In the Fig.5.1 CT image and learning database
act as an external entity that interacts with the system. Ellipse drawn with a solid line,
represent the use case. An include relationship is that the base use case explicitly incorporates
the behaviour of another use case at a location specified in the base. An exclude relationship is
that the base use case implicitly incorporates the behaviour of another use case at a location
specified by the extending use case.
XVIII
5.4 ACTIVITY DIAGRAM
Activity Diagrams model the dynamic behaviour of a system, in particular the work
flow. Activity diagrams can be used to describe the business and operational step-by-step
workflows of components in a system. An activity diagram shows the overall flow of control.
The rounded rectangles represent activities,diamonds represent decisions,bars represent the
start (split) or end (join) of concurrent activities black circle represents the start (initial state)
of the workflow and an encircled black circle represents the end (final state).Arrows run from
the start towards the end and represent the order in which activities happen. Fig.5.2 represents
the activity diagram.
XIX
Sequence diagrams describe the dynamic behaviour between actors and the system and
between objects of the system. A sequence diagram shows, as parallel vertical lines (lifelines),
different processes or objects that live simultaneously, and, as horizontal arrows, the messages
exchanged between them, in the order in which they occur. This allows the specification of
simple runtime scenarios in a graphical manner.
XX
5.6 DATA FLOW DIAGRAM
State chart diagrams describe the dynamic behaviour of an individual object. This
behaviour is analyzed and represented in series of events, that could occur in one or more
possible states. Hereby "each diagram usually represents objects of a single class and track the
different states of its objects through
XXI
5.8 CLASS DIAGRAM
Class diagrams describe the static structure of the system: Objects, Attributes,
Associations. It shows a set of classes, interfaces and collaborations and their relationships.
Address static design view of a system.
In the design of a system, a number of classes are identified and grouped together in a class
diagram which helps to determine the static relations between those objects. With detailed
modelling, the classes of the conceptual design are often split into a number of subclasses.
XXII
Chapter 6
TESTING
6.1 GENERAL
Testing can never completely identify all the defects within software. Instead, it
furnishes a criticism or comparison that compares the state and behaviour of the product
against oracles, principles or mechanisms by which someone might recognize a problem.
These oracles may include (but are not limited to) specifications, contracts, comparable
products, past versions of the same product, inferences about intended or expected purpose,
user or customer expectations, relevant standards, applicable laws, or other criteria.
Every software product has a target audience. For example, the audience for video game
software is completely different from banking software. Therefore, when an organization
develops or otherwise invests in a software product, it can assess whether the software product
will be acceptable to its end users, its target audience, its purchasers, and other stakeholders.
Software testing is the process of attempting to make this assessment.
Not all software defects are caused by coding errors. One common source of expensive
defects is caused by requirement gaps, e.g., unrecognized requirements that result in errors of
omission by the program designer. A common source of requirements gaps is non-functional
requirements such as testability, scalability, maintainability, usability, performance and
security.
XXIII
6.2 UNIT TESTING
Test individual modules or components of the system in isolation to ensure they
function as intended.
We have a major weather details module which uses api to fetch the weather data,
in this testing step we take we make sure proper functionality of each component.
Verify that different modules and components of the Todays weather application
work together seamlessly.
Test data flow and interactions between various parts of the system.
Validate that the weather forecasting details its intended functions accurately and
efficiently.
Ensure that the user interface is user-friendly, intuitive, and visually appealing.
Check for consistency in design elements and responsiveness across different
devices.
XXIV
S..NO City State Country Expected result
XXV
Chapter 7
IMPLEMENTATION
7.1 GENERAL
This chapter provides detail about the implementation of the system. It gives a detailed
view about the steps in implementation of the project.
weather.py
@dataclass
class WeatherData:
main: str
description: str
icon: str
temperature: int
resp =
requests.get(fhttps://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid={
API_key}&units=metric').json()
data = WeatherData(
main = resp.get('weather')[0].get('main'),
description = resp.get('weather')[0].get('description'),
icon = resp.get('weather')[0].get('icon'),
XXVI
temperature = int(resp.get('main').get('temp'))
return data
return weather_data
2. Flask Application
app.py
def index():
data = None
if request.method == 'POST':
city = request.form['cityName']
state = request.form['stateName']
country = request.form['countryName']
3. .env File
API_KEY=your_openweathermap_api_key
XXVII
APPENDIX(SOURCE CODE):
Weather.py
load_dotenv()
api_key=os.getenv('API_KEY')
XXVIII
@dataclass
class WeatherData:
main : str
description : str
icon : str
temperature : int
def
get_lat_lon(cityName,stateCode,countryCode,A
PIkey):
resp=requests.get(f'http://api.openweath
ermap.org/geo/1.0/direct?q={cityName},{state
Code},{countryCode}&appid={APIkey}').json()
data = resp[0]
lat,lon = data.get('lat'),
data.get('lon')
return lat, lon
try:
# Make the API request
1
resp =
requests.get(f'http://api.openweathermap.org
/geo/1.0/direct?q={cityName},{stateCode},{co
untryCode}&appid={APIkey}').json()
except
requests.exceptions.RequestException as e:
# Handling any request exceptions
(e.g., network errors)
print(f"Request error: {e}")
return None, None
2
except (KeyError, IndexError) as e:
# Handling any key/index errors
print(f"Data error: {e}")
return None, None
3
app.py
app = Flask(__name__)
return
render_template('index.html',data=data)
if __name__ == '__main__':
app.run(debug=True)
4
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-
scale=1.0">
<title>My Weather App</title>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap
@5.3.3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-
QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2b
RjXh0JMhjY6hW+ALEwIH"
crossorigin="anonymous">
</head>
<body class="bg-warning text=white">
<div class = "text-center">
5
<form action="/" method="post">
<div class="container">
<div class="row">
<div class="col-sm">
<input type="text" id="cityName"
name="cityName" placeholder="City"
class="form-control">
</div>
<div class="col-sm">
<input type="text" id="stateName"
name="stateName" placeholder="State"
class="form-control">
</div>
<div class="col-sm">
<input type="text id=countryName"
name="countryName" placeholder="Country"
class="form-control">
</div>
<div >
<button
style="margin:30px" class="submit btn btn-
light">Find</button>
</div>
6
</div>
</div>
</form>
{% if data %}
<!--
{{data.main}}:{{ data.description }}<br> -
->
<img
src="https://openweathermap.org/img/wn/10d@2
x.png" alt="Icon">
{{data.temperature}} C
{% endif %}
</div>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@
5.3.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-
YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy
9GkcIdslK1eN7N6jIeHz"
crossorigin="anonymous"></script>"
7
</body>
</html>
7.3 SCREENSHOTS
8
7.3.2 Back End Screenshot
9
Chapter 8
10
CONCLUSION
This project successfully creates a simple weather web app using Python and Flask. It
fetches and displays current weather data by integrating the Open Weather Ma API. Key
points include:
API Integration: Fetches geographic and weather data using Open Weather map.
Web Development: Uses Flask for the web framework and Bootstrap for
responsive design.
User Interface: Provides a clean interface for users to input city details and get
weather updates.
Good Practices: Stores sensitive API keys in environment variables.
This project is a great starting point for learning web development and API integration,
offering a practical tool for real-time weather information.
11
REFERENCES
[1] https://www.google.com
[2] https://www.youtube.com
12