# -*- coding: utf-8 -*-
"""
Created on Wed Sep 19 20:35:22 2012

@author: Edmondo
"""

import numpy as np
from v2d import V2d, NamedV2d
import socket
import re
 
_computer_name = socket.getfqdn()
_is_ftu_cluster = (True 
    if re.match(r'fusc..\.frascati\.enea\.it',_computer_name) else
    False)

_is_jac_cluster = (True
    if re.match(r'jac-.*\.jet\.uk',_computer_name) else
    False)
    
if _is_ftu_cluster:
    from ftu import Ftudata, dbput1d
else:
    from tokdata_mdsplus import Ftudata
 
def ftudata(shot, channel, imode=0):
    """Convenience function return a Ftudata object
    """
    return Ftudata(shot=shot, channel=channel, imode=imode)

def jetdata_mdsplus(shot, channel):
    """Convenience function returns a Jetdata object 
    """
    return Jetdata(shot, channel)

if _is_jac_cluster:
    from ppfeg import jetdata
else:
    from tokdata_mdsplus import Jetdata
    jetdata = jetdata_mdsplus
       
from tokdata_mdsplus import Eastdata

def eastdata(shot, channel):
    return Eastdata(shot, channel)
    
