- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经尝试过请求、pydap、urllib 和 netcdf4,但在尝试下载以下 NASA 数据时总是出现重定向错误或权限错误:
GLDAS_NOAH025SUBP_3H:GLDAS Noah 陆地表面模型 L4 3 每小时 0.25 x 0.25 度子集 V001 ( http://disc.sci.gsfc.nasa.gov/uui/datasets/GLDAS_NOAH025SUBP_3H_V001/summary?keywords=Hydrology )
我正在尝试下载大约 50k 个文件,这里是一个例子,粘贴到 google chrome 浏览器时可以正常工作(如果您有正确的用户名和密码):
有人有过使用 python 从网络获取 OPeNDAP NASA 数据的经验吗?如果需要,我很乐意提供更多信息。
这是给出 401 错误的请求尝试:
import requests
def httpdownload():
'''loop through each line in the text file and open url'''
httpfile = open(pathlist[0]+"NASAdownloadSample.txt", "r")
for line in httpfile:
print line
outname = line[-134:-122]+".hdf"
print outname
username = ""
password = "*"
r = requests.get(line, auth=("username", "password"), stream=True)
print r.text
print r.status_code
with open(pathlist[0]+outname, 'wb') as out:
out.write(r.content)
print outname, "finished" # keep track of progress
这是给出重定向错误的 pydap 示例:
import install_cas_client
from pydap.client import open_url
def httpdownload():
'''loop through each line in the text file and open url'''
username = ""
password = ""
httpfile = open(pathlist[0]+"NASAdownloadSample.txt", "r")
fileone = httpfile.readline()
filetot = fileone[:7]+username+":"+password+"@"+fileone[7:]
print filetot
dataset = open_url(filetot)
最佳答案
我没有找到使用 python 的解决方案,但根据我现在掌握的信息,它应该是可能的。我将 wget 与 .netrc 文件和 cookie 文件一起使用,如下所示 (https://disc.gsfc.nasa.gov/information/howto?title=How%20to%20Download%20Data%20Files%20from%20HTTP%20Service%20with%20wget):
#!/bin/bash
cd # path to output files
touch .netrc
echo "machine urs.earthdata.nasa.gov login <username> password <password>" >> .netrc
chmod 0600 .netrc
touch .urs_cookies
wget --content-disposition --trust-server-names --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --auth-no-challenge=on --keep-session-cookies
-i <path to text file of url list>
希望它能帮助任何其他使用来自该服务器的 NASA 数据的人。
关于python - 如何使用 python 下载 nasa 卫星 OPeNDAP 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40088745/
尊敬的成员(member),我正在开发一个基本的 Google map 应用程序。我已经为这个应用程序实现了一些功能,如 GPS 检查、互联网检查、工作互联网检查等。我刚刚在顶部添加了一个选项菜单,其
如何检测基于 Android 的移动设备是否支持 glonass 功能? 最佳答案 这可能有点困难,也可能不是。这取决于 Android 平台的实现。 Google 提供的默认框架不携带除 GPS 以
我正在寻找一种在 Android 模拟器中模拟卫星存在的方法。我可以通过 telnet 提交 lon/lat 对作为“geo fix”并且在谷歌地图或类似应用程序中工作正常,或者通过扩展控件重播 .k
我需要监控用户的位置以获得纬度和经度,当我使用网络提供商或 gps 提供商时,它工作正常。但是当我使用这两个提供商时,我没有得到值(value)。任何人都请提供解决方案。正在搜索并尝试很多示例
phonegap 似乎不使用 GPS 卫星而是使用蜂窝网络的地理定位。我对精度不满意,总是在150-1000米之间。 GPS Activity Logo 也未显示。 有什么方法可以强制 Android
我正在尝试使用分段控制按钮更改 map 类型,我希望它可以通过 3 个选项更改 map 类型:标准、卫星和混合。到目前为止,我有这段代码,但是一旦选择了不同的 map 类型,什么也不会发生: @IBA
我想在 Android 中显示没有道路/城市/国家标签重叠的卫星 map View 。这是 Android 中的默认设置,我该怎么做。 我想显示图片中显示的两个 View 。我可以显示混合 View
如何在我的 iOS 应用程序上获取卫星 View ? Google SDK 网站上的代码不起作用。我正在运行最新版本的 Xcode。 如果我使用 Google SDK 网站上提供的代码,则会收到此错误
自去年以来,我一直在开发一个使用 Google MAP iOS SDK 的应用程序。应用程序为用户提供了在卫星 View 和普通 View 之间切换的灵 active 。直到 2 天前一切正常,突然我
我有一些非常高分辨率的航拍图像,我想在卫星 View basemap 上显示它们。我的图像足以生成缩放级别为 23 的图像。但是,Google 的卫星 View 只允许放大到级别 20。我知道一旦用户
我成功地在 MKAnnotationView 上设置了自定义图像来替换图钉(我使用了函数 setImage)。但它仅在 MKMapView 类型为“Standard”时有效。卫星和混合模式始终显示引脚
我遇到了无法在 Visual Studio 中构建新创建的 C++/CLI 类库项目的问题: 即使我没有进行任何更改,我在尝试编译时也会收到错误消息: Severity Code Descriptio
我已经尝试过请求、pydap、urllib 和 netcdf4,但在尝试下载以下 NASA 数据时总是出现重定向错误或权限错误: GLDAS_NOAH025SUBP_3H:GLDAS Noah 陆地表
不久前,我的 Android map 应用程序停止获取 Google 卫星图 block 。现在它已成为最重要的问题,我跟踪了代码并发现它创建了如下请求: http://khm3.google.com
许多问题看起来与我的相似,但我无法找到适合 R 的答案。 到目前为止,我以这种方式使用很棒的 R leaflet(和 ggmap)包: library(ggmap) library(leaflet)
众所周知,这些 map ,无论是常规街道 map 还是卫星 map ,在中国的特定地区都无法正确排列。那么哪个 map 排列正确,是卫星 map 还是默认街道 map ?一些网站表明卫星 map 是正
在 Android 2.3.4 Gingerbread 中通过默认浏览器进行地理定位是否存在公认的问题? 在 HTC G2 android 2.3.4 上,默认浏览器似乎不使用 GPS 卫星来确定位置
在苹果 map 应用程序中,如果您点击 MKPinAnnotation 标注,将显示以下 View 。我试图重新创建类似的东西,但我不确定如何实现卫星图像(我假设它是所选注释坐标上的 MKMapVie
请问如何在 Google Maps JavaScript API 中启用 3D 卫星 View ? 让我重复一遍! 3D! 请不要让我引用 45 度角 View ,那不是 3D! 您可以通过单击卫星
Openstreetmap (OSM) 的图块是否与 Google map (卫星 View )的图块兼容? 我的意思是兼容 - 是否可以使用编写的代码/逻辑来读取 OSM 图块以从 Google m
我是一名优秀的程序员,十分优秀!