辅导Python Programming、辅导WindandSolar、讲解Python程序、Python设计讲解

- 首页 >> Python编程

Python Programming – Assignment 1 - 2018

Design a solution and implement the solution in Python to solve the problem described below.

Historical data for solar radiation and wind speeds is available (along with other sensor information) in the files that you have been given. Data is logged at intervals of 10 minutes. Each file contains a year’s worth of data for multiple sensors. Data for each date-time recording are on separate rows. Within each row, the value for each sensor is separated by a comma. The sensor codes are shown below.

You have a client who is interested in a program which can give the following answers. You should provide a suitable menu with an exit option in your main program. When designing the output, imagine yourself as the user of the program. You want the user interaction to be user friendly on the command line. Do not use GUI interaction.

1.The maximum wind speed for a specified month and year. (print on screen only)

2.Average wind speed for each month of a specified year. (print on screen only)

3.Total solar radiation in kWh/m2 for each month of a specified year. (print on screen only)

4.Average wind speed km/h and total solar radiation in kWh/m2 for each month of a specified year. (write to a file called “WindandSolar.csv”)

Format: Year,Month,Wind Speed,Solar Radiation

Example format is:

1905 January,5.5,196.4 February,4.5,200.3 ...

Year is specified on the first line and the subsequent lines list the month and the average wind speed and the total solar radiation for each month. The values are comma separated.

If data is not available for any month, do not output the month for menu item 4. If the entire year’s data is not available, output just the year but no monthly data. For menu items 1 – 3, output a suitable message indicating what data is not available.

5.Given a Date in the form dd/mm/yyyy, show the times for the highest solar radiation for that Date. Output to screen using this sample format: (There will be one or more time values that are output.)

   Date: 11/1/2019

   High solar radiation for the day: 1046 W/m2


Time:

   10::40

   11:30

6.Exit the program.

The date, month and/or year are specified by the user. Your program asks for these on the command line and the user types in the required values and presses the “Enter” key.

Processing:

Your program must first load the data from multiple files. After loading the data, a menu is displayed to the user.

Sensor Codes


T Ambient Air Temperature 1m

DP Dew Point Temperture

BPBarometric Pressure (Instrument)

QFEBarometric Pressure (QFE Station Elevation)

QFFBarometric Pressure (QFF Mean Sea Level)

QNHBarometric Pressure (QNH Aviation Standard)

RF10Rainfall (10min)

RFRainfall (Accumulated)

EV10Evaporation (10min)

EVEvaporation (Accumulated)

RHRelative Humidity

SWind Speed (10min Mean) 10m

DtaWind Direction (10min Mean) 10m

SxWind Gust Speed 10m

DtxWind Gust Direction 10m

SsWind Speed (10min SD) 10m

DtsWind Direction (10min SD) 10m

WsWind Speed 10m

WdWind Direction 10m

SRSolar Radiation (10min Avg)

T10Soil Temperature (Depth 10cm)

T20Soil Temperature (Depth 20cm)

T30Soil Temperature (Depth 30cm)

T40Soil Temperature (Depth 40cm)

T50Soil Temperature (Depth 50cm)

T60Soil Temperature (Depth 60cm)

T70Soil Temperature (Depth 70cm)

T80Soil Temperature (Depth 80cm)

T90Soil Temperature (Depth 90cm)

T100Soil Temperature (Depth 100cm)

T110Soil Temperature (Depth 110cm)

T120Soil Temperature (Depth 120cm)

M10Soil Moisture (Depth 10cm)

M20Soil Moisture (Depth 20cm)

M30Soil Moisture (Depth 30cm)

M40Soil Moisture (Depth 40cm)

M50Soil Moisture (Depth 50cm)

M60Soil Moisture (Depth 60cm)

M70Soil Moisture (Depth 70cm)

M80Soil Moisture (Depth 80cm)

M90Soil Moisture (Depth 90cm)

M100Soil Moisture (Depth 100cm)

M110Soil Moisture (Depth 110cm)

M120Soil Moisture (Depth 120cm)


站长地图