Return modeled measurements

        1. dimension: frequency
        2. dimension: config-number
        3. dimension: 2: magnitude and phase (resistivity)
553640
def measurements(self):
        
        m_all = np.array([self.tds[key].measurements() for key in
                          sorted(self.tds.keys())])
        return m_all
822826
def _process_pore_voxels(self):
        
        '''
        num_Ps = self.num_pores()
        pore_vox = sp.zeros(num_Ps, dtype=int)
        fiber_vox = sp.zeros(num_Ps, dtype=int)
        pore_space = self._hull_image.copy()
        fiber_space = self._hull_image.copy()
        pore_space[self._fiber_image == 0] = -1
        fiber_space[self._fiber_image == 1] = -1
        freq_pore_vox = itemfreq(pore_space)
        freq_pore_vox = freq_pore_vox[freq_pore_vox[:, 0] > -1]
        freq_fiber_vox = itemfreq(fiber_space)
        freq_fiber_vox = freq_fiber_vox[freq_fiber_vox[:, 0] > -1]
        pore_vox[freq_pore_vox[:, 0]] = freq_pore_vox[:, 1]
        fiber_vox[freq_fiber_vox[:, 0]] = freq_fiber_vox[:, 1]
        self['pore.volume'] = pore_vox*self.network.resolution**3
        del pore_space
        del fiber_space
92056
def get_grid_spatial_dimensions(self, variable):
        """"""

        data = self.open_dataset(self.service).variables[variable.variable]
        dimensions = list(data.dimensions)
        return data.shape[dimensions.index(variable.x_dimension)], data.shape[dimensions.index(variable.y_dimension)]
553547
def _get_magnitude_scaling_term(self, C, mag):
        
        dmag = mag - self.CONSTS["Mh"]
        if mag < self.CONSTS["Mh"]:
            return C["e1"] + (C["b1"] * dmag) + (C["b2"] * (dmag ** 2.0))
        else:
            return C["e1"] + (C["b3"] * dmag)
1202817
def dimension_ids(self):
        
        return self._sorted_ingredients([
            d.id for d in self.values() if isinstance(d, Dimension)
        ])
350429
def get_dimension(self, dataset, dimension):
        """"""

        path = '/api/1.0/meta/dataset/{}/dimension/{}'
        return self._api_get(definition.Dimension, path.format(dataset, dimension))
1142172
def _get_axis_dims(self, element):
        
        dims = element.dimensions()[:2]
        if len(dims) == 1:
            return dims + [None, None]
        else:
            return dims + [None]
849074
def get_dimension(data):
    
    result = [0, 0]

    if isinstance(data, list):
        result = get_dimension_array(data)

    elif isinstance(data, dict):
        result = get_dimension_dict(data)

    return result
1145261
def _get_dimension_scales(self, dimension, preserve_domain=False):
        
        if preserve_domain:
            return [
                self.scales[k] for k in self.scales if (
                    k in self.scales_metadata and
                    self.scales_metadata[k].get('dimension') == dimension and
                    not self.preserve_domain.get(k)
                )
            ]
        else:
            return [
                self.scales[k] for k in self.scales if (
                    k in self.scales_metadata and
                    self.scales_metadata[k].get('dimension') == dimension
                )
            ]
217911
def infer_dims(self, x, y, dims_x, dims_y, dims_out):
        
        assert len(x) == len(dims_x)
        assert len(y) == len(dims_y)
        if len(self.fmodel.dataset) == 0:
            return [0.0]*self.dim_out
        else:
            _, index = self.fmodel.dataset.nn_dims(x, y, dims_x, dims_y, k=1)
            return self.fmodel.dataset.get_dims(index[0], dims=dims_out)
961447
def get_magnitude_scaling(self, C, mag):
        
        d_m = mag - self.CONSTANTS["Mh"]
        if mag < self.CONSTANTS["Mh"]:
            return C["e1"] + C["b1"] * d_m + C["b2"] * (d_m ** 2.0)
        else:
            return C["e1"] + C["b3"] * d_m
975686
def coords_by_dimension(self, dimensions=3):
        

        coords_matrix = self.vecs[:, :dimensions]
        varexp = self.cve[dimensions - 1]
        return coords_matrix, varexp
324046
def dimensions(self):
        """"""
        _, _, width, height = self._extents
        return height, width
944777
def dimension_type(self):
        """"""
        base_type = self._base_type
        if base_type == "categorical":
            return self._resolve_categorical()
        if base_type == "enum.variable":
            return self._resolve_array_type()
        if base_type == "enum.datetime":
            return DT.DATETIME
        if base_type == "enum.numeric":
            return DT.BINNED_NUMERIC
        if base_type == "enum.text":
            return DT.TEXT
        raise NotImplementedError("unrecognized dimension type %s" % base_type)
475784
def _compute_magnitude(self, rup, C):
        
        return C['b1'] + (C['b2'] * rup.mag) + (C['b3'] * (rup.mag ** 2))
1319659
def get(self, measurementId):
        
        logger.info('Analysing ' + measurementId)
        measurement = self._measurementController.getMeasurement(measurementId, MeasurementStatus.COMPLETE)
        if measurement is not None:
            if measurement.inflate():
                data = {
                    name: {
                        'spectrum': {
                            'x': self._jsonify(data.spectrum('x')),
                            'y': self._jsonify(data.spectrum('y')),
                            'z': self._jsonify(data.spectrum('z')),
                            'sum': self._jsonify(data.spectrum('sum'))
                        },
                        'psd': {
                            'x': self._jsonify(data.psd('x')),
                            'y': self._jsonify(data.psd('y')),
                            'z': self._jsonify(data.psd('z'))
                        },
                        'peakSpectrum': {
                            'x': self._jsonify(data.peakSpectrum('x')),
                            'y': self._jsonify(data.peakSpectrum('y')),
                            'z': self._jsonify(data.peakSpectrum('z')),
                            'sum': self._jsonify(data.peakSpectrum('sum'))
                        }
                    }
                    for name, data in measurement.data.items()
                }
                return data, 200
            else:
                return None, 404
        else:
            return None, 404
1199953
def _get_magnitude_term(self, C, mag):
        
        dmag = mag - 8.0
        return C["c0"] + C["c3"] * dmag + C["c4"] * (dmag ** 2.)