Hello all,<br>I am trying to create the proj4 string for a netcdf file with the following coordinate information:<br><br><span style="font-family: courier new,monospace;">variables:</span><span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> char Transverse_Mercator ;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Transverse_Mercator:grid_mapping_name = "transverse_mercator" ;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Transverse_Mercator:longitude_of_central_meridian = -97. ;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Transverse_Mercator:latitude_of_projection_origin = 47.5 ;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Transverse_Mercator:scale_factor_at_central_meridian = 1. ;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Transverse_Mercator:false_easting = 3925000. ;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Transverse_Mercator:false_northing = 3175000. ;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> double lat(yc, xc) ;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> lat:units = "degrees_north" ;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> lat:long_name = "latitude" ;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> lat:standard_name = "latitude" ;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> lat:axis = "Y" ;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> double lon(yc, xc) ;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> lon:units = "degrees_east" ;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> lon:long_name = "longitude" ;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> lon:standard_name = "longitude" ;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> lon:axis = "X" ;</span><span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> double xc(xc) ;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> xc:long_name = "x-coordinate in Cartesian system" ;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> xc:standard_name = "projection_x_coordinate" ;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> xc:units = "m" ;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> xc:axis = "X" ;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> double yc(yc) ;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> yc:long_name = "y-coordinate in Cartesian system" ;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> yc:standard_name = "projection_y_coordinate" ;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> yc:units = "m" ;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> yc:axis = "Y" ;</span><br><br><br>The file gives the coordinates in their native projected coordinates as well as the lat & lon coordinates. <br>
<br>From this information, I created the following proj4 string:<br>+proj=tmerc +lat_0=47.5 +y_0=3175000.0 +x_0=3925000.0 +lon_0=-97.0 +k_0=1.0 +units=m +ellps=sphere<br><br>(The sphere ellipsoid is a guess as they didn't provide the geographic coordinate system.)<br>
So when I test out this proj4 string, these are the results I get:<br><br><span style="font-family: courier new,monospace;">proj -f "%f" +proj=tmerc +lat_0=47.5 +y_0=3175000.0 +x_0=3925000.0 +lon_0=-97.0 +k_0=1.0 +units=m +ellps=sphere</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">in> -126.0869 19.61229</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">in> -125.6792 19.77242</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">in> -125.2703 19.93048</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"></span><br><span style="font-family: courier new,monospace;">out> 773317.154904 359897.643377</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">out> 824089.485710 370794.986195</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">out> 874706.342446 381466.440468</span><br>
<br>the projection coordinates should be:<br>600000 600000<br>650000 600000<br>700000 600000<br><br>and then the opposite transformation:<br><br><span style="font-family: courier new,monospace;">invproj -f "%f" +proj=tmerc +lat_0=47.5 +y_0=3175000.0 +x_0=3925000.0 +lon_0=263 +k_0=1.0 +ellps=sphere </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">in> 600000 600000</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">in> 650000 600000</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">in> 700000 600000</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">out> -127.929260 -21.210147</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">out> -127.514502 -21.293413</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">out> -127.097731 -21.375966</span><br>
<br>and the coordinates should be:<br><span style="font-family: courier new,monospace;">-126.0869 19.61229</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">-125.6792 19.77242</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">-125.2703 19.93048</span><br><br>The longitude are at least in the ballpark, but the latitudes are completely off. <br><br>If it helps, this data has been downloaded from NARCCAP, and it is the RegCM3 model.<br>
Any help would really be appreciated.<br>Thanks in advance,<br>Hailey<br><br><br><br>