-
Notifications
You must be signed in to change notification settings - Fork 0
/
coding_tasks.json
301 lines (301 loc) · 28.3 KB
/
coding_tasks.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
{
"Rung_1": {
"points": 1,
"tasks": [
{
"task_number": 1,
"title": "List Available HAPI Server URLs",
"description": "Write a Python script that successfully imports the hapiclient package and lists all available HAPI server URLs.",
"hint": "The import statement is typically the first line in your Python script. Use the hapi() function."
},
{
"task_number": 2,
"title": "List Available CDAWeb Datasets",
"description": "Use the hapiclient to connect to the CDAWeb HAPI server (https://cdaweb.gsfc.nasa.gov/hapi) and print the server's catalog of datasets.",
"hint": "Refer to the hapiclient documentation or example notebooks for guidance on connecting to a server and retrieving the catalog."
},
{
"task_number": 3,
"title": "Reading OMNI HAPI Metadata",
"description": "Access and display the metadata for all parameters of the \"OMNI2_H0_MRG1HR\" dataset from the CDAWeb HAPI server.",
"hint": "Pass two things to the hapi() function."
},
{
"task_number": 4,
"title": "List CTIPe Model Variables",
"description": "Import the Kamodo model wrapper and list all variables available for the model 'CTIPe'",
"hint": "Use the Model_Variables() function."
},
{
"task_number": 5,
"title": "Set SPEDAS_DATA_DIR & Import pySPEDAS, PyTplot",
"description": "Write a Python script that successfully sets the SPEDAS_DATA_DIR (which acts as a root data directory for all missions) then imports the pySPEDAS and pytplot package.",
"hint": "SPEDAS_DATA_DIR is a system environment variable."
},
{
"task_number": 6,
"title": "Load and Plot MMS FGM data",
"description": "Using pySPEDAS/PyTplot, load and plot MMS FGM (fluxgate magnetometer) survey data for probe 1, for March 24, 2023.",
"hint": "Syntax is \"pyspedas.mission.instrument()\" and \"pytplot.tplot(['varname'])\""
},
{
"task_number": 7,
"title": "Set the pysat \u201cdata_dirs\u201d Parameter",
"description": "Set the pysat \u201cdata_dirs\u201d parameter to something reasonable.",
"hint": "Pass something to pysat.params[]."
},
{
"task_number": 8,
"title": "Display Available pysatMadrigal Instruments",
"description": "Display the different Instruments available in the pysatMadrigal package.",
"hint": "Use pysat.utils.display_available_instruments()."
},
{
"task_number": 9,
"title": "List Available SunPy Remote Data Sources",
"description": "SunPy's Fido supports a number of different remote data sources. Display a list of them.",
"hint": "Display the Fido object."
},
{
"task_number": 10,
"title": "List Available SunPy Instruments",
"description": "SunPy's Fido supports a number of different instruments. Display a list of them.",
"hint": "Display the `attrs.Instrument` object."
},
{
"task_number": 11,
"title": "Count Closed PyHC Package Issues",
"description": "Find and report the number of closed issues for all core PyHC packages: HAPI Client, Kamodo, PlasmaPy, pysat, pySPEDAS, SpacePy, and SunPy.",
"hint": "Check the packages' GitHub pages."
},
{
"task_number": 12,
"title": "Find PyHC Package Repository Contribution Rules",
"description": "Find and give the link to the contribution rules for the following PyHC packages: PlasmaPy, pysat, and pySPEDAS.",
"hint": "Check the packages' GitHub repos."
},
{
"task_number": 13,
"title": "Identify PyHC Package License Types",
"description": "Find the software license in each core PyHC package repository and report what kind of license it is: HAPI Client, Kamodo, PlasmaPy, pysat, pySPEDAS, SpacePy, and SunPy.",
"hint": "Check the packages' GitHub repos."
}
]
},
"Rung_2": {
"points": 4,
"tasks": [
{
"task_number": 14,
"title": "Reading ACE HAPI Metadata",
"description": "Find the time coverage (start and end times) of the \"ace\" dataset from the SSCWeb HAPI server.",
"hint": "Pass two things to the hapi() function, then look for start/stop dates."
},
{
"task_number": 15,
"title": "Reading ACE HAPI Data",
"description": "Use the hapiclient to download exactly one hour of the following data:<br><ul><li>Server: SSCWeb</li><li>Dataset: \"ace\"</li><li>Parameters: \"X_GSE\", \"Y_GSE\", \"Z_GSE\"</li><li>Start time: 5:00 AM January 1st, 2001 UTC</li><li>Stop time: 6:00 AM January 1st, 2001 UTC</li></ul>",
"hint": "Look into what parameters the hapi() function accepts."
},
{
"task_number": 16,
"title": "Reading OMNI HAPI Data",
"description": "Use the hapiclient to download exactly one hour of the following data:<br><ul><li>Server: CDAWeb</li><li>Dataset: \"OMNI2_H0_MRG1HR\"</li><li>Parameters: \"DST1800\"</li><li>Start time: Midnight September 1st, 2003 UTC</li><li>Stop time: Midnight September 2nd, 2003 UTC</li></ul>",
"hint": "Look into what parameters the hapi() function accepts."
},
{
"task_number": 17,
"title": "Functionalize a Dataset with Kamodo",
"description": "Functionalize the following new dataset made up of numpy arrays for time, lon, lat, and a variable 'speed' in km/s, then display the Kamodo object:<br><br><pre><code>import numpy as np<br>coord_dict = {'time': {'units': 'hr', 'data': np.linspace(0., 24., 25)},<br> 'lon': {'units': 'deg', 'data': np.linspace(-180., 180., 37)},<br> 'lat': {'units': 'deg', 'data': np.linspace(-90., 90., 19)}}<br>var_dict = {'speed': {'units': 'km/s', 'data': np.random.RandomState(1).rand(25, 37, 19)}}</code></pre>",
"code": "<pre><code>import numpy as np<br>coord_dict = {'time': {'units': 'hr', 'data': np.linspace(0., 24., 25)},<br> 'lon': {'units': 'deg', 'data': np.linspace(-180., 180., 37)},<br> 'lat': {'units': 'deg', 'data': np.linspace(-90., 90., 19)}}<br>var_dict = {'speed': {'units': 'km/s', 'data': np.random.RandomState(1).rand(25, 37, 19)}}</code></pre>",
"hint": "Use the Functionalize_Dataset() function."
},
{
"task_number": 18,
"title": "Extract Data From tplot Variables",
"description": "Using pySPEDAS/PyTplot, load MMS FGM survey data for probe 1, for March 24, 2023. Then extract the MMS FGM times and data values from tplot variables into Python lists.",
"hint": "Use get_data() from pytplot. Each data value is an array of four values: Bx, By, Bz, Btot."
},
{
"task_number": 19,
"title": "Plot Six Hours of Parker Solar Probe data",
"description": "Using pySPEDAS/PyTplot, load six hours of Parker Solar Probe L2 magnetometer data (start time: 2023-03-23/00:00:00) then plot the data.",
"hint": "psp.fields(), datatype='mag_rtn'; plot the variable 'psp_fld_l2_mag_RTN'"
},
{
"task_number": 20,
"title": "Print a Test pysat Instrument",
"description": "Load and print the 'testing' instrument to prove pysat is working.",
"hint": "Use the pysat.Instrument() function."
},
{
"task_number": 21,
"title": "Register pysatNASA Instruments with pysat",
"description": "Import the pysatNASA package and register its instruments with pysat. After registration, list the available instruments to confirm they have been added successfully.",
"hint": "Use the `register_by_module()` function."
},
{
"task_number": 22,
"title": "Search for SDO AIA Data",
"description": "Using SunPy's Fido search interface, display the results of searching for all SDO AIA image data from today. Do not download the data; just show the search results.",
"hint": "`Fido.search()` returns a `results` object."
},
{
"task_number": 23,
"title": "Find the Citations for PyHC Package Repositories",
"description": "Find and report both the APA citation and DOI for the following PyHC packages: HAPI Client, Kamodo, PlasmaPy, pysat, SpacePy, SunPy.",
"hint": "Check Zenodo."
}
]
},
"Rung_3": {
"points": 8,
"tasks": [
{
"task_number": 24,
"title": "Exploring HAPI Data and Metadata",
"description": "Download data and metadata for the first five rows of a dataset of your choice from HAPI's \"TestData2.0\" server. Include the time parameter and one other parameter of your choice. Find the appropriate time range for your dataset that includes only the first five rows of data. Show work for how you found the necessary metadata to make your call.",
"hint": "List servers to find \"TestData2.0\" URL, list its catalog to find datasets, look at dataset metadata."
},
{
"task_number": 25,
"title": "Plotting HAPI Data",
"description": "Write a one-liner that plots four hours of the \"B_NEC\" parameter of the \"SW_OPER_MAGA_LR_1B\" dataset from the VirES HAPI server. Excluding any import statements, you may only use one line of code with one function call.",
"hint": "List all HAPI servers to find VirES URL; inspect dataset metadata to find a four-hour time range; use the hapiplot() function."
},
{
"task_number": 26,
"title": "Plot HAPI data with pySPEDAS/PyTplot",
"description": "Using pySPEDAS, load into tplot variables the \"SW_P_Den\" and \"SW_V\" parameters of the \"GE_K0_CPI\" dataset from CDAWeb, in the time range 12:00:40Z 1992-09-09 to 00:00:00.000Z 1992-09-10. Then plot those parameters with PyTplot.",
"hint": "Use pySPEDAS's pyhapi() function then PyTplot's tplot() function."
},
{
"task_number": 27,
"title": "Generate an Interactive Plot of a Kamodo Object",
"description": "Functionalize the following new dataset made up of numpy arrays for time, lon, lat, and a variable 'speed' in km/s, then generate an interactive plot of the result:<br><pre><code>import numpy as np<br>coord_dict = {'time': {'units': 'hr', 'data': np.linspace(0., 24., 25)},<br> 'lon': {'units': 'deg', 'data': np.linspace(-180., 180., 37)},<br> 'lat': {'units': 'deg', 'data': np.linspace(-90., 90., 19)}}<br>var_dict = {'speed': {'units': 'km/s', 'data': np.random.RandomState(1).rand(25, 37, 19)}}</code></pre>",
"code": "<pre><code>import numpy as np<br>coord_dict = {'time': {'units': 'hr', 'data': np.linspace(0., 24., 25)},<br> 'lon': {'units': 'deg', 'data': np.linspace(-180., 180., 37)},<br> 'lat': {'units': 'deg', 'data': np.linspace(-90., 90., 19)}}<br>var_dict = {'speed': {'units': 'km/s', 'data': np.random.RandomState(1).rand(25, 37, 19)}}</code></pre>",
"hint": "Kamodo objects have a plot() function."
},
{
"task_number": 28,
"title": "Extract GITM Data",
"description": "Extract the value of 'TEC' from a provided GITM run at 2015-03-14 01:00 UT, 30 degrees longitude, and 75 degrees latitude. NOTE: this will require local model output at '/home/jovyan/scratch_space/data/GITM/GITM_small_test_data/'.",
"hint": "First make a Kamodo object with requested variables 'rho_n' and 'TEC', then extract from it."
},
{
"task_number": 29,
"title": "pySPEDAS/PyTplot: Use Simple Analysis Tool",
"description": "Using PySPEDAS/PyTplot, load six hours of Parker Solar Probe L2 magnetometer data (start time: 2023-03-23/00:00:00). Then perform smoothing on the variable \"psp_fld_l2_mag_RTN\" (with a window size of 60) and plot the original and smoothed results.",
"hint": "psp.fields(), datatype='mag_rtn'; pyspedas.tsmooth(), width=60"
},
{
"task_number": 30,
"title": "PyTplot Plot Customization: Line Colors",
"description": "Using pySPEDAS, load THEMIS state data for probe A on 2023-03-24. Then set the PyTplot line colors for 'tha_pos' to cyan, magenta, and black before plotting the data.",
"hint": "pyspedas.themis.state(); pytplot.options(), \"color\", [\"c\", \"m\", \"k\"]"
},
{
"task_number": 31,
"title": "Magnetic Field Modeling: T89 Model",
"description": "Using pySPEDAS, load THEMIS state data for probe A, 2023-03-24, in GSM coordinates. Then, using the T89 model, generate the expected field at the THEMIS-A times and GSM positions (using the default model parameter). Plot the modeled field.",
"hint": "pyspedas.themis.state(), varnames=\"tha_pos_gsm\"; from pyspedas.geopack import tt89; tt89(position_variable); position variable + \"_bt89\""
},
{
"task_number": 32,
"title": "Magnetic Field Modeling: T96 model",
"description": "Using pySPEDAS, load THEMIS state data for probe A, 2023-03-24, in GSM coordinates. Then download T96 model parameters from OMNI and the Kyoto WDC. Then generate the expected field using the T96 model at the THEMIS-A times and GSM positions, using the downloaded model parameters.<br><br>Use this helper function:<br><pre><code>from pyspedas.geopack import get_tsy_params<br>from pytplot import time_double<br><br>def get_params(trange, position_var):<br> support_trange = [time_double(trange[0])-60*60*24,<br> time_double(trange[1])+60*60*24]<br> pyspedas.kyoto.dst(trange=support_trange)<br> pyspedas.omni.data(trange=support_trange)<br> join_vec(['BX_GSE', 'BY_GSM', 'BZ_GSM'])<br> parmod = get_tsy_params('kyoto_dst',<br> 'BX_GSE-BY_GSM-BZ_GSM_joined',<br> 'proton_density',<br> 'flow_speed',<br> model='t96',<br> pressure_tvar='Pressure',<br> g_variables=None,<br> speed=True)<br> pyspedas.tinterpol(parmod,position_var,newname='parmod_interpolated')<br> return 'parmod_interpolated'<br></code></pre>",
"hint": "pyspedas.themis.state(), varnames=\"tha_pos_gsm\"; from pyspedas.geopack import tt96; tt96(position_variable,params); position variable + \"_bt96\""
},
{
"task_number": 33,
"title": "Create an ICON IVM Instrument and Load Data",
"description": "Import the pysatNASA package and register its instruments with pysat. After registration, create an ICON IVM instrument and load data. Then try inspecting the data in the instrument object once loaded.",
"hint": "Set `data_dirs`; register pysatNASA; create the instrument; load the data; show the data."
},
{
"task_number": 34,
"title": "Plot the Latest Solar Image from SDO AIA",
"description": "Find the most recent image from SDO's AIA instrument at 171 \u00c5 using SunPy's Fido, then plot it.",
"hint": "Search with SunPy's Fido. Then, fetch the most recent result and plot it using SunPy's Map."
},
{
"task_number": 35,
"title": "Time String Conversions",
"description": "Convert the time string '2005-06-01T13:33:00.1Z' into a datetime object, then into a timestamp, then back to a datetime object preserving UTC time.",
"hint": "Import and use `pytz`, `datetime`, and `dateutil`."
}
]
},
"Rung_4": {
"points": 16,
"tasks": [
{
"task_number": 36,
"title": "Plotting Total Solar Irradiance HAPI Data",
"description": "Use hapiplot to plot Total Solar Irradiance from 1950 to the present day, via the Historical TSI dataset in LISIRD's HAPI server.",
"hint": "Use the hapi() and/or hapiplot() functions; don't code the plot from scratch by hand."
},
{
"task_number": 37,
"title": "Converting to Pandas DataFrame",
"description": "Download data from the specified server and convert it to a Pandas DataFrame. The time values should be converted to Python datetime objects using the hapitime2datetime() function. Ensure the resulting DataFrame uses time as the index, with columns labeled 'Time', 'scalar', 'vector_x', 'vector_y', 'vector_z'.<br><ul><li>Server: \"http://hapi-server.org/servers/TestData2.0/hapi\"</li><li>Dataset: \"dataset1\"</li><li>Parameters: \"scalar\", \"vector\"</li><li>Start time: 12:00:00 AM January 1st, 1970 UTC</li><li>Stop time: 12:00:10 AM January 1st, 1970 UTC</li></ul>",
"hint": "You can pass all time values at once to hapitime2datetime()."
},
{
"task_number": 38,
"title": "Coordinate Transform with SpacePy",
"description": "Starting with the following program, (1) Print out the GSE and GSM values reported by SSCWeb, (2) Use SpacePy to convert the GSE values to GSM. <br><pre><code>import spacepy.coordinates as sc<br>from spacepy.time import Ticktock<br><br>from hapiclient import hapi, hapitime2datetime<br><br>server = 'https://hapi-server.org/servers/SSCWeb/hapi'<br>dataset = 'swarma'<br>parameters = 'X_GSE,Y_GSE,Z_GSE,X_GSM,Y_GSM,Z_GSM'<br>start = '2013-11-26T00:00:00Z'<br>stop = '2013-11-26T00:01:00Z'<br><br>opts = {'logging': True, 'usecache': True, 'cachedir': './hapicache'}<br><br>data, meta = hapi(server, dataset, parameters, start, stop)<br>print(data)</code></pre>",
"code": "<pre><code>import spacepy.coordinates as sc<br>from spacepy.time import Ticktock<br><br>from hapiclient import hapi, hapitime2datetime<br><br>server = 'https://hapi-server.org/servers/SSCWeb/hapi'<br>dataset = 'swarma'<br>parameters = 'X_GSE,Y_GSE,Z_GSE,X_GSM,Y_GSM,Z_GSM'<br>start = '2013-11-26T00:00:00Z'<br>stop = '2013-11-26T00:01:00Z'<br><br>opts = {'logging': True, 'usecache': True, 'cachedir': './hapicache'}<br><br>data, meta = hapi(server, dataset, parameters, start, stop)<br>print(data)</code></pre>",
"hint": "Use HAPI's hapitime2datetime() function, and SpacePy's sc.Coords(), Ticktock(), convert() functions."
},
{
"task_number": 39,
"title": "Extract and Plot GITM Data",
"description": "Extract 'rho_n' and 'TEC' from a provided GITM run between 2015-03-14 00:00 and 2015-03-14 01:30 along the 'cnofs' satellite trajectory, then functionalize it in Kamodo and plot TEC. NOTE: this will require local model output at '/home/jovyan/scratch_space/data/GITM/GITM_small_test_data/'.",
"hint": "Use the SatelliteFlythrough.RealFlight() function."
},
{
"task_number": 40,
"title": "T89 Field Modeling Versus THEMIS Observations",
"description": "Compare T89 model values to real THEMIS observations. Using pySPEDAS, load THEMIS state data for probe A, 2023-03-24, in GSM coordinates. Then, using the T89 model, generate the expected field at the THEMIS-A times and GSM positions (using the default model parameters). Then load THEMIS-A FGM spin fit data for the same time range. Calculate the difference between the observed and modeled field variables using <code>pytplot.subtract()</code>. Set the <code>yrange</code> of the difference variable to <code>[-200.0, 200.0] nT</code>. Plot the position variable, modeled field variable, observed field variable, and observed-modeled field difference.",
"hint": "pyspedas.themis.state, varnames=\"tha_pos_gsm\"; from pyspedas.geopack import tt89; tt89(position_variable) (Output: position_variable + '_bt89'); pyspedas.themis.fgm; pytplot.options, 'yrange'"
},
{
"task_number": 41,
"title": "T96 Field Modeling Versus MMS Observations",
"description": "Compare T96 model values to real MMS observations. Using pySPEDAS, load MMS orbit data for probe 1 on 2023-03-24, in GSM coordinates. Then download T96 model parameters from OMNI and the Kyoto WDC. Then, using the T96 model, generate the expected field at the MMS-1 times and GSM positions (using the downloaded model parameters). Then load MMS-1 FGM survey data in GSM coordinates for the same time range. Calculate the difference between the observed and modeled field variables using <code>pytplot.subtract()</code>. Set the <code>yrange</code> of the difference variable to <code>[-200.0, 200.0] nT</code>. Plot the position variable, modeled field variable, observed field variable, and observed-modeled field difference.<br><br>Use this helper function:<br><pre><code>from pyspedas.geopack import get_tsy_params<br>from pytplot import time_double<br><br>def get_params(trange, position_var):<br> support_trange = [time_double(trange[0])-60*60*24,<br> time_double(trange[1])+60*60*24]<br> pyspedas.kyoto.dst(trange=support_trange)<br> pyspedas.omni.data(trange=support_trange)<br> join_vec(['BX_GSE', 'BY_GSM', 'BZ_GSM'])<br> parmod = get_tsy_params('kyoto_dst',<br> 'BX_GSE-BY_GSM-BZ_GSM_joined',<br> 'proton_density',<br> 'flow_speed',<br> model='t96',<br> pressure_tvar='Pressure',<br> g_variables=None,<br> speed=True)<br> pyspedas.tinterpol(parmod,position_var,newname='parmod_interpolated')<br> return 'parmod_interpolated'<br></code></pre>",
"hint": "pyspedas.mms.mec() (output variable: 'mms1_mec_r_gsm'); from pyspedas.geopack import tt96; tt96(position_variable,params) (output variable: position variable + _t96'); pyspedas.mms.fgm(), data_rate,='srvy' (output variable: 'mms1_b_gsm_srvy_l2'); pytplot.options, 'yrange'"
},
{
"task_number": 42,
"title": "Make a Movie of Today's SDO AIA Solar Imagery",
"description": "Make a short movie or loop using AIA 0095 A images from midnight today till \"now\".",
"hint": "Download files then create a MapSequence from them and animate them."
},
{
"task_number": 43,
"title": "Difference Image",
"description": "Pick 2 consecutive EUV images from SDO or STEREO and create a difference image (subtract the 2 to see what changed during that time step).",
"hint": "Calculate times for selecting pre-flare and post-flare images. Use SunPy's Fido for image retrieval, and then create a difference image by subtracting one from the other to visualize changes."
}
]
},
"Rung_5": {
"points": 32,
"tasks": [
{
"task_number": 44,
"title": "Interpolating Time",
"description": "For analysis, it's often useful to align two datasets with different timestamps onto the same time grid. This can be done by various methods such as:<ul><li>Converting HAPI timestamps to datetime objects and then to integers for interpolation, and using functions from NumPy or SciPy for interpolation. Datetime conversion methods can also be employed here.</li><li>Using a Pandas DataFrame's interpolation methods after placing the data within it.</li><li>Employing the 'interpol' function from 'spacepy.toolbox' as demonstrated in the SpacePy tutorial.</li></ul>Begin with a script that reads datasets from two different servers. Perform the following steps:<ol><li>Interpolate 'data2' onto the time grid of 'data0'.</li><li>Create a table or plot for a visual comparison of interpolated and original values.</li><li>Average 'data0' into 1-hour bins and compare with 'data2'.</li></ol>The initial program:<br><pre><code>from hapiclient import hapi, hapitime2datetime<br><br>server = 'https://cdaweb.gsfc.nasa.gov/hapi'<br>dataset = 'AC_H0_SWE'<br>parameters = 'Np'<br>start = '1998-02-04'<br>stop = '1998-02-06'<br><br>data0, meta0 = hapi(server, dataset, parameters, start, stop)<br>print('data0 = ')<br>print(data0)<br><br>server = 'https://cdaweb.gsfc.nasa.gov/hapi'<br>dataset = 'AC_H2_SWE'<br>parameters = 'Np'<br>start = '1998-02-04'<br>stop = '1998-02-06'<br><br>data2, meta2 = hapi(server, dataset, parameters, start, stop)<br>print('\\ndata2 = ')<br>print(data2)</code></pre>",
"code": "<pre><code>from hapiclient import hapi, hapitime2datetime<br><br>server = 'https://cdaweb.gsfc.nasa.gov/hapi'<br>dataset = 'AC_H0_SWE'<br>parameters = 'Np'<br>start = '1998-02-04'<br>stop = '1998-02-06'<br><br>data0, meta0 = hapi(server, dataset, parameters, start, stop)<br>print('data0 = ')<br>print(data0)<br><br>server = 'https://cdaweb.gsfc.nasa.gov/hapi'<br>dataset = 'AC_H2_SWE'<br>parameters = 'Np'<br>start = '1998-02-04'<br>stop = '1998-02-06'<br><br>data2, meta2 = hapi(server, dataset, parameters, start, stop)<br>print('\\ndata2 = ')<br>print(data2)</code></pre>",
"hint": "Use one of the interpolation approaches mentioned in the description."
},
{
"task_number": 45,
"title": "Comparing Perspectives: Reproject SDO AIA and STEREO EUVI Solar Images",
"description": "As solar phenomena are often studied from multiple viewpoints to gain a three-dimensional understanding, your task is to use SunPy and the <code>reproject</code> package to fetch and plot images of the sun from both SDO AIA and STEREO EUVI, showing the solar limb from both perspectives on both images, and to reproject their views. Do the following:<br><ol><li>Download an image of the sun in the 193 Ångstrom wavelength from SDO AIA at the timestamp 2012-06-01/00:00:07.</li><li>Download an image of the sun in the 195 Ångstrom wavelength from STEREO EUVI at the timestamp 2012-06-01/00:05:30.</li><li>Resample the images to 512x512 pixels to reduce memory consumption.</li><li>Plot them side by side, highlighting the solar limb as seen by both instruments in each.</li><li>Use the <code>reproject</code> library to reproject the EUVI image to the viewpoint of the AIA.</li><li>And vice versa, reproject the AIA image to the viewpoint of the EUVI (effectively showing how each spacecraft would see the sun's region covered by the other).</li><li>Plot the reprojected images side by side for comparison.</li></ol>",
"hint": "Use SunPy's Fido interface to fetch the images, and the <code>reproject_to()</code> method to reproject one image to the other's perspective. Draw the solar limb in each plot for both the original and reprojected images to visualize the changes in perspective. To ensure the perspectives align correctly, you may need to adjust the metadata of one image to match the other's reference solar radius (<code>rsun_ref</code>) before reprojection. Images as seen from the other's perspective will appear as partial slices of the sphere that is the sun."
}
]
}
}