How to read EBAS files
- Either, find files that are available in the provided database, as explained in HOWTO_find_EBAS_files, OR:
- Download (and unzip) the NASA Ames files (.nas) you need from EBAS database (shown below)
import pyaerocom as pya
ls EBAS_FILES/
fpath = 'EBAS_FILES/' + 'NO0042G.20050101000000.20120101000000.aws.wind_speed.met.1y.1h.NO01L_NO42_aws_10m.NO01L_cup_anemometer..nas'
filedata = pya.io.EbasNasaAmesFile(fpath)
print(filedata)
The data has 4 columns and 8760 timestamps. All attributes can be accessed via .
or []
.
filedata['station_longitude']
Note: as you can see, numerical metadata like longitude, etc. is not converted into floating point but kept as string! You can do:
float(filedata['station_longitude'])
filedata.var_defs
E.g. as you can see, the 3rd column (index=2) contains wind speed data:
COL_WINDSPEED = 2
wind_data = filedata.data[:, COL_WINDSPEED]
wind_data
filedata.time_stamps
import pandas as pd
wind_tseries = pd.Series(wind_data, filedata.time_stamps)
ax = wind_tseries.plot(figsize=(16,6), title='Wind speed at Zeppelin');
ax.set_ylabel('v [{}]'.format(filedata.var_defs[COL_WINDSPEED].unit));