Пример #1
0
    def __init__(self,
                 central_longitude=0,
                 globe=None,
                 false_easting=None,
                 false_northing=None):
        """
        %(proj.init)s
        """
        from cartopy.crs import WGS84_SEMIMAJOR_AXIS, Globe
        if globe is None:
            globe = Globe(semimajor_axis=WGS84_SEMIMAJOR_AXIS, ellipse=None)

        a = globe.semimajor_axis or WGS84_SEMIMAJOR_AXIS
        b = globe.semiminor_axis or a
        if b != a or globe.ellipse is not None:
            warnings.warn(
                f'The {self.name!r} projection does not handle elliptical globes.'
            )

        proj4_params = {'proj': 'aitoff', 'lon_0': central_longitude}
        super().__init__(proj4_params,
                         central_longitude,
                         false_easting=false_easting,
                         false_northing=false_northing,
                         globe=globe)
Пример #2
0
 def __init__(self):
     globe = Globe(ellipse='bessel')
     super(Amersfoort, self).__init__(52.15616055555555,
                                      5.38763888888889,
                                      false_easting=155000,
                                      false_northing=463000,
                                      true_scale_latitude=0.9999079,
                                      globe=globe)
Пример #3
0
 def __init__(self):
     globe = Globe(ellipse='bessel')
     super(CH1903p, self).__init__(central_longitude=7.439583333333333,
                                   central_latitude=46.95240555555556,
                                   scale_factor=1,
                                   false_easting=2600000,
                                   false_northing=1200000,
                                   globe=globe)
Пример #4
0
 def __init__(self):
     globe = Globe(ellipse='bessel')
     super(GaussKruger, self).__init__(9,
                                       0,
                                       scale_factor=1,
                                       false_easting=3500000,
                                       false_northing=0,
                                       globe=globe)
Пример #5
0
 def __init__(self):
     globe = Globe(ellipse='GRS80')
     super(Lambert93, self).__init__(3,
                                     46.5,
                                     standard_parallels=(44, 49),
                                     false_easting=700000,
                                     false_northing=6600000,
                                     globe=globe)
Пример #6
0
 def __init__(self):
     globe = Globe(datum="NAD83")
     super().__init__(
         central_longitude=-96,
         central_latitude=23,
         standard_parallels=(29.5, 45.5),
         globe=globe,
     )
Пример #7
0
def make_globe(proj_dict):
    """
    Crates a cartopy Globe object
    """
    
    a=proj_dict.get('a',None)
    b=proj_dict.get('b',None)
    ellps=proj_dict.get('ellps','WGS84')
    datum=proj_dict.get('datum',None)
    return Globe(datum=datum,ellipse=ellps,semimajor_axis=a,semiminor_axis=b)        
Пример #8
0
def goes_proj(data):
    import cartopy.crs as crs
    from cartopy.crs import Globe
    globe=Globe(datum=None,ellipse='WGS84',
                semimajor_axis=data['semi_major_axis'],
                semiminor_axis=data['semi_minor_axis'])  
    proj=crs.Geostationary(central_longitude=data['lon0'],
                            satellite_height=data['h'], globe=globe,
                            sweep_axis='y')
    return proj
Пример #9
0
 def __init__(self):
     globe = Globe(ellipse="GRS80")
     super().__init__(
         25,
         -30,  # 25,
         standard_parallels=(-22, -38),
         false_easting=1_400_000,
         false_northing=130_000,
         globe=globe,
     )
Пример #10
0
 def __init__(self):
     globe = Globe(ellipse="GRS80")
     super().__init__(
         134,
         0,
         standard_parallels=(-18, -36),
         false_easting=0,
         false_northing=0,
         globe=globe,
     )
Пример #11
0
 def __init__(self):
     globe = Globe(ellipse="GRS80")
     super().__init__(
         -91.866666,
         63.390675,
         standard_parallels=(49, 77),
         false_easting=6_200_000,
         false_northing=3_000_000,
         globe=globe,
     )
Пример #12
0
def plot_goes(data):
    import cartopy.crs as crs
    from cartopy.crs import Globe
    globe=Globe(datum=None,ellipse='WGS84',
                semimajor_axis=data['semi_major_axis'],
                semiminor_axis=data['semi_minor_axis'])  
    proj=crs.Geostationary(central_longitude=data['lon0'],
                            satellite_height=data['h'], globe=globe,
                            sweep_axis='y')
    ax = plt.subplot(1,1, projection=proj)
    ax.set_xlim(data['xlim'])
    ax.set_ylim(data['ylim'])
    im = ax.imshow(data['array'],origin='lower',
                   extent=img_extent,transform=proj )
    return ax
Пример #13
0
def make_ccrs(info):
    """
    Gets cartopy coordinate reference system and image extent for SEVIR events
    
    Paramters
    ---------
    info pandas.Series object
        Any row from the SEVIR CATALOG, or metadata returned from SEVIRGenerator
    
    Returns
    -------
    ccrs - catropy.crs object containing coordinate ref system
    img_extent - image_extent used for imshow
      
    
    """
    # parse the info.proj string
    # e.g. +proj=laea +lat_0=38 +lon_0=-98 +units=m +a=6370997.0 +ellps=sphere
    pjd = {}
    proj_list = info.proj.split()
    for p in proj_list:
        grps = p.strip().split('=')
        key=grps[0].strip('+')
        val=str(grps[1]) if len(grps)==2 else ''
        if _check_num(val):
            val=float(val)
        pjd.update({key:val})
    
    # Create appropriate cartopy object based on proj_dict
    a=pjd.get('a',None)
    b=pjd.get('b',None)
    ellps=pjd.get('ellps','WGS84')
    datum=pjd.get('datum',None)
    globe=Globe(datum=datum,ellipse=ellps,semimajor_axis=a,semiminor_axis=b)
    if ('proj' in pjd) and (pjd['proj']=='laea'):
        ccrs = crs.LambertAzimuthalEqualArea(central_longitude=pjd.get('lon_0',0.0),
                                             central_latitude=pjd.get('lat_0',0.0),
                                             globe=globe)
    else:
        raise NotImplementedError('Projection %s not implemented, please add it' % info.proj)
    
    # use ccrs to compute image extent
    x1,y1=ccrs.transform_point(info.llcrnrlon,info.llcrnrlat,crs.Geodetic())
    x2,y2=ccrs.transform_point(info.urcrnrlon,info.urcrnrlat,crs.Geodetic())
    img_extent=(x1,x2,y1,y2)
    
    return ccrs,img_extent