Exemplo n.º 1
0
        #eval('this_trans.%s=HITRANParam(None)' % prm_name)
    fields = line.split(',')
    for i, output_field in enumerate(trans_fields):
        this_trans.set_param(output_field.name, fields[i], output_field.fmt)
    #print this_trans.stateIDp, this_trans.stateIDpp
    this_trans.statep = get_state(this_trans.stateIDp)
    this_trans.statepp = get_state(this_trans.stateIDpp)
    this_trans.case_module = hitran_meta.get_case_module(this_trans.molec_id,
                        this_trans.local_iso_id)

    # OH (A-X) system is a special case:
    if this_trans.statep.global_iso_id == 48 and s_qns[15]=='A':
        this_trans.case_module = hcase_OHAX

    if not this_trans.validate_as_par():
        this_trans.old_par_line = this_trans.par_line
        this_trans.par_line = correct_par(this_trans)
        if this_trans.validate_as_par():
            print >>co, '%d-%s' % (line_no, this_trans.old_par_line)
            print >>co, '%d+%s' % (line_no, this_trans.par_line)
            ncorrections += 1
        else:
            print this_trans.par_line,'\nfailed to validate! I produced:'
            print this_trans.get_par_str()
            sys.exit(1)
    trans.append(this_trans)
co.close()
print '%d transitions read in.' % (len(trans))

end_time = time.time()
print '%d transitions and %d states in %s' % (len(trans), len(states),