@@ -1147,7 +1147,11 @@ def get_spectrum(self, *, source_id=None, schema='sedm', output_file=None, verbo
1147
1147
"""
1148
1148
Description
1149
1149
-----------
1150
- Downloads a spectrum with datalink
1150
+ Downloads a spectrum with datalink.
1151
+
1152
+ The spectrum associated to the source_id is downloaded as fits file, and returned in a list. The file is
1153
+ saved in the local path given by output_file. If this parameter is not set, the result is saved in the
1154
+ directory <working directory>/temp_"%Y%m%d_%H%M%S"
1151
1155
1152
1156
Parameters
1153
1157
----------
@@ -1156,13 +1160,14 @@ def get_spectrum(self, *, source_id=None, schema='sedm', output_file=None, verbo
1156
1160
schema : str, mandatory, default 'sedm'
1157
1161
the data release, 'sedm'
1158
1162
output_file : str, optional
1159
- output file. If no value is provided, a temporary one is created
1163
+ output file name. If no value is provided, a temporary one is created with the name
1164
+ <working directory>/temp_"%Y%m%d_%H%M%S"/<source_id>.fits
1160
1165
verbose : bool, optional, default 'False'
1161
1166
flag to display information about the process
1162
1167
1163
1168
Returns
1164
1169
-------
1165
- The fits file is downloaded, and the local path where the spectrum is saved is returned
1170
+ A list of files.
1166
1171
"""
1167
1172
1168
1173
if source_id is None or schema is None :
@@ -1172,7 +1177,8 @@ def get_spectrum(self, *, source_id=None, schema='sedm', output_file=None, verbo
1172
1177
id_value = """{schema} {source_id}""" .format (** {'schema' : schema , 'source_id' : source_id })
1173
1178
params_dict ['ID' ] = id_value
1174
1179
1175
- output_file_full_path , output_dir = self .__set_dirs (output_file = output_file , observation_id = 'temp' )
1180
+ fits_file = source_id + '.fits'
1181
+ output_file_full_path , output_dir = self .__set_dirs (output_file = output_file , observation_id = fits_file )
1176
1182
try :
1177
1183
self .__eucliddata .load_data (params_dict = params_dict , output_file = output_file_full_path , verbose = verbose )
1178
1184
except HTTPError as err :
0 commit comments