Jump to content

David Pullinger

Members
  • Posts

    3
  • Joined

  • Last visited

David Pullinger's Achievements

  1. Hi Dimitri, Is the problem you're seeing due to the change in the coordinate reference that is being used between the (south_north, west_east) indices when compared to (XLAT, XLON)? I've come across these issues when trying to import the NEWA download inputs into other software which requires a standard CRS (converting NEWA downloads into .wrg formats for example). (south_north, west_east) falls on a nice neat grid, with in your situation, 7 columns and 7 rows, but when XLAT/XLON are plotted you don't get neat columns and rows due to the warping resulting in 49 unique pairs (one for each point in the grid). It means that for coordinate transformation then I've had to loop through per point using something similar to below. def ts_coordinate_converter(lon, lat): crs_wkt = 'PROJCRS["unknown",BASEGEOGCRS["unknown",DATUM["unknown",ELLIPSOID["unknown",6370000,0,LENGTHUNIT["metre",1,ID["EPSG",9001]]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8901]]],CONVERSION["unknown",METHOD["Lambert Conic Conformal (2SP)",ID["EPSG",9802]],PARAMETER["Latitude of false origin",54,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8821]],PARAMETER["Longitude of false origin",15,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8822]],PARAMETER["Latitude of 1st standard parallel",30,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8823]],PARAMETER["Latitude of 2nd standard parallel",60,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8824]],PARAMETER["Easting at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8826]],PARAMETER["Northing at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8827]]],CS[Cartesian,2],AXIS["(E)",east,ORDER[1],LENGTHUNIT["metre",1,ID["EPSG",9001]]],AXIS["(N)",north,ORDER[2],LENGTHUNIT["metre",1,ID["EPSG",9001]]]]' custom_transformer = pyproj.Transformer.from_crs( pyproj.CRS.from_string(crs_wkt), pyproj.CRS.from_epsg(3035), always_xy=True ) x, y = custom_transformer.transform(lon, lat) return (x, y)
  2. I'm getting different "south_north/west_east" coordinates when I download a .nc file for either a bbox or a timeseries download for the same area. When I download a bbox - the "south_north/west_east" appears correctly in EPSG:3035. However when I download a timeseries for the same area the "south_north/west_east" gives completely different (negative values), I've examined the .nc file of the time series and it includes the correct (desired) XLAT and XLON equivalent to the requested areas. For comparison I've downloaded a box of data (for both timeseries and the same coordinates for the bbox) using the following code: parameter_url = 'https://wps.neweuropeanwindatlas.eu/api/mesoscale-ts/v1/get-variables' data_url = 'https://wps.neweuropeanwindatlas.eu/api/mesoscale-ts/v1/get-data-bbox' params = { 'southBoundLatitude' : 50.61, 'northBoundLatitude' : 51.0, 'westBoundLongitude' : -4.17, 'eastBoundLongitude' : -3.8, 'height' : [height], 'variable' : ['WS', 'WD'], 'dt_start' : '2018-06-30T00:00:00', 'dt_stop' : '2018-12-31T23:30:00' } The coordinates that come out of this appear starting with: [-216000, -1296000] whereas they should be [3194160, 3325480] if they were in EPSG:3035. Are the time series downloads in a different EPSG from the other sources? If so what is it?
×
×
  • Create New...