@@ -92,8 +92,10 @@ def download_product(self, observation_id, *, calibration_level=None,
92
92
None. It downloads the observation indicated
93
93
"""
94
94
95
- params = {"OBSERVATION_ID" : observation_id }
95
+ params = {"OBSERVATION_ID" : observation_id ,
96
+ "USERNAME" : "ehst-astroquery" }
96
97
url = self .data_url + "?OBSERVATION_ID=" + observation_id
98
+ url += "&USERNAME=" + "ehst-astroquery"
97
99
98
100
if filename is None :
99
101
filename = observation_id + ".tar"
@@ -154,14 +156,15 @@ def get_artifact(self, artifact_id, filename=None, verbose=False):
154
156
None. It downloads the artifact indicated
155
157
"""
156
158
157
- params = {"ARTIFACT_ID" : artifact_id }
159
+ params = {"ARTIFACT_ID" : artifact_id , "USERNAME" : "ehst-astroquery" }
158
160
response = self ._request ('GET' , self .data_url , save = True , cache = True ,
159
161
params = params )
160
162
if filename is None :
161
163
filename = artifact_id
162
164
163
165
if verbose :
164
- log .info (self .data_url + "?ARTIFACT_ID=" + artifact_id )
166
+ log .info (self .data_url + "?ARTIFACT_ID=" + artifact_id +
167
+ "&USERNAME=ehst-astroquery" )
165
168
log .info (self .copying_string .format (filename ))
166
169
167
170
shutil .move (response , filename )
@@ -200,7 +203,8 @@ def get_postcard(self, observation_id, calibration_level="RAW",
200
203
params = {"RETRIEVAL_TYPE" : "POSTCARD" ,
201
204
"OBSERVATION_ID" : observation_id ,
202
205
"CALIBRATION_LEVEL" : calibration_level ,
203
- "RESOLUTION" : resolution }
206
+ "RESOLUTION" : resolution ,
207
+ "USERNAME" : "ehst-astroquery" }
204
208
205
209
response = self ._request ('GET' , self .data_url , save = True , cache = True ,
206
210
params = params )
@@ -213,7 +217,8 @@ def get_postcard(self, observation_id, calibration_level="RAW",
213
217
"&" .join (["?RETRIEVAL_TYPE=POSTCARD" ,
214
218
"OBSERVATION_ID=" + observation_id ,
215
219
"CALIBRATION_LEVEL=" + calibration_level ,
216
- "RESOLUTION=" + str (resolution )]))
220
+ "RESOLUTION=" + str (resolution ),
221
+ "USERNAME=ehst-astroquery" ]))
217
222
log .info (self .copying_string .format (filename ))
218
223
219
224
shutil .move (response , filename )
@@ -435,6 +440,7 @@ def query_target(self, name, filename=None, output_format='votable',
435
440
"""
436
441
437
442
params = {"RESOURCE_CLASS" : "OBSERVATION" ,
443
+ "USERNAME" : "ehst-astroquery" ,
438
444
"SELECTED_FIELDS" : "OBSERVATION" ,
439
445
"QUERY" : "(TARGET.TARGET_NAME=='" + name + "')" ,
440
446
"RETURN_TYPE" : str (output_format )}
@@ -445,7 +451,8 @@ def query_target(self, name, filename=None, output_format='votable',
445
451
if verbose :
446
452
log .info (self .metadata_url + "?RESOURCE_CLASS=OBSERVATION&"
447
453
"SELECTED_FIELDS=OBSERVATION&QUERY=(TARGET.TARGET_NAME"
448
- "=='" + name + "')&RETURN_TYPE=" + str (output_format ))
454
+ "=='" + name + "')&USERNAME=ehst-astroquery&"
455
+ "RETURN_TYPE=" + str (output_format ))
449
456
log .info (self .copying_string .format (filename ))
450
457
if filename is None :
451
458
filename = "target.xml"
0 commit comments