File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ import Pkg
2+ Pkg. activate (mktempdir ())
3+ Pkg. add ([" HTTP" ," EzXML" ])
4+
5+ using Downloads
6+ using HTTP, EzXML
7+ pyrhelio_dir = " /gpfs/group/ebf11/default/pipeline/data/neid_solar/pyrheliometer"
8+ url = " https://neid.ipac.caltech.edu/pyrheliometer.php"
9+
10+ try
11+
12+ response = HTTP. request (" GET" ,url)
13+ body = String (response. body)
14+ idx = findall (r" https\:\/\/\S +\/ pyroheliotel\/ neid_\w +_\S {4}_\d {8}\. tel" ,body)
15+ for i in eachindex (idx)
16+ this_url = body[idx[i]]
17+ m = match (r" neid_l\S +\. tel" ,this_url)
18+ if isnothing (m) continue end
19+ filename = joinpath (pyrhelio_dir,string (m. match))
20+ if filesize (filename) > 0 continue end
21+ println (" # Need to download " , filename)
22+ Downloads. download (this_url, filename)
23+ if ! (filesize (filename) > 0 )
24+ println (" # Somehow " , filename, " is still missing/empty." )
25+ end
26+ end
27+
28+ catch ex
29+ @warn " Error: " * string (ex)
30+ end
You can’t perform that action at this time.
0 commit comments