Environment Analysis - EuRoC Example¶

This notebook intends to present you a brief description of what is possible to be done by using this class of RocketPy library. Analyzing weather historical data is of upmost importance for rocket launch operations, specially with regards to range closure decision which may impact safety and rocket flight performance, therefore the results presented here may be useful to support your launch operation design.

In this case we are going to use the European Rocketry Challenge location to perform an historical analysis over the last 20 years (i.e. from 2002 to 2021). However, Environment Analysis allows for both different location and time range to be analyzed as well.

Let’s start by importing the required libraries for our work:

[1]:

%load_ext autoreload

[2]:

%matplotlib inline

[3]:

from rocketpy.EnvironmentAnalysis import EnvironmentAnalysis
from datetime import datetime
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats


The next cell will capture the dataset file previous downloaded. For more details about how to get .nc files for another specific time and location, please consult the following thread:

[4]:

env_analysis = EnvironmentAnalysis(
start_date=datetime(2002, 10, 6),  # (Year, Month, Day)
end_date=datetime(2021, 10, 23),  # (Year, Month, Day)
start_hour=4,
end_hour=20,
latitude=39.3897,
longitude=-8.28896388889,
surfaceDataFile="../../data/weather/EuroC_single_level_reanalysis_2002_2021.nc",
pressureLevelDataFile="../../data/weather/EuroC_pressure_levels_reanalysis_2001-2021.nc",
timezone="Portugal",
unit_system="metric",
)

/home/patrick/projects/RocketPy/venv/lib/python3.8/site-packages/rocketpy-0.12.0-py3.8.egg/rocketpy/EnvironmentAnalysis.py:152: UserWarning: Please notice this class is still under development, and some features may not work as expected as they were not exhaustively tested yet. In case of having any trouble, please raise an issue at https://github.com/RocketPy-Team/RocketPy/issues


Overview of .nc files¶

Running the EnvironmentAnalysis class requires two NETcdf(.nc) files. NETcdf is a data format that storages climate data easily accessible only through libraries such as netCDF4. In RocketPy we will use these datasets to get variables such as temperature and wind speed at specific times and locations. The first one, SurfaceDataFile, must be an .nc file containing environment information about the surface temperature, U and V components of the wind at 10 and 100 meters from the surface etc, that can be found, for example, in ERA5 hourly data on single levels files (https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-single-levels). The second one, pressureLevelDataFile, must be an .nc file containing the geopotential, U and V components of wind and temperature for each pressure level. These variables can be found, for example, in ERA5 hourly data on pressure levels files (https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-pressure-levels).

Surface level Analysis¶

At this first section we are looking for at the surface level. Data from surface analysis usually come with bigger amounts of information and therefore are important to give us a complete understanding of the scenario faced at the place and time that we are analysing.

A good start on our analysis is by checking numerical values that are critical for the selected time range.

[5]:

env_analysis.allInfo()

Dataset Information:
Time Period: From  2002-10-06 00:00:00+01:00  to  2021-10-23 00:00:00+01:00
Available hours: From  4  to  20
Surface Data File Path:  ../../data/weather/EuroC_single_level_reanalysis_2002_2021.nc
Latitude Range: From  40.0 ° To  39.0 °
Longitude Range: From  -9.0 ° To  -8.0 °
Pressure Data File Path:  ../../data/weather/EuroC_pressure_levels_reanalysis_2001-2021.nc
Latitude Range: From  40.0 ° To  39.0 °
Longitude Range: From  -9.0 ° To  -8.0 °

Launch Site Details
Launch Site Latitude: 39.38970°
Launch Site Longitude: -8.28896°
Surface Elevation (from surface data file):  113.00194018037647
Max Expected Altitude:  None   m

Pressure Information
Average Surface Pressure: 1002.19 ± 5.20 hPa
Average Pressure at 305 m: 965.50 ± 8.92 hPa
Average Pressure at 3048 m: 694.84 ± 8.92 hPa
Average Pressure at 9144 m: 307.35 ± 8.92 hPa

Sustained Surface Wind Speed Information (10 m above ground)
Historical Maximum Wind Speed: 12.14 m/s
Historical Minimum Wind Speed: 0.03 m/s
Average Daily Maximum Wind Speed: 4.36 m/s
Average Daily Minimum Wind Speed: 1.79 m/s

Elevated Wind Speed Information (100 m above ground)
Historical Maximum Wind Speed: 17.72 m/s
Historical Minimum Wind Speed: 0.05 m/s
Average Daily Maximum Wind Speed: 6.83 m/s
Average Daily Minimum Wind Speed: 3.03 m/s

Wind Gust Information
Historical Maximum Wind Gust: 22.91 m/s
Average Daily Maximum Wind Gust: 9.05 m/s

Temperature Information
Historical Maximum Temperature: 36.39 degC
Historical Minimum Temperature: 6.41 degC
Average Daily Maximum Temperature: 23.68 degC
Average Daily Minimum Temperature: 13.71 degC

Precipitation Information
Percentage of Days with Precipitation: 5.6%
Maximum Precipitation: 29.7 mm
Average Precipitation: 1.8 mm

Cloud Base Height Information
Average Cloud Base Height: 1768.47 m
Minimum Cloud Base Height: 30.18 m
Percentage of Days Without Clouds: 66.6 %


It’s also important to look at the variation of temperature and wind distribution throught a typical day, which can be easily done by running the next code cells:

[8]:

env_analysis.plot_average_temperature_along_day()


We can also take a look at sustained surface wind and wind gust plots!

[9]:

env_analysis.plot_average_surface10m_wind_speed_along_day(windSpeedLimit=True)

[10]:

# help(env_analysis.plot_average_sustained_surface100m_wind_speed_along_day)
env_analysis.plot_average_sustained_surface100m_wind_speed_along_day()

[11]:

# help(EnvironmentAnalysis.plot_sustained_surface_wind_speed_distribution_over_average_day)
env_analysis.plot_sustained_surface_wind_speed_distribution_over_average_day()

[12]:

env_analysis.animate_sustained_surface_wind_speed_distribution_over_average_day()

[12]: