noaa

perl Data::Dumper to extract key values

冷暖自知 提交于 2021-02-10 22:11:56
问题 I have some perl code which I've written to get weather data/alerts from NOAA. My code is pretty simple: use Weather::NOAA::Alert; use Data::Dumper; $alert = Weather::NOAA::Alert->new(['TXC301']); $events = $alert->get_events(); $alert->poll_events(); print Dumper($events); # @url = (keys %{$VAR1->{'TXC301'}}); # $url = $VAR1->{'TXC301'}; $url = $events->{'TXC301'}; print "URL is $url\n"; # $expires= $events->{'TXC301'}->{$url}->{'expires'}; $expires= $events->{'TXC301'}->{'http://alerts

perl Data::Dumper to extract key values

余生长醉 提交于 2021-02-10 22:11:31
问题 I have some perl code which I've written to get weather data/alerts from NOAA. My code is pretty simple: use Weather::NOAA::Alert; use Data::Dumper; $alert = Weather::NOAA::Alert->new(['TXC301']); $events = $alert->get_events(); $alert->poll_events(); print Dumper($events); # @url = (keys %{$VAR1->{'TXC301'}}); # $url = $VAR1->{'TXC301'}; $url = $events->{'TXC301'}; print "URL is $url\n"; # $expires= $events->{'TXC301'}->{$url}->{'expires'}; $expires= $events->{'TXC301'}->{'http://alerts

perl Data::Dumper to extract key values

好久不见. 提交于 2021-02-10 22:10:56
问题 I have some perl code which I've written to get weather data/alerts from NOAA. My code is pretty simple: use Weather::NOAA::Alert; use Data::Dumper; $alert = Weather::NOAA::Alert->new(['TXC301']); $events = $alert->get_events(); $alert->poll_events(); print Dumper($events); # @url = (keys %{$VAR1->{'TXC301'}}); # $url = $VAR1->{'TXC301'}; $url = $events->{'TXC301'}; print "URL is $url\n"; # $expires= $events->{'TXC301'}->{$url}->{'expires'}; $expires= $events->{'TXC301'}->{'http://alerts

simplexml_load_string not parsing my XML string. Charset issue?

五迷三道 提交于 2020-01-15 10:44:14
问题 I'm using the following PHP code to read XML data from NOAA's tide reporting station API: $rawxml = file_get_contents( "http://opendap.co-ops.nos.noaa.gov/axis/webservices/activestations/" ."response.jsp?v=2&format=xml&Submit=Submit" ); $rawxml = utf8_encode($rawxml); $ob = simplexml_load_string($rawxml); var_dump($ob); Unfortunately, I end up with it displaying this: object(SimpleXMLElement)#246 (0) { } It looks to me like the XML is perfectly well-formed - why won't this parse? From looking

PIL image.open() working for some images but not others

我们两清 提交于 2019-12-21 07:15:38
问题 I use PIL to open AREA files from NOAA on a regular basis. In the last batch of images I received, the image.open() command simply does not work. Here is a simple code I wrote which yields the same results. It will open, rotate, and perform normal tasks with a file from a month ago, and not with a file from today. from PIL import Image im = Image.open("path/to/file") im.show() Here's the error: File "image_goes.py", line 2, in <module> im = Image.open("path/to/file") File "/usr/lib/python2.6

Major issue overlaying GeoTIF in Mapbox GL JS

被刻印的时光 ゝ 提交于 2019-12-08 09:33:12
问题 I have some general questions to understand what has become a very serious issue in my project. I hope that I might come to some sort of understanding on what is happening here, as I am perplexed well over 2 months into this issue. Let me just dive in : I am in the process of making a weather app using Mapbox which displays both radar (rain) and satellite (visible clouds) over the state of Texas. I am using image overlays to accomplish this. The process is simple, but the overlays are not

How to parse & read from .txt file (NOAA Weather)

橙三吉。 提交于 2019-12-08 06:20:33
问题 I am trying to parse and read from a .txt file, from the NOAA Weather site. How can I search the file to find certain text and insert it into the database? I'm trying to search for Greenville and pull the conditions and temp. Then push that into my database, along with other cities? Any code that you are willing to share would be appreciated. Code: <cffile action="read" file="#expandPath("./NWS Raleigh Durham.txt")#" variable="myFile">" <cfdump var="#myfile#"> Content: National Weather

How to use the NOAA API to query past weather data for a given set of coordinates

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to retrieve past NOAA data using latitudinal and longitudinal coordinates. I am interested both in historical time series and annual summaries for variables such as temperature, wind speed, cloud fraction, and precipitation. EX: 2008-02-20 13:00 in (25.033972, 121.564493) I hope to automate a process that achieves this for 900,000+ locations. Any ideas? Ideally this script would be written in R or Python. 回答1: Figure out the endpoint/dataset that contains the information you want (or multiple ones) Convert lat/long into zip code

1.InfluxDB-官方测试数据导入

依然范特西╮ 提交于 2019-12-01 16:08:08
本文翻译自官网,官方文档地址: https://docs.influxdata.com/influxdb/v1.7/query_language/data_download/ 1.下载官网示例数据 命令如下: curl https://s3.amazonaws.com/noaa.water-database/NOAA_data.txt -o NOAA_data.txt 图示: 可见,执行完命令之后,在当前目录可以看到下载成功的数据 NOAA_data.txt 。通过 cat 命令还可以看到文件中的内容。 2.将数据导入到influxdb中 命令如下: influx -import -path=NOAA_data.txt -precision=s -database=NOAA_water_database 图示: 3.查看结果 进入到InfluxDB中。如下图,可见通过上面的导入命令,已在influxdb中创建了一个名为NOAA_water_database的数据库,并且在库中新建了几个表并插入了测试数据。 查询数据测试: 至此,官网测试数据导入完成。 来源: https://www.cnblogs.com/suhaha/p/11692005.html