Module: Bowshock::Donki

Included in:
Bowshock
Defined in:
lib/bowshock/donki.rb

Class Method Summary collapse

Class Method Details

.CME(object) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/bowshock/donki.rb', line 3

def CME(object)
  base_url = "https://api.nasa.gov/DONKI/CME?"
  base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"

  if object["endDate"]
    base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
  end

  base_url += "api_key=#{Helpers.nasa_api_key}"
  Helpers.getJson(base_url, "GET")
end

.CMEA(object) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/bowshock/donki.rb', line 17

def CMEA(object)
  base_url = "https://api.nasa.gov/DONKI/CMEAnalysis?"
  base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"

  if object["endDate"]
    base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
  end
  if object["mostAccurateOnly"]
    base_url += "mostAccurateOnly=#{object["mostAccurateOnly"]}&"
  end
  if object["completeEntryOnly"]
    base_url += "completeEntryOnly=#{object["completeEntryOnly"]}&"
  end
  if object["speed"]
    base_url += "speed=#{object["speed"]}&"
  end
  if object["halfAngle"]
    base_url += "halfAngle=#{object["halfAngle"]}&"
  end
  if object["catalog"]
    base_url += "catalog=#{object["catalog"]}&"
  end
  if object["keyword"]
    base_url += "keyword=#{object["keyword"]}&"
  end

  base_url += "api_key=#{Helpers.nasa_api_key}"
  Helpers.getJson(base_url, "GET")
end

.FLR(object) ⇒ Object



83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/bowshock/donki.rb', line 83

def FLR(object)
  base_url = "https://api.nasa.gov/DONKI/FLR?"
  base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"

  if object["endDate"]
    base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
  end

  base_url += "api_key=#{Helpers::nasa_api_key}"
  Helpers.getJson(base_url, "GET")

end

.GST(object) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/bowshock/donki.rb', line 49

def GST(object)
  base_url = "https://api.nasa.gov/DONKI/GST?"
  base_url += "startDate=#{Helpers::vali_date(object["startDate"])}&"

  if object["endDate"]
    base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
  end

  base_url += "api_key=#{Helpers.nasa_api_key}"
  Helpers.getJson(base_url, "GET")
end

.HSS(object) ⇒ Object



140
141
142
143
144
145
146
147
148
149
150
# File 'lib/bowshock/donki.rb', line 140

def HSS(object)
  base_url = "https://api.nasa.gov/DONKI/HSS?"

  base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"
  if object["endDate"]
    base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
  end

  base_url += "api_key=#{Helpers.nasa_api_key}"
  Helpers.getJson(base_url, "GET")
end

.IPS(object) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/bowshock/donki.rb', line 63

def IPS(object)
  base_url = "https://api.nasa.gov/DONKI/IPS?"
  base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"

  if object["endDate"]
    base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
  end
  if object["location"]
    base_url += "location=#{object["location"]}&"
  end
  if object["catalog"]
    base_url += "catalog=#{object["catalog"]}&"
  end

  base_url += "api_key=#{Helpers.nasa_api_key}"
  Helpers.getJson(base_url, "GET")
end

.MPC(object) ⇒ Object



112
113
114
115
116
117
118
119
120
121
122
# File 'lib/bowshock/donki.rb', line 112

def MPC(object)
  base_url = "https://api.nasa.gov/DONKI/MPC?"
  base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"

  if object["endDate"]
    base_url += "endDate=#{Helpers.vali_date(object.endDate)}&"
  end

  base_url += "api_key=#{Helpers.nasa_api_key}"
  Helpers.getJson(base_url, "GET");
end

.notifications(object) ⇒ Object



168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/bowshock/donki.rb', line 168

def notifications(object)
  base_url = "https://api.nasa.gov/DONKI/notifications?"
  base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"

  if object["endDate"]
    base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
  end

  if object["type"]
    base_url += "type=#{object["type"]}&"
  end

  base_url += "api_key=#{Helpers.nasa_api_key}"
  Helpers.getJson(base_url, "GET")
end

.RBE(object) ⇒ Object



126
127
128
129
130
131
132
133
134
135
136
# File 'lib/bowshock/donki.rb', line 126

def RBE(object)
  base_url = "https://api.nasa.gov/DONKI/RBE?"
  base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"

  if object["endDate"]
    base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
  end

  base_url += "api_key=#{Helpers.nasa_api_key}"
  Helpers.getJson(base_url, "GET")
end

.SEP(object) ⇒ Object



98
99
100
101
102
103
104
105
106
107
108
# File 'lib/bowshock/donki.rb', line 98

def SEP(object)
  base_url = "https://api.nasa.gov/DONKI/SEP?"
  base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"

  if object["endDate"]
    base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
  end

  base_url += "api_key=#{Helpers.nasa_api_key}"
  Helpers.getJson(base_url, "GET")
end

.WSASim(object) ⇒ Object



154
155
156
157
158
159
160
161
162
163
164
# File 'lib/bowshock/donki.rb', line 154

def WSASim(object)
  base_url = "https://api.nasa.gov/DONKI/WSAEnlilSimulations?"
  base_url += "startDate=#{Helpers.vali_date(object["startDate"])}&"

  if object["endDate"]
    base_url += "endDate=#{Helpers.vali_date(object["endDate"])}&"
  end

  base_url += "api_key=#{Helpers.nasa_api_key}"
  Helpers.getJson(base_url, "GET");
end