Dear all,
I need a list of weather stations in Hawaii. Is it possible to extract that with Mathematica?
Thank you in advance for your kind support.
Dear all,
I need a list of weather stations in Hawaii. Is it possible to extract that with Mathematica?
Thank you in advance for your kind support.
Hi Alex,
Here is one way to do it
hawaiiStations =
GeoNearest["WeatherStation",
Entity["AdministrativeDivision", {"Hawaii", "UnitedStates"}], 13]
Why 13? I experimented with different values and 13 excluded stations that looked too far from the Hawaiian islands. Depending on how you intend to use the data you may want to include or exclude more stations.
EntityValue[hawaiiStations, {"Position", "Name"}] //
Apply[Labeled, #, {1}] & //
GeoListPlot[#, PlotRangePadding -> Scaled[.1]] &
Please try:
Map[#["Dataset"]&,GeoNearest["WeatherStation",Entity["AdministrativeDivision",List["Hawaii","UnitedStates"]]] ]
So the result is the Weather Stations in Hawaii that Wolfram Language is utilizing as part of current curated data.
The Hawaii entity subdivides to
AdministrativeDivisionData[Entity["AdministrativeDivision",List["Hawaii","UnitedStates"]], "Subdivisions"]
Weather data information is a mixed of government, citizen, and coorporate (private) data what WRI chooses to curate may not be all available stations in a area, as some are private. See some links
https://www.faa.gov/air_traffic/weather/asos/?state=HI
https://www.ndbc.noaa.gov/radial_search.php?lat1=21.019N&lon1=156.422W&uom=E&dist=250
Rohit and Hans,
Thank you so much. It helped me a lot.
Is it possible to know which two stations have the longest air temperature records?
Query for the data over a long range and see which station returns the most values.
hawaiiStations //
AssociationMap[WeatherData[Entity["WeatherStation", #],
"MeanTemperature", {{1900, 1, 1}, Today, "Day"}] &, #] & //
DeleteMissing //
ReverseSortBy[#["PathLength"] &]
Dear Rohit,
For a sample, I considered the “PHMK” weather station.
As list “data1” has missing data, I decided to fill up the gaps.
Unfortunately, after filling the final data series still has some missing elements.
Thank you for your help:)
(*main data with missing data*)
data0 = WeatherData["PHMK",
"TotalPrecipitation", {{1950, 1, 1}, {2020, 12, 31}, "Day"}];
data1 = QuantityMagnitude[data0["Values"]];
(*Filling the gaps in the main data*)
data2 = TimeSeriesResample[data0,
ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}]
data3 = QuantityMagnitude[data2["Values"]];
ListLinePlot /@ {data1, data3}
Hi Mohammad,
At first I thought that the problem was caused by
data1 = QuantityMagnitude[data0["Values"]]
The values are not Quantity objects so QuantityMagnitude is not needed. QuantityMagnitude is Identity unless the value is Missing["NotAvailable"]. In that case the result is QuantityMagnitude[Missing["NotAvailable"]]. I though that was interfering with the interpolation.
The interpolation is working just fine, what look like gaps are cause by zero values, not missing values.
data0 = WeatherData["PHMK", "TotalPrecipitation", {{1950, 1, 1}, {2020, 12, 31}, "Day"}];
ts0 = TimeSeries[data0, MissingDataMethod -> {"Interpolation", 1}]
If you look at the following sample you will see that all missing values have been correctly interpolated.
data0["Values"][[2200 ;; 2500]]
ts0["Values"][[2200 ;; 2500]]
Zero precipitation for many consecutive days is not unusual.
The question you asked me via email is a more complex and will take some time to figure out.