diff --git a/README.md b/README.md index 6ea6371..1bfcb8d 100644 --- a/README.md +++ b/README.md @@ -94,10 +94,10 @@ The most important components of CROW are: The source data are time series of vertical profiles (`vpts`)generated by [vol2bird](https://github.com/adokter/vol2bird). These are stored on a public file server. The text files contain fixed-width separated values of **variables related to the presence of birds** (density, speed, reflectivity, ...), grouped by date (first column), time (second column) and height (third column). The structure in the source data files is therefore a flat table. See for example the [data file for the radar at site Helchteren](https://opendata.meteo.be/ftp/observations/radar/vbird/behel/2020/behel_vpts_20201101.txt) on November 1st, 2020. -However for performance reasons, the `Home` compoment holds these data in a `radarVtps` variable organized as a tree of objects: +However for performance reasons, the `Home` compoment holds these data in a `radarVpts` variable organized as a tree of objects: ``` -radarVtps (Object) +radarVpts (Object) ├── 1604185200000 (Object - timestamp) │ ├── heightData (Object - vertical profile of birds for this timestamp, per altitude) │ │ ├── 0 (Object) @@ -113,10 +113,10 @@ radarVtps (Object) └── ... ``` -1. the `radarVtps` object is initialized according to the selected time range and radar. Sun altitudes at site are also computed and set. -2. data file(s) are loaded via AJAX, and their content is used to populate `radarVtps` (more specifically, the various properties in each timestamp -> heightdata entries). +1. the `radarVpts` object is initialized according to the selected time range and radar. Sun altitudes at site are also computed and set. +2. data file(s) are loaded via AJAX, and their content is used to populate `radarVpts` (more specifically, the various properties in each timestamp -> heightdata entries). 3. these data are transformed via computed properties and passed to the child components (that are in charge of the visulization): - - `VPChart` receives a flattened version of `radarVtps` (`radarVtpsAsArray`, similar to the structure of the initial data files) + - `VPChart` receives a flattened version of `radarVpts` (`radarVptsAsArray`, similar to the structure of the initial data files) - `VPIChart` receives vertically integrated profiles (see `integrateProfile` function in `helpers.ts`). - `TimelineChart` receives a simple array with the sun altitude for each shown time period. @@ -128,7 +128,7 @@ It makes use of a few more child components for modularity reasons: `SiteSelecto ### VPChart -`VPChart` visualizes the raw VTPS data as a heatmap (bird density in function of the time and altitude) with D3. It uses the `DailyLines` component to show vertical lines on the chart each day at midnight and `ColorLegend` to show a legend for the 3 availables colour scales. +`VPChart` visualizes the raw VPTS data as a heatmap (bird density in function of the time and altitude) with D3. It uses the `DailyLines` component to show vertical lines on the chart each day at midnight and `ColorLegend` to show a legend for the 3 availables colour scales. ## License diff --git a/src/CrowTypes.ts b/src/CrowTypes.ts index 94fe297..9a391f9 100644 --- a/src/CrowTypes.ts +++ b/src/CrowTypes.ts @@ -51,11 +51,11 @@ export interface RadarInterface { longitude: number; timezone: string; endpoint: string; // URL template, some variables are interpolated. Example: 'https://opendata.meteo.be/ftp/observations/radar/vbird/{odimCode}/{yyyy}/{odimCode}_vpts_{yyyymmdd}.txt' - vtpsFileFormat: VTPSFileFormat; + vptsFileFormat: VPTSFileFormat; heights: number[]; // Data is available at the following heights } -export type VTPSFileFormat = "VOL2BIRD" | "CSV"; // VOL2BIRD: fixed width column. CSV: Follow BioRad's output (see https://github.com/inbo/crow/issues/135) +export type VPTSFileFormat = "VOL2BIRD" | "CSV"; // VOL2BIRD: fixed width column. CSV: Follow BioRad's output (see https://github.com/inbo/crow/issues/135) export interface GroupedRadarInterface { label: string; @@ -72,7 +72,7 @@ export interface TimeIntervalForRadioGroup { value: number; } -export interface VTPSDataRowFromFile { +export interface VPTSDataRowFromFile { datetime: number; height: number; dd: number; @@ -82,7 +82,7 @@ export interface VTPSDataRowFromFile { eta: number; } -export interface VTPSDataRow { +export interface VPTSDataRow { datetime?: number; height?: number; dd?: number; @@ -92,7 +92,7 @@ export interface VTPSDataRow { noData?: boolean; // Field not in original data, but used to know if we have data loaded for the given datetime/height combination } -export interface VTPSEntry { // TODO: check: is it a duplicate of VTPSDataRow? +export interface VPTSEntry { // TODO: check: is it a duplicate of VPTSDataRow? dd: number; dens: number; ff: number; diff --git a/src/components/Home.vue b/src/components/Home.vue index 6426bee..df7a98c 100644 --- a/src/components/Home.vue +++ b/src/components/Home.vue @@ -137,7 +137,7 @@
{ heightObj[height] = { noData: true }; }); @@ -558,7 +558,7 @@ export default Vue.extend({ }; this.$set( - this.radarVtps, + this.radarVpts, currentMoment.toDate().getTime(), metadataObj ); @@ -595,19 +595,19 @@ export default Vue.extend({ }); }, - /* Store a Vtps data row originating in a file into vtpsData */ - storeDataRow(vtpsDataRow: VTPSDataRowFromFile): void { - const objToStore = { ...vtpsDataRow, ...{ noData: false } }; + /* Store a Vpts data row originating in a file into vptsData */ + storeDataRow(vptsDataRow: VPTSDataRowFromFile): void { + const objToStore = { ...vptsDataRow, ...{ noData: false } }; if ( // no (datetime) slot = data not copied. Allow automatic downsampling. Object.prototype.hasOwnProperty.call( - this.radarVtps, - vtpsDataRow.datetime + this.radarVpts, + vptsDataRow.datetime ) ) { this.$set( - this.radarVtps[vtpsDataRow.datetime].heightData, - vtpsDataRow.height, + this.radarVpts[vptsDataRow.datetime].heightData, + vptsDataRow.height, objToStore ); } @@ -640,7 +640,7 @@ export default Vue.extend({ for (let currentDate of this.getDatesForData(startMoment, endMoment)) { const url = helpers.buildVpTsDataUrl(radar, moment(currentDate, "YYYY-MM-DD")); axios.get(url).then(response => { - const dayData = helpers.filterVtps(helpers.parseVtps(response.data, radar.vtpsFileFormat)); + const dayData = helpers.filterVpts(helpers.parseVpts(response.data, radar.vptsFileFormat)); for (const val of dayData) { this.storeDataRow(val); diff --git a/src/components/VPChart.vue b/src/components/VPChart.vue index 7192767..2f289ef 100644 --- a/src/components/VPChart.vue +++ b/src/components/VPChart.vue @@ -42,7 +42,7 @@ -