def getParamData(ID): obs = station.get(ID).data() condition = ( obs['specLabel'] == 'ICOS ATC NRT CH4 growing time series') & ( obs['samplingheight'].astype(float) == 125) obs = obs[condition] return obs.set_index(pd.Index(range(len(obs)))).to_dict()
def get_data(self): """ """ def preprocessing(data): # make sure samplingheight type is float (otherwise object) data['samplingheight'] = data['samplingheight'].astype(float, errors='ignore') return data data = station.get(self.ID).data() data = data.loc[data.specLabel.isin(self.plabel)] data = preprocessing(data) return data
def fetch_station_metadata(self): # logger.debug(f'{self.__class__.__name__} : station metadata : ' # f'... fetching data infos, including dobj (download link) ...') def preprocessing(meta): # make sure samplingheight type is float (otherwise object) meta['samplingheight'] = meta['samplingheight'].astype( float, errors='ignore') return meta meta = station.get(self.ID).data() meta = meta.loc[meta.specLabel.isin(self.dataset)] meta = preprocessing(meta) # logger.debug(f'{self.__class__.__name__} : station metadata : ' # f'fetching metadata for {self.ID} successful.') return meta
def getStationsInfo(ID): obsTower = station.get(ID).info() infoVars = {'name','lat','lon','country','project','uri'} info = {key: obsTower[key] for key in obsTower.keys() & infoVars} info.update({'dataVars': list(station.get(ID).products()[0])}) return info
def getData(self, ID): """Fetch height data for target station ID. """ data = station.get(ID).data() return data[data.specLabel == self.pName]#.samplingheight