<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Hi Andrew,<br>
    <br>
    you can remap the data using gdal or cdo for instance. I prefer
    using cdo and in the following the way to do it with cdo is
    described.<br>
    <br>
    1. get grid description from input file<br>
    2. change the units of x and y coordinate variable from 'Meter' to
    'm'<br>
    3. generate the grid description file for the output data on regular
    lonlat grid for Puerto Rico area<br>
    4. remap the input file<br>
    <br>
    Sounds difficult but it isn't.<br>
    <br>
    1. get the input file grid description<br>
    <br>
    <font face="monospace">cdo griddes nws_precip_wytd_20240601_pr.nc
      > gridfile.txt</font><br>
    <br>
    2. edit the gridfile.txt and change Meter to m<br>
    <br>
    <font face="monospace">gridtype  = projection<br>
      gridsize  = 42025<br>
      xsize     = 205<br>
      ysize     = 205<br>
      xname     = x<br>
      xlongname = "x coordinate of projection"<br>
      xunits    = "m"<br>
      yname     = y<br>
      ylongname = "y coordinate of projection"<br>
      yunits    = "m"<br>
      xfirst    = 4943283.5160097<br>
      xinc      = 4762.5<br>
      yfirst    = -6236964.62846119<br>
      yinc      = -4762.5<br>
      grid_mapping = crs<br>
      grid_mapping_name = polar_stereographic<br>
      straight_vertical_longitude_from_pole = -105.<br>
      false_easting = 0.<br>
      standard_parallel = 60.<br>
      false_northing = 0.<br>
      latitude_of_projection_origin = 90.<br>
      earth_radius = 6367470.<br>
      proj4 = "+proj=stere +lat_0=90 +lat_ts=60 +lon_0=-105 +x_0=0
      +y_0=0 +a=6367470 +b=6367470 +units=m +no_defs"<br>
      crs_wkt = 'PROJCS["NOAA_HRAP_Grid",   
      GEOGCS["GCS_NOAA_HRAP",        DATUM["D_NOAA_HRAP",           
      SPHEROID["Sphere",6367470,0.0]        ],       
      PRIMEM["Greenwich",0.0],       
      UNIT["Degree",0.0174532925199433]    ],   
      PROJECTION["Polar_Stereographic"],   
      PARAMETER["false_easting",0.0],   
      PARAMETER["false_northing",0.0],   
      PARAMETER["central_meridian",-105.0],   
      PARAMETER["latitude_of_origin",60.0],    UNIT["meter",1.0]]'<br>
      esri_pe_string = 'PROJCS["NOAA_HRAP_Grid",   
      GEOGCS["GCS_NOAA_HRAP",        DATUM["D_NOAA_HRAP",           
      SPHEROID["Sphere",6367470,0.0]        ],       
      PRIMEM["Greenwich",0.0],       
      UNIT["Degree",0.0174532925199433]    ],   
      PROJECTION["Stereographic_North_Pole"],   
      PARAMETER["false_easting",0.0],   
      PARAMETER["false_northing",0.0],   
      PARAMETER["central_meridian",-105.0],   
      PARAMETER["standard_parallel_1",60.0],    UNIT["meter",1.0]]'</font><br>
    <br>
    3. generate output grid descption file grid_lonlat.txt<br>
    <br>
    <font face="monospace">gridtype  = lonlat<br>
      gridsize  = 31122<br>
      xsize     = 182<br>
      ysize     = 171<br>
      xname     = lon<br>
      xlongname = "longitude"<br>
      xunits    = "degrees_east"<br>
      yname     = lat<br>
      ylongname = "latitude"<br>
      yunits    = "degrees_north"<br>
      xfirst    = -70.6<br>
      xinc      = 0.05<br>
      yfirst    = 13.78<br>
      yinc      = 0.05</font><br>
    <br>
    4. remap the data<br>
    <br>
    <font face="monospace">cdo -remapbil,grid_lonlat.txt
      -setgrid,gridfile.txt nws_precip_wytd_20240601_pr.nc outfile.nc</font><br>
    <br>
    <br>
    Hope this will help you,<br>
    Karin<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Am 01.06.24 um 22:15 schrieb Andrew
      Kren - NOAA Federal via ncl-talk:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJJ=ypp7858o4czZ=A4uwW5kzOfxh60XSZ9r5sDVYHROx=uZKQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi there,
        <div><br>
        </div>
        <div>I am not sure I am asking the right question, but here
          goes. I am reading noaa stage IV precipitation data, found
          here: <a
href="https://water.noaa.gov/resources/downloads/precip/stageIV/2024/06/01/"
            moz-do-not-send="true" class="moz-txt-link-freetext">https://water.noaa.gov/resources/downloads/precip/stageIV/2024/06/01/</a></div>
        <div><br>
        </div>
        <div>The new data has been transformed to a polar stereographic
          grid. When I did an ncl_filedump on the netcdf file, the
          variables were x, y and not lat/lon. The x, y values are
          random positive/negative numbers, which I'm guessing is some
          non lat/lon projection. My question is, is there a way in NCL
          to convert this file so that the variables are in lat/lon
          coordinates? Or is this something I need to do outside ncl?</div>
        <div><br>
        </div>
        <div>Thanks for any help!<br clear="all">
          <div><br>
          </div>
          <span class="gmail_signature_prefix">-- </span><br>
          <div dir="ltr" class="gmail_signature"
            data-smartmail="gmail_signature">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">
                          <div dir="ltr">
                            <div dir="ltr">
                              <div dir="ltr">
                                <div dir="ltr">
                                  <div dir="ltr">
                                    <div dir="ltr">
                                      <div dir="ltr">
                                        <div dir="ltr">
                                          <div dir="ltr">
                                            <div dir="ltr">
                                              <div dir="ltr">
                                                <div dir="ltr">
                                                  <div dir="ltr">
                                                    <pre cols="72"
style="white-space:pre-wrap;color:rgb(34,34,34);font-family:"arial black",sans-serif"><span
style="font-family:arial,helvetica,sans-serif">Andrew Kren
Meteorologist 
NOAA's National Weather Service
Raleigh Forecast Office
1005 Capability Drive, Suite 300
Raleigh, North Carolina 27606
voice: 919-326-1035 
mailto: <a href="mailto:andrew.kren@noaa.gov" target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">andrew.kren@noaa.gov</a></span><span
style="font-family:arial,helvetica,sans-serif">
</span><a href="http://www.weather.gov/rah" style="color:rgb(17,85,204)"
                                                    target="_blank"
moz-do-not-send="true"><span
style="font-family:arial,helvetica,sans-serif">http://www.weather.gov/rah</span></a></pre>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
ncl-talk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="moz-txt-link-freetext" href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>