Changeset 295ff45 in flex_extract.git for source/python/classes/MarsRetrieval.py
- Timestamp:
- Sep 29, 2018, 1:18:15 PM (6 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 65748f4
- Parents:
- 7b4e39e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/python/classes/MarsRetrieval.py
r25b14be r295ff45 335 335 336 336 337 def print_info(self, inputdir ):337 def print_info(self, inputdir, request_number): 338 338 ''' 339 339 @Description: … … 348 348 The path where all data from the retrievals are stored. 349 349 350 @Return: 350 request_number: integer 351 Number of mars requests for flux and non-flux data. 352 353 @Return: 351 354 <nothing> 352 355 ''' … … 357 360 with open(os.path.join(inputdir, 358 361 _config.FILE_MARS_REQUESTS), 'a') as f: 359 f.write('mars \n')362 f.write('mars_request #' + str(request_number) + '\n') 360 363 # iterate through all attributes and print them 361 364 # with their corresponding values … … 366 369 f.write(item[0] + ': ' + str(item[1]) + '\n') 367 370 f.write('\n\n') 371 372 return 373 374 375 def print_infodata_csv(self, inputdir, request_number): 376 ''' 377 @Description: 378 Write all request parameter in alpabetical order into a "csv" file. 379 380 @Input: 381 self: instance of MarsRetrieval 382 For description see class documentation. 383 384 inputdir: string 385 The path where all data from the retrievals are stored. 386 387 request_number: integer 388 Number of mars requests for flux and non-flux data. 389 390 @Return: 391 <nothing> 392 ''' 393 394 # Get all class attributes and their values as a dictionary 395 attrs = vars(self) 396 del attrs['server'] 397 398 # open a file to store all requests to 399 with open(os.path.join(inputdir, 400 _config.FILE_MARS_REQUESTS), 'a') as f: 401 f.write(str(request_number) + ', ') 402 f.write(', '.join(str(attrs[key]) 403 for key in sorted(attrs.iterkeys()))) 404 f.write('\n') 368 405 369 406 return
Note: See TracChangeset
for help on using the changeset viewer.