Exemplo n.º 1
0
    def __init__(self,
                 x,
                 y,
                 cube=True,
                 maps=True,
                 modelcube=True,
                 lazy=False,
                 **kwargs):

        if not cube and not maps and not modelcube:
            raise MarvinError('no inputs defined.')

        self.cube_quantities = FuzzyDict({})
        self.maps_quantities = FuzzyDict({})
        self.modelcube_quantities = FuzzyDict({})

        self._cube = cube
        self._maps = maps
        self._modelcube = modelcube

        for attr in ['mangaid', 'plateifu', 'release', 'bintype', 'template']:

            value = kwargs.pop(attr, None) or \
                getattr(cube, attr, None) or \
                getattr(maps, attr, None) or \
                getattr(modelcube, attr, None)

            setattr(self, attr, value)

        self._kwargs = kwargs
        self._parent_shape = None

        # drop breadcrumb
        breadcrumb.drop(message='Initializing MarvinSpaxel {0}'.format(
            self.__class__),
                        category=self.__class__)

        self.x = int(x)
        self.y = int(y)

        self.loaded = False
        self.datamodel = None

        if lazy is False:
            self.load()

        # Load VACs
        from marvin.contrib.vacs.base import VACMixIn
        self.vacs = VACMixIn.get_vacs(self)
Exemplo n.º 2
0
    def __init__(self,
                 x,
                 y,
                 mangaid=None,
                 plateifu=None,
                 cube=True,
                 maps=True,
                 modelcube=True,
                 lazy=False,
                 **kwargs):

        self.cube_quantities = FuzzyDict({})
        self.maps_quantities = FuzzyDict({})
        self.modelcube_quantities = FuzzyDict({})

        self._cube = cube
        self._maps = maps
        self._modelcube = modelcube

        self._plateifu = plateifu
        self._mangaid = mangaid

        self.kwargs = kwargs

        if not self._cube and not self._maps and not self._modelcube:
            raise MarvinError(
                'either cube, maps, or modelcube must be True or '
                'a Marvin Cube, Maps, or ModelCube object must be specified.')

        self._parent_shape = None

        # drop breadcrumb
        breadcrumb.drop(message='Initializing MarvinSpaxel {0}'.format(
            self.__class__),
                        category=self.__class__)

        self.x = int(x)
        self.y = int(y)

        self.loaded = False
        self.datamodel = None

        if lazy is False:
            self.load()
Exemplo n.º 3
0
    def __init__(self, *args, **kwargs):
        ''' Initializes a Marvin Form

        Generates all the WTForms from the SQLAlchemy ModelClasses defined in the MaNGA DB.

        _param_form_lookup = dictionary of all modelclass parameters
        of form {'SQLalchemy ModelClass parameter name': WTForm Class}
        '''

        self._release = kwargs.get('release', config.release)
        self.verbose = kwargs.get('verbose', False)
        if marvindb:
            self._modelclasses = FuzzyDict(
                marvindb.buildUberClassDict(release=self._release))
            self._param_form_lookup = ParamFormLookupDict(**kwargs)
            self._param_fxn_lookup = ParamFxnLookupDict()
            self._paramtree = tree()
            self._generateFormClasses(self._modelclasses)
            self._generateFxns()
            self.SearchForm = SearchForm
            self._cleanParams(**kwargs)