Return the longitudes (in degrees) of the gridded data.
184986
def _lons(self):
        """"""
        lons = _np.linspace(0.0, 360.0 - 360.0 / self.nlon, num=self.nlon)
        return lons
5716
def get_degree_cols(df):
    
    vals = ['lon_w', 'lon_e', 'lat_lon_precision', 'pole_lon',
            'paleolon', 'paleolon_sigma',
            'lon', 'lon_sigma', 'vgp_lon', 'paleo_lon', 'paleo_lon_sigma',
            'azimuth', 'azimuth_dec_correction', 'dir_dec',
            'geographic_precision', 'bed_dip_direction']
    relevant_cols = list(set(vals).intersection(df.columns))
    return relevant_cols
269713
def get_coordinates(self, i, end=False):
        """"""
        if end:
            endpoint = self.endpoints[i][1]
        else:
            endpoint = self.endpoints[i][0]
        return (endpoint.real, endpoint.imag)
1213300
def get_lon_variable(nc):
    '''
    
    '''
    if 'longitude' in nc.variables:
        return 'longitude'
    longitudes = nc.get_variables_by_attributes(standard_name="longitude")
    if longitudes:
        return longitudes[0].name
    return None
1264083
Double readLongitude(Columns columns) {
        Object value = columns.valueForField(longitude);
        return value == null ? null : readLongitude(value);
    }
106372
def getCoords(self):
        '''
        
        '''

        if DEBUG_COORDS:
            print >>sys.stderr, "getCoords(%s %s ## %s)" % (self.getClass(), self.getId(), self.getUniqueId())

        (x, y) = self.getXY();
        w = self.getWidth()
        h = self.getHeight()
        return ((x, y), (x+w, y+h))
507274
def interpolate_grid(self, in_lon, in_lat):
        
        out_data = np.zeros((self.data.shape[0], in_lon.shape[0], in_lon.shape[1]))
        for d in range(self.data.shape[0]):
            print("Loading ", d, self.variable, self.start_date)
            if self.data[d].max() > -999:
                step = self.data[d]
                step[step < 0] = 0
                if self.lat[-1] < self.lat[0]:
                    spline = RectBivariateSpline(self.lat[::-1], self.lon, step[::-1], kx=3, ky=3)
                else:
                    spline = RectBivariateSpline(self.lat, self.lon, step, kx=3, ky=3)
                print("Evaluating", d, self.variable, self.start_date)
                flat_data = spline.ev(in_lat.ravel(), in_lon.ravel())
                out_data[d] = flat_data.reshape(in_lon.shape)
                del spline
            else:
                print(d, " is missing")
                out_data[d] = -9999
        return out_data
180082
def interpolate(self):
        
        self.latitude = self._interp(self.lat_tiepoint)
        self.longitude = self._interp(self.lon_tiepoint)

        return self.latitude, self.longitude
660767
def longitude(self):
        ''''''
        sd = dm_to_sd(self.lon)
        if self.lon_dir == 'E':
            return +sd
        elif self.lon_dir == 'W':
            return -sd
        else:
            return 0.
1160255
def get_dataset(self, key, info):
        """"""

        angles = self._get_coarse_dataset(key, info)
        if angles is None:
            return

        # Fill gaps at edges of swath
        darr = DataArray(angles, dims=['y', 'x'])
        darr = darr.bfill('x')
        darr = darr.ffill('x')
        angles = darr.data

        res = self.interpolate_angles(angles, key.resolution)

        proj = DataArray(res, dims=['y', 'x'])
        proj.attrs = info.copy()
        proj.attrs['units'] = 'degrees'
        proj.attrs['platform_name'] = self.platform_name
        return proj
545784
def grid_items(self):
        
        if list(self.keys()) == []:  return {}
        cols = self._max_cols
        return {(idx // cols, idx % cols): (key, item)
                for idx, (key, item) in enumerate(self.data.items())}
1010068
def check_bounds_variables(self, dataset):
        '''
        
        '''
        recommended_ctx = TestCtx(BaseCheck.MEDIUM, 'Recommended variables to describe grid boundaries')

        bounds_map = {
            'lat_bounds': {
                'units': 'degrees_north',
                'comment': 'latitude values at the north and south bounds of each pixel.'
            },
            'lon_bounds': {
                'units': 'degrees_east',
                'comment': 'longitude values at the west and east bounds of each pixel.'
            },
            'z_bounds': {
                'comment': 'z bounds for each z value',
            },
            'time_bounds': {
                'comment': 'time bounds for each time value'
            }
        }

        bounds_variables = [v.bounds for v in dataset.get_variables_by_attributes(bounds=lambda x: x is not None)]

        for variable in bounds_variables:
            ncvar = dataset.variables.get(variable, {})
            recommended_ctx.assert_true(ncvar != {}, 'a variable {} should exist as indicated by a bounds attribute'.format(variable))
            if ncvar == {}:
                continue

            units = getattr(ncvar, 'units', '')
            if variable in bounds_map and 'units' in bounds_map[variable]:
                recommended_ctx.assert_true(
                    units == bounds_map[variable]['units'],
                    'variable {} should have units {}'.format(variable, bounds_map[variable]['units'])
                )
            else:
                recommended_ctx.assert_true(
                    units != '',
                    'variable {} should have a units attribute that is not empty'.format(variable)
                )

            comment = getattr(ncvar, 'comment', '')
            recommended_ctx.assert_true(
                comment != '',
                'variable {} should have a comment and not be empty'
            )

        return recommended_ctx.to_result()
557200
def available_datasets(self):
        """"""
        sensor = self.get_sensor(self['/attr/sensor'])
        nadir_resolution = self.get_nadir_resolution(sensor)
        for var_name, val in self.file_content.items():
            if isinstance(val, SDS):
                ds_info = {
                    'file_type': self.filetype_info['file_type'],
                    'resolution': nadir_resolution,
                }
                if self._is_polar():
                    ds_info['coordinates'] = ['longitude', 'latitude']
                yield DatasetID(name=var_name, resolution=nadir_resolution), ds_info
575868
def _check_invalid_longitudes(self):
        '''
        
        '''
        idlon = self.strain.data['longitude'] > 180.
        if np.any(idlon):
            self.strain.data['longitude'][idlon] = \
                self.strain.data['longitude'][idlon] - 360.
264041
def _lats(self):
        """"""
        lats = _np.linspace(90.0, -90.0 + 180.0 / self.nlat, num=self.nlat)
        return lats
396051
def coordinates(self, dms: bool = False) -> dict:
        
        return {
            'longitude': self._get_fs('lg', dms),
            'latitude': self._get_fs('lt', dms),
        }
1204967
def get_utm_zone(longitude):
    """"""
    zone = int((math.floor((longitude + 180.0) / 6.0) + 1) % 60)
    if zone == 0:
        zone = 60
    return zone