Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This needs to be a Python function. Program Description: Purdue has a highly specialized team of experts that complete an annual statistical survey of astronomical

This needs to be a Python function.

image text in transcribedimage text in transcribedimage text in transcribed

Program Description: Purdue has a highly specialized team of experts that complete an annual statistical survey of astronomical anomalies. This survey, "Boiler Observatory Yearly Analysis" (or BOOYA) has a highly specialized system for the detection and observation of Radio Pulsar Galaxies like Centaurus A and Messier 87 that emit very strong radio signals. Recently, the discovery of several new radio pulsar galaxies displaying unique characteristics has sparked increased interest in the project. The Spin Period and the Orbital Period of each signal can be used like a fingerprint to determine which pulsar is being detected. BOOYA researchers are focused on several new pulsars and have tracked the signals received over a specific time period in several separate files: signall.dat, signal2.dat and signal3.dat. Their equipment detects and records the time Spin Period and Orbital Period (in seconds) from the pulsar and saves it to the data file. The project team wants a program to identify the source of each signal using each pulsar's unique spin/orbit period "fingerprint". Pulsar GRO J1744-28 4U 1626-67 Hercules X-1 SMC X-1 Centaurus X-3 LMC X-4 OAO 1657-415 Vela X-1 Spin Period 0.467 7.66 1.24 0.717 4.82 13.5 37.7 283 Orbital Period 11.8 0.0289 1.7 3.89 2.09 1.41 10.4 8.96 The Data Files: The data is stored (line-by-line) in simple, text files with the extension .dat which can opened using the Python open() function. Three files are provided and an example of the data from the signall.dat file is shown in Figure 1. 7.66, 0.0289 283, 8.96 1.24, 1.7 0.717, 3.89 1.24, 1.7 0.717, 3.89 0.467, 11.8 Figure 1 - Part of signall.dat The Lab Prep 4 Assignment Write a Python program named labprep4.py containing a function named ident) that reads the data from a single file and displays which Pulsars are detected. The results will be formatted as shown in the Example Outputs section. TO DO #1: Setup your Python program file labprep4.py Open a new, blank Python program window. At the top of the file and without indenting, enter the following header using comments: # CS-177 labprep1.py # {Student Name Here} # Following Coding Standards and Guidelines # This is a demonstration of the basic Python file functions # The ident function reads a series of spin/orbital data # from the specified file and displays the source Pulsar's name. The data comes from the Purdue Pulsar Lab's observations TO DO #2: The ident() Function Write a function named ident that accepts the name of a data file to process as an argument. The ident() function should be fully documented (use Pseudocode comments) and will perform the following tasks: Accept the filename to be read as an argument Display a header identifying the output (see Example Outputs) Open and read the data from the filename specified as an argument Evaluate each signal Spin Orbital value in the file to determine the originating Pulsar (HINT: Use a for loop and if statements) Display the name of each Pulsar in the order they are detected in the data file Close the data file The ident() function should not return any values Lab Prep 4: Example Output: After completion, your ident() function's output should match the following: >>> ident("signal1.dat") >>> ident("signal2.dat") >> ident("signal3.dat") Reading data file... Reading data file... Reading data file... Pulsars found: Pulsars found: Pulsars found: 4U 1626-67 Vela X-1 Hercules X-1 SMC X-1 Hercules X-1 SMC X-1 GRO J1744-28 LMC X-4 Centaurus X-3 4U 1626-67 SMC X-1 OAO 1657-415 GRO J1744-28 Centaurus X-3 ILMC X-4 SMC X-1 Centaurus X-3 OAO 1657-415 4U 1626-67 Hercules X-1 GRO J1744-28 4U 1626-67 4U 1626-67 GRO J1744-28 Hercules X-1 4U 1626-67 4U 1626-67 GRO J1744-28 Vela X-1 OAO 1657-415 SMC X-1 40 1626-67 JOAO 1657-415 Hercules X-1 Hercules X-1 SMC X-1 SMC X-1 OAO 1657-415 LMC X-4 Vela X-1 40 1626-67 OAO 1657-415 Centaurus X-3 SMC X-1 GRO J1744-28 GRO J1744-28 Hercules X-1 End of report. End of report. End of report. Program Description: Purdue has a highly specialized team of experts that complete an annual statistical survey of astronomical anomalies. This survey, "Boiler Observatory Yearly Analysis" (or BOOYA) has a highly specialized system for the detection and observation of Radio Pulsar Galaxies like Centaurus A and Messier 87 that emit very strong radio signals. Recently, the discovery of several new radio pulsar galaxies displaying unique characteristics has sparked increased interest in the project. The Spin Period and the Orbital Period of each signal can be used like a fingerprint to determine which pulsar is being detected. BOOYA researchers are focused on several new pulsars and have tracked the signals received over a specific time period in several separate files: signall.dat, signal2.dat and signal3.dat. Their equipment detects and records the time Spin Period and Orbital Period (in seconds) from the pulsar and saves it to the data file. The project team wants a program to identify the source of each signal using each pulsar's unique spin/orbit period "fingerprint". Pulsar GRO J1744-28 4U 1626-67 Hercules X-1 SMC X-1 Centaurus X-3 LMC X-4 OAO 1657-415 Vela X-1 Spin Period 0.467 7.66 1.24 0.717 4.82 13.5 37.7 283 Orbital Period 11.8 0.0289 1.7 3.89 2.09 1.41 10.4 8.96 The Data Files: The data is stored (line-by-line) in simple, text files with the extension .dat which can opened using the Python open() function. Three files are provided and an example of the data from the signall.dat file is shown in Figure 1. 7.66, 0.0289 283, 8.96 1.24, 1.7 0.717, 3.89 1.24, 1.7 0.717, 3.89 0.467, 11.8 Figure 1 - Part of signall.dat The Lab Prep 4 Assignment Write a Python program named labprep4.py containing a function named ident) that reads the data from a single file and displays which Pulsars are detected. The results will be formatted as shown in the Example Outputs section. TO DO #1: Setup your Python program file labprep4.py Open a new, blank Python program window. At the top of the file and without indenting, enter the following header using comments: # CS-177 labprep1.py # {Student Name Here} # Following Coding Standards and Guidelines # This is a demonstration of the basic Python file functions # The ident function reads a series of spin/orbital data # from the specified file and displays the source Pulsar's name. The data comes from the Purdue Pulsar Lab's observations TO DO #2: The ident() Function Write a function named ident that accepts the name of a data file to process as an argument. The ident() function should be fully documented (use Pseudocode comments) and will perform the following tasks: Accept the filename to be read as an argument Display a header identifying the output (see Example Outputs) Open and read the data from the filename specified as an argument Evaluate each signal Spin Orbital value in the file to determine the originating Pulsar (HINT: Use a for loop and if statements) Display the name of each Pulsar in the order they are detected in the data file Close the data file The ident() function should not return any values Lab Prep 4: Example Output: After completion, your ident() function's output should match the following: >>> ident("signal1.dat") >>> ident("signal2.dat") >> ident("signal3.dat") Reading data file... Reading data file... Reading data file... Pulsars found: Pulsars found: Pulsars found: 4U 1626-67 Vela X-1 Hercules X-1 SMC X-1 Hercules X-1 SMC X-1 GRO J1744-28 LMC X-4 Centaurus X-3 4U 1626-67 SMC X-1 OAO 1657-415 GRO J1744-28 Centaurus X-3 ILMC X-4 SMC X-1 Centaurus X-3 OAO 1657-415 4U 1626-67 Hercules X-1 GRO J1744-28 4U 1626-67 4U 1626-67 GRO J1744-28 Hercules X-1 4U 1626-67 4U 1626-67 GRO J1744-28 Vela X-1 OAO 1657-415 SMC X-1 40 1626-67 JOAO 1657-415 Hercules X-1 Hercules X-1 SMC X-1 SMC X-1 OAO 1657-415 LMC X-4 Vela X-1 40 1626-67 OAO 1657-415 Centaurus X-3 SMC X-1 GRO J1744-28 GRO J1744-28 Hercules X-1 End of report. End of report. End of report

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

What is the lookback period?

Answered: 1 week ago

Question

13.6 Explain how to set up aflexible benefits program.

Answered: 1 week ago

Question

13.2 Describe five government-mandated benefits.

Answered: 1 week ago