NC Forecast Extract Base To Weather Data Model
ECMWFExtractBaseToWeatherDataModel
Bases: TransformerInterface
Base class for extracting forecast data downloaded in .nc format from ECMWF MARS Server.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
load_path |
str
|
Path to local directory where the nc files will be stored, in format "yyyy-mm-dd_HH.nc" |
required |
date_start |
str
|
Start date of extraction in "YYYY-MM-DD HH:MM:SS" format |
required |
date_end |
str
|
End date of extraction in "YYYY-MM-DD HH:MM:SS" format |
required |
run_frequency |
str
|
Frequency format of runs to download, e.g. "H" |
required |
run_interval |
str
|
Interval of runs, e.g. a run_frequency of "H" and run_interval of "12" will extract the data of the 00 and 12 run for each day. |
required |
lat |
DataArray
|
Latitude values to extract from nc files |
required |
lon |
DataArray
|
Longitude values to extract from nc files |
required |
utc |
bool = True
|
Whether to convert the time to UTC or not |
True
|
Source code in src/sdk/python/rtdip_sdk/pipelines/transformers/spark/ecmwf/nc_extractbase_to_weather_data_model.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
|
system_type()
staticmethod
Attributes:
Name | Type | Description |
---|---|---|
SystemType |
Environment
|
Requires PYSPARK |
Source code in src/sdk/python/rtdip_sdk/pipelines/transformers/spark/ecmwf/nc_extractbase_to_weather_data_model.py
68 69 70 71 72 73 74 |
|
transform(tag_prefix, variables, method='nearest')
Extract raw data from stored nc filed downloaded via ECMWF MARS.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tag_prefix |
str
|
Prefix of the tag names of raw tags to be added to the dataframe |
required |
variables |
list
|
List of variable names of raw tags to be extracted from the nc files |
required |
method |
str
|
The method used to match latitude/longitude in xarray using .sel(), by default "nearest" |
'nearest'
|
Returns:
Name | Type | Description |
---|---|---|
df |
DataFrame
|
Raw data extracted with lat, lon, run_time, target_time as a pd.multiindex and variables as columns. |
Source code in src/sdk/python/rtdip_sdk/pipelines/transformers/spark/ecmwf/nc_extractbase_to_weather_data_model.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
|