0% found this document useful (0 votes)
36 views19 pages

Cs Project File by Maneet Gupta Class 12 A1

The document describes a satellite management system created in Python. The system allows users to store satellite data, filter records, add new entries, update details, and visualize satellites in orbit. Key functions include adding records, updating satellite details, filtering the database based on attributes, and using turtle graphics to simulate satellite orbits around Earth. The system provides an interactive menu for users to manage satellite data in a database.

Uploaded by

princekoshthi
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)
36 views19 pages

Cs Project File by Maneet Gupta Class 12 A1

The document describes a satellite management system created in Python. The system allows users to store satellite data, filter records, add new entries, update details, and visualize satellites in orbit. Key functions include adding records, updating satellite details, filtering the database based on attributes, and using turtle graphics to simulate satellite orbits around Earth. The system provides an interactive menu for users to manage satellite data in a database.

Uploaded by

princekoshthi
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
You are on page 1/ 19

RALLI

INTERNATIONAL
SCHOOL

Session 2023-24
:Investigatory Project:
“Satellite Management and Systems”

Submitted by: Date:


MANEET GUPTA
Roll Number:
In the modern era of Space exploration, the need of Satellite
management systems has increased by many-folds.
In order to fulfill the needs of growing humanity, I have
handcrafted a satellite management system in PYTHON,
which can store data smartly and can even make you
visualize the satellites in orbit.
A satellite is a man-made object inserted by rockets in
elliptical/spherical earth orbits to enhance inter-countries
connectivity, data transmission and Geo-Location.
Once Upon a time in a PYTHON OUTPUT WINDOW….
Database sample:

Execution:

The code starts with greeting and options to interact with


the database.
User has to enter choice number index to perform specific
task.
1. Filter and show database
2. Add entry to database
3. Update satellite details
4. Imagine the satellites
5. CLOSE
6. SHOW
def filter():
print("Filter parameter: index")
print(" Sattelite name: 1 || company: 2 || date of
launch: 3 || Mission Status :4")
change = input("enter parameter index you want to filter
with and the value seprated by space: ")
b = change.split()

dump = []
for i in master:
if (i[int(b[0])] == b[1]):
dump.append(i)
return dump

~ by choosing 1 in main menu, the user can filter the database to


show records with same attributes
~ for example, I want to filter the satellites which are “ACTIVE”
in orbit.
def add():
try:
a = datetime.datetime.now(pytz.timezone('Asia/Kolkata'))
n = int(input("Enter the number of entries you wish to enter: "))
for i in range(n):
a1 = input("Enter Sattelite ID: ")
a2 = input("Enter Sattelite Name: ")
a3 = input("Enter Sattelite Company: ")
a4 = input("Enter Sattelite Date of launch in yyyymmdd: ")
a5 = input("Enter Mission Status: ")
y = datetime.datetime.now(pytz.timezone('Asia/Kolkata'))
x = datetime.date(int(a4[:4]), int(a4[4:6]), int(a4[6:8]))
a6 = y.date() - x
z = (a4[6:8]) + "-" + (a4[4:6]) + "-" + (a4[:4])
lst = [a1, a2, a3, z, a5, a6.__str__()]
master.append(lst)
if n != 1:
print("Entry ",i+1, " Successful")
error = 0
t = (master,error)
print("Congractulations, Entry ADDED succesfully!!!!")
return t
except:
print("TRY AGAIN")
let’s suppose I have to add two new records of newly launched
missions then the system output would look like:

If by mistake some entry is given in wrong datatype then the


code will break and returns to main menu
def update():
try:
satidd = input("enter sattelite id you want to change:
")
print("Change parameter: index")
print(" Sattelite name: 1 || company: 2 || date of
launch: 3 || Mission Status :4")
change = input("enter parameter index you want to
change and new value seperated by space: ")
b = change.split()

for i in master:
if (i[0] == satidd):
i[int(b[0])] = b[1]
print("Your data has been updated")
except:
print("TRY AGAIN")
Lets suppose I have to update the status of satellite of index
A01: Chandrayaan from ACTIVE to FINISHED, then the update
dialogue would look like:

If by mistake user entered any unwanted registry or in any other


format then the code would break and return to main menu
def imagine():
d = 1
c = 1
screen = turtle.getscreen()
screen.bgcolor("black")
earth = turtle.getturtle()
earth.shapesize(3)
earth.color("blue")
earth.pencolor("green")
earth.pensize(3)
earth.shape("circle")
a1, a2, a3, a4, a5 = [turtle.Turtle(), turtle.Turtle(),
turtle.Turtle(), turtle.Turtle(), turtle.Turtle()]
satid = [a1, a2, a3, a4, a5]
colors = ["red", "orange", "yellow", "brown", "white"]
speed = [0.8, 0.6, 0.5, 0.4, 0.3]
rad = [100, 150, 200, 250, 300]
for a in range(5):
t = satid[a]
t = turtle.Turtle()

turtle.write("")

while d == 1:
for i in range(5):
a = satid[i]
a.penup()
a.shape("circle")
a.shapesize(1)
a.color(colors[i])
c = speed[i] + 0.1
speed[i] = c
a.setpos(rad[i] * math.sin(c), rad[i] * math.cos(c))
a.pendown()
Using the power of python and turtle, we can animate satellites to
depict them around our planet earth.
def Describe(b):
a = datetime.datetime.now(pytz.timezone('Asia/Kolkata'))
print("************** Sattelite services Online *****************")
print("Date: ", a.date())
print("time", a.time())

print("----------------------------------------------------------------
------------")
print(
"**| Sattelite ID | Sattelite name | Company |
Date of Launch | Mission Status | Duration in orbit |")
for i in b:
print("--| ", end="")
for j in i:
x = (" " * (18 - len(j))) + "| "
print(j, end=x)
print()

describe function is used to show the data base in tabular form.

Finally, we can close, save the file and exit the code using option
5
Using python and turtle I have created a nomial database visualiser.

• The data is stored in form of binary in binary file name “file.dat”


and the master table is retrieved and stored in same.
• I have used functions to have accessible codes wherever I would
ned them
• I have used try-except statements to errorproof the entry mistakes
• I have used control statements in most of the programs.

import pickle #used for handling binary files


import datetime # used to retrieve date and time from computer
import pytz # used to retrieve date and time in time zone
import math # used for mathematic functions like sin, cos
import turtle # used for turtle graphics
import pickle
import datetime
import pytz
import math
import turtle

def imagine():
d = 1
c = 1
screen = turtle.getscreen()
screen.bgcolor("black")
earth = turtle.getturtle()
earth.shapesize(3)
earth.color("blue")
earth.pencolor("green")
earth.pensize(3)
earth.shape("circle")
a1, a2, a3, a4, a5 = [turtle.Turtle(), turtle.Turtle(),
turtle.Turtle(), turtle.Turtle(), turtle.Turtle()]
satid = [a1, a2, a3, a4, a5]
colors = ["red", "orange", "yellow", "brown", "white"]
speed = [0.8, 0.6, 0.5, 0.4, 0.3]
rad = [100, 150, 200, 250, 300]
for a in range(5):
t = satid[a]
t = turtle.Turtle()

turtle.write("")

while d == 1:
for i in range(5):
a = satid[i]
a.penup()
a.shape("circle")
a.shapesize(1)
a.color(colors[i])
c = speed[i] + 0.1
speed[i] = c
a.setpos(rad[i] * math.sin(c), rad[i] *
math.cos(c))
a.pendown()

def add():
try:
a =
datetime.datetime.now(pytz.timezone('Asia/Kolkata'))
n = int(input("Enter the number of entries you wish to
enter: "))
for i in range(n):
a1 = input("Enter Sattelite ID: ")
a2 = input("Enter Sattelite Name: ")
a3 = input("Enter Sattelite Company: ")
a4 = input("Enter Sattelite Date of launch in
yyyymmdd: ")
a5 = input("Enter Mission Status: ")
y =
datetime.datetime.now(pytz.timezone('Asia/Kolkata'))
x = datetime.date(int(a4[:4]), int(a4[4:6]),
int(a4[6:8]))
a6 = y.date() - x
z = (a4[6:8]) + "-" + (a4[4:6]) + "-" + (a4[:4])
lst = [a1, a2, a3, z, a5, a6.__str__()]
master.append(lst)
if n != 1:
print("Entry ",i+1, " Successful")
error = 0
t = (master,error)
print("Congractulations, Entry ADDED succesfully!!!!")
return t
except:
print("TRY AGAIN")

def update():
try:
satidd = input("enter sattelite id you want to change:
")
print("Change parameter: index")
print(" Sattelite name: 1 || company: 2 || date of
launch: 3 || Mission Status :4")
change = input("enter parameter index you want to
change and new value seperated by space: ")
b = change.split()

for i in master:
if (i[0] == satidd):
i[int(b[0])] = b[1]
print("Your data has been updated")
except:
print("TRY AGAIN")
def filter():
print("Filter parameter: index")
print(" Sattelite name: 1 || company: 2 || date of
launch: 3 || Mission Status :4")
change = input("enter parameter index you want to filter
with and the value seprated by space: ")
b = change.split()

dump = []
for i in master:
if (i[int(b[0])] == b[1]):
dump.append(i)
return dump
def Describe(b):
a = datetime.datetime.now(pytz.timezone('Asia/Kolkata'))
print("************** Sattelite services Online
*****************")
print("Date: ", a.date())
print("time", a.time())

print("---------------------------------------------------
-------------------------")
print(
"**| Sattelite ID | Sattelite name | Company
| Date of Launch | Mission Status | Duration in orbit
|")
for i in b:
print("--| ", end="")
for j in i:
x = (" " * (18 - len(j))) + "| "
print(j, end=x)
print()

'''###########################################################
##############################################################
##############################################################
##############################################################
##############################################################
###################################'''

f = open("file.dat","rb+")

master = pickle.load(f)
x= 1
print("Welcome to satellite database managment system by
maneet gupta !!!!!!!!!")
while x == 1:

print("What you want to do today? ")


print(""" 1. Filter and show database
2. Add entry to database
3. Update sattelite details
4. Imagine the sattelites (Coding at max)
5. CLOSE
6. SHOW
""")
n = int(input("Enter the CHOICE: "))
if n == 1:
a = filter()
Describe(a)
elif n == 2:
try:
master,xxx = add()
except:
pass
elif n == 3:
update()

elif n == 4:
imagine()
elif n== 5:
x=0
pickle.dump(master,f)
print("Closed successfully")
f.close()
else:
Describe(master)
• https://www.python.org/
• https://docs.python.org/3/library/turtle.html
• https://www.google.com/
• https://www.geeksforgeeks.org/
• Computer science: NCERT Class 12

You might also like