Message Boards Message Boards

0
|
6011 Views
|
6 Replies
|
6 Total Likes
View groups...
Share
Share this post:

Hawaii weather stations list

Posted 3 years ago

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.

POSTED BY: Alex Teymouri
6 Replies
Posted 3 years ago

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"] &]
POSTED BY: Rohit Namjoshi

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}
POSTED BY: M.A. Ghorbani
Posted 3 years ago

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.

POSTED BY: Rohit Namjoshi

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://tidesandcurrents.noaa.gov/map/index.html?region=Hawaii

http://www.wxqa.com/states/HI.html

http://www.pacioos.hawaii.edu/weather-category/obs/

https://www.ndbc.noaa.gov/radial_search.php?lat1=21.019N&lon1=156.422W&uom=E&dist=250

https://tidesandcurrents.noaa.gov/map/index.html

https://www.wunderground.com/history/daily/PHTO/date/2021-4-15

POSTED BY: Hans Michel
Posted 3 years ago

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?

POSTED BY: Alex Teymouri
Posted 3 years ago

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]] &

enter image description here

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract