Skip to content

Commit

Permalink
Merge branch 'main' into era5_ensemble
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-zippenfenig authored Aug 13, 2024
2 parents 1ca3376 + eaf8538 commit 89044d9
Show file tree
Hide file tree
Showing 26 changed files with 1,279 additions and 35 deletions.
15 changes: 15 additions & 0 deletions src/lib/meteo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ export function countPressureVariables(variables: { name: string; label: string
};
}

export function countHeightVariables(variables: { name: string; label: string }[], levels: number[], params: string[]) {
return {
total: variables.length * levels.length,
active: variables.reduce(
(i, variable) =>
i +
levels.reduce(
(i, level) => i + (params.includes(`${variable.name}_${level}m`) ? 1 : 0),
0
),
0
)
};
}

// Sequence generator function (commonly referred to as "range", e.g. Clojure, PHP, etc.)
export const range = (start: number, stop: number, step: number) =>
Array.from({ length: (stop - start) / step }, (_, i) => start + i * step);
Expand Down
1 change: 1 addition & 0 deletions src/routes/en/docs/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{ title: 'NOAA U.S.', url: '/en/docs/gfs-api' },
{ title: 'Météo-France', url: '/en/docs/meteofrance-api' },
{ title: 'ECMWF', url: '/en/docs/ecmwf-api' },
{ title: 'UK Met Office', url: '/en/docs/ukmo-api' },
{ title: 'JMA Japan', url: '/en/docs/jma-api' },
{ title: 'MET Norway', url: '/en/docs/metno-api' },
{ title: 'GEM Canada', url: '/en/docs/gem-api' },
Expand Down
37 changes: 33 additions & 4 deletions src/routes/en/docs/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
past_days: '0',
past_hours: '',
past_minutely_15: '',
temporal_resolution: '',
forecast_days: '7',
forecast_hours: '',
forecast_minutely_15: '',
Expand All @@ -53,8 +54,8 @@
{ name: 'temperature', label: 'Temperature' },
{ name: 'relative_humidity', label: 'Relative Humidity' },
{ name: 'cloud_cover', label: 'Cloud cover' },
{ name: 'windspeed', label: 'Wind Speed' },
{ name: 'winddirection', label: 'Wind Direction' },
{ name: 'wind_speed', label: 'Wind Speed' },
{ name: 'wind_direction', label: 'Wind Direction' },
{ name: 'geopotential_height', label: 'Geopotential Height' }
];
const levels = [
Expand Down Expand Up @@ -283,6 +284,10 @@
{ name: 'knmi_harmonie_arome_netherlands', label: 'KNMI Harmonie Arome Netherlands' },
{ name: 'dmi_seamless', label: 'DMI Seamless (with ECMWF)' },
{ name: 'dmi_harmonie_arome_europe', label: 'DMI Harmonie Arome Europe' },
],[
{ name: 'ukmo_seamless', label: 'UK Met Office Seamless' },
{ name: 'ukmo_global_deterministic_10km', label: 'UK Met Office Global 10km' },
{ name: 'ukmo_uk_deterministic_2km', label: 'UK Met Office UK 2km' }
]
];
</script>
Expand Down Expand Up @@ -516,6 +521,23 @@
<label for="past_hours">Past Hours</label>
</div>
</div>
<div class="col-md-6">
<div class="form-floating mb-6">
<select
class="form-select"
name="temporal_resolution"
id="temporal_resolution"
aria-label="Temporal Resolution For Hourly Data"
bind:value={$params.temporal_resolution}
>
<option value="">1 Hourly</option>
<option value="hourly_3">3 Hourly</option>
<option value="hourly_6">6 Hourly</option>
<option value="native">Native Model Resolution</option>
</select>
<label for="temporal_resolution">Temporal Resolution For Hourly Data</label>
</div>
</div>
</AccordionItem>
<AccordionItem
id="solar-variables"
Expand Down Expand Up @@ -957,6 +979,14 @@
<td>7 days</td>
<td>Every 6 hours</td>
</tr>
<tr>
<th scope="row"><a href="/en/docs/ukmo-api">UKMO</a></th>
<td>UK Met Office</td>
<td>United Kingdom</td>
<td>2 - 10 km</td>
<td>7 days</td>
<td>Every hour</td>
</tr>
<tr>
<th scope="row"><a href="/en/docs/jma-api">MSM & GSM</a></th>
<td>JMA</td>
Expand Down Expand Up @@ -1491,8 +1521,7 @@
<td>Instant</td>
<td>meters</td>
<td
>Viewing distance in meters. Influenced by low clouds, humidity and aerosols. Maximum
visibility is approximately 24 km.</td
>Viewing distance in meters. Influenced by low clouds, humidity and aerosols.</td
>
</tr>
<tr>
Expand Down
4 changes: 2 additions & 2 deletions src/routes/en/docs/PressureLevels.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{name: "temperature", label: "Temperature"},
{name: "relative_humidity", label: "Relative Humidity"},
{name: "cloud_cover", label: "Cloud cover"},
{name: "windspeed", label: "Wind Speed"},
{name: "winddirection", label: "Wind Direction"},
{name: "wind_speed", label: "Wind Speed"},
{name: "wind_direction", label: "Wind Direction"},
{name: "geopotential_height", label: "Geopotential Height"}
]
export let levels = [30, 50, 70, 100, 150, 200, 250, 300, 400, 500, 600, 700, 800, 850, 900, 925, 950, 975, 1000].reverse()
Expand Down
18 changes: 18 additions & 0 deletions src/routes/en/docs/air-quality-api/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
past_hours: '',
forecast_days: '5',
forecast_hours: '',
temporal_resolution: '',
start_date: '',
end_date: '',
time_mode: 'forecast_days',
Expand Down Expand Up @@ -572,6 +573,23 @@
<label for="past_hours">Past Hours</label>
</div>
</div>
<div class="col-md-6">
<div class="form-floating mb-6">
<select
class="form-select"
name="temporal_resolution"
id="temporal_resolution"
aria-label="Temporal Resolution For Hourly Data"
bind:value={$params.temporal_resolution}
>
<option value="">1 Hourly</option>
<option value="hourly_3">3 Hourly</option>
<option value="hourly_6">6 Hourly</option>
<option value="native">Native Model Resolution</option>
</select>
<label for="temporal_resolution">Temporal Resolution For Hourly Data</label>
</div>
</div>
</AccordionItem>
</div>
</div>
Expand Down
21 changes: 19 additions & 2 deletions src/routes/en/docs/bom-api/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
forecast_days: '7',
forecast_hours: '',
forecast_minutely_15: '',
temporal_resolution: '',
start_date: '',
end_date: '',
tilt: 0,
Expand Down Expand Up @@ -364,6 +365,23 @@
<label for="past_hours">Past Hours</label>
</div>
</div>
<div class="col-md-6">
<div class="form-floating mb-6">
<select
class="form-select"
name="temporal_resolution"
id="temporal_resolution"
aria-label="Temporal Resolution For Hourly Data"
bind:value={$params.temporal_resolution}
>
<option value="">1 Hourly</option>
<option value="hourly_3">3 Hourly</option>
<option value="hourly_6">6 Hourly</option>
<option value="native">Native Model Resolution</option>
</select>
<label for="temporal_resolution">Temporal Resolution For Hourly Data</label>
</div>
</div>
</AccordionItem>
<AccordionItem
id="solar-variables"
Expand Down Expand Up @@ -996,8 +1014,7 @@
<td>Instant</td>
<td>meters</td>
<td
>Viewing distance in meters. Influenced by low clouds, humidity and aerosols. Maximum
visibility is approximately 24 km.</td
>Viewing distance in meters. Influenced by low clouds, humidity and aerosols.</td
>
</tr>
<tr>
Expand Down
25 changes: 21 additions & 4 deletions src/routes/en/docs/cma-api/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
forecast_days: '7',
forecast_hours: '',
forecast_minutely_15: '',
temporal_resolution: '',
start_date: '',
end_date: '',
tilt: 0,
Expand All @@ -52,8 +53,8 @@
{ name: 'dew_point', label: 'Dewpoint' },
{ name: 'relative_humidity', label: 'Relative Humidity' },
{ name: 'cloud_cover', label: 'Cloud cover' },
{ name: 'windspeed', label: 'Wind Speed' },
{ name: 'winddirection', label: 'Wind Direction' },
{ name: 'wind_speed', label: 'Wind Speed' },
{ name: 'wind_direction', label: 'Wind Direction' },
{ name: 'vertical_velocity', label: 'Vertical Velocity' },
{ name: 'geopotential_height', label: 'Geopotential Height' }
];
Expand Down Expand Up @@ -401,6 +402,23 @@
<label for="past_hours">Past Hours</label>
</div>
</div>
<div class="col-md-6">
<div class="form-floating mb-6">
<select
class="form-select"
name="temporal_resolution"
id="temporal_resolution"
aria-label="Temporal Resolution For Hourly Data"
bind:value={$params.temporal_resolution}
>
<option value="">1 Hourly</option>
<option value="hourly_3">3 Hourly</option>
<option value="hourly_6">6 Hourly</option>
<option value="native">Native Model Resolution</option>
</select>
<label for="temporal_resolution">Temporal Resolution For Hourly Data</label>
</div>
</div>
</AccordionItem>
<AccordionItem
id="solar-variables"
Expand Down Expand Up @@ -1120,8 +1138,7 @@
<td>Instant</td>
<td>meters</td>
<td
>Viewing distance in meters. Influenced by low clouds, humidity and aerosols. Maximum
visibility is approximately 24 km.</td
>Viewing distance in meters. Influenced by low clouds, humidity and aerosols.</td
>
</tr>
<tr>
Expand Down
18 changes: 18 additions & 0 deletions src/routes/en/docs/dmi-api/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
forecast_days: '7',
forecast_hours: '',
forecast_minutely_15: '',
temporal_resolution: '',
start_date: '',
end_date: '',
tilt: 0,
Expand Down Expand Up @@ -370,6 +371,23 @@
<label for="past_hours">Past Hours</label>
</div>
</div>
<div class="col-md-6">
<div class="form-floating mb-6">
<select
class="form-select"
name="temporal_resolution"
id="temporal_resolution"
aria-label="Temporal Resolution For Hourly Data"
bind:value={$params.temporal_resolution}
>
<option value="">1 Hourly</option>
<option value="hourly_3">3 Hourly</option>
<option value="hourly_6">6 Hourly</option>
<option value="native">Native Model Resolution</option>
</select>
<label for="temporal_resolution">Temporal Resolution For Hourly Data</label>
</div>
</div>
</AccordionItem>
<AccordionItem
id="solar-variables"
Expand Down
14 changes: 11 additions & 3 deletions src/routes/en/docs/dwd-api/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
{ name: 'temperature', label: 'Temperature' },
{ name: 'relative_humidity', label: 'Relative Humidity' },
{ name: 'cloud_cover', label: 'Cloud cover' },
{ name: 'windspeed', label: 'Wind Speed' },
{ name: 'winddirection', label: 'Wind Direction' },
{ name: 'wind_speed', label: 'Wind Speed' },
{ name: 'wind_direction', label: 'Wind Direction' },
{ name: 'geopotential_height', label: 'Geopotential Height' }
];
const levels = [
Expand Down Expand Up @@ -86,7 +86,7 @@
{ name: 'cloud_cover_low', label: 'Cloud cover Low' },
{ name: 'cloud_cover_mid', label: 'Cloud cover Mid' },
{ name: 'cloud_cover_high', label: 'Cloud cover High' },
//{ name: 'visibility', label: 'Visibility' },
{ name: 'visibility', label: 'Visibility' },
{ name: 'evapotranspiration', label: 'Evapotranspiration' },
{ name: 'et0_fao_evapotranspiration', label: 'Reference Evapotranspiration (ET₀)' },
{ name: 'vapour_pressure_deficit', label: 'Vapour Pressure Deficit' }
Expand Down Expand Up @@ -1391,6 +1391,14 @@
>.</td
>
</tr>
<tr>
<th scope="row">visibility</th>
<td>Instant</td>
<td>meters</td>
<td
>Viewing distance in meters. Influenced by low clouds, humidity and aerosols.</td
>
</tr>
</tbody>
</table>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/routes/en/docs/ecmwf-api/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
{ name: 'relative_humidity', label: 'Relative Humidity' },
//{ name: 'specific_humidity', label: 'Specific Humidity' },
{ name: 'cloud_cover', label: 'Cloud cover' },
{ name: 'windspeed', label: 'Wind Speed' },
{ name: 'winddirection', label: 'Wind Direction' },
{ name: 'wind_speed', label: 'Wind Speed' },
{ name: 'wind_direction', label: 'Wind Direction' },
{ name: 'geopotential_height', label: 'Geopotential Height' },
//{ name: 'atmosphere_relative_vorticity', label: 'Relative Vorticity' },
//{ name: 'divergence_of_wind', label: 'Divergence of Wind' }
Expand Down
21 changes: 19 additions & 2 deletions src/routes/en/docs/ensemble-api/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
past_hours: '',
forecast_days: '7',
forecast_hours: '',
temporal_resolution: '',
start_date: '',
end_date: '',
tilt: 0,
Expand Down Expand Up @@ -611,6 +612,23 @@
<label for="past_hours">Past Hours</label>
</div>
</div>
<div class="col-md-6">
<div class="form-floating mb-6">
<select
class="form-select"
name="temporal_resolution"
id="temporal_resolution"
aria-label="Temporal Resolution For Hourly Data"
bind:value={$params.temporal_resolution}
>
<option value="">1 Hourly</option>
<option value="hourly_3">3 Hourly</option>
<option value="hourly_6">6 Hourly</option>
<option value="native">Native Model Resolution</option>
</select>
<label for="temporal_resolution">Temporal Resolution For Hourly Data</label>
</div>
</div>
</AccordionItem>
<AccordionItem
id="solar-variables"
Expand Down Expand Up @@ -1306,8 +1324,7 @@
<td>Instant</td>
<td>meters</td>
<td
>Viewing distance in meters. Influenced by low clouds, humidity and aerosols. Maximum
visibility is approximately 24 km.</td
>Viewing distance in meters. Influenced by low clouds, humidity and aerosols.</td
>
</tr>
<tr>
Expand Down
Loading

0 comments on commit 89044d9

Please # to comment.