Open maaikelimper opened 2 months ago
@maaikelimper we'd need to a join on wigos_station_identifier between https://github.com/wmo-im/wis2box-api/blob/3f2499828df38598a8c39982170a55386680087c/wis2box_api/plugins/process/csv2bufr.py#L163 and https://github.com/wmo-im/wis2box-api/blob/3f2499828df38598a8c39982170a55386680087c/wis2box_api/plugins/process/csv2bufr.py#L167, with the names updated, either in the csv2bufr mapping or in the object resulting from the join.
The input-columns depend on the mapping being used. Each template might have different column-names to refer to the columns like 'latitude' 'longitude' 'altitude' 'barometer_height_above_sealevel' and we need to ensure the csv-string after the join matches the expected input-string for the template ... I think in principle we have all the info we need in the mapping-object from this line onwards: https://github.com/wmo-im/wis2box-api/blob/3f2499828df38598a8c39982170a55386680087c/wis2box_api/plugins/process/csv2bufr.py#L179
Do you have some suggested pseudo-code on how the mappings-object and the input csv could be used to provide a valid csv-string for the mapping template ?
In the training material for csv2bufr Dave originally wrote this section:
I think we could implement some code to retrieve missing columns from the station metadata in the csv2bufr process in the wis2box-api plugin: https://github.com/wmo-im/wis2box-api/blob/main/wis2box_api/plugins/process/csv2bufr.py
@david-i-berry could you help me brainstorm how this could be done ?