Hi Stephen, Ferret always converts data to single precision, so this must have been just about the file datatype or format - might be Ferret can't properly read binary data that's stored as double precision. Ansley Stephen Guimond wrote: Hi Ansley, My file was in binary format read in with the /format=stream option in ferret so this must explain the discrepancy in data type (r8 vs. r4) and thus the problem with the rect_to_curv function. Does ferret only convert to single precision when the data file is NetCDF? Steve ----- Original Message ----- From: Ansley Manke <Ansley.B.Manke@xxxxxxxx> Date: Tuesday, September 2, 2008 10:19 am Subject: Re: [ferret_users] Inf, NAN and **** output from rect_to_curv function To: guimond@xxxxxxxxxxxxx Cc: oar.pmel.ferret_users@xxxxxxxxHi Steve, Thanks for reporting back. If the data is coming in from netCDF files, Ferret should convert to single precision on input (except for coordinate axis values, that is 1-D axes, not curvilinear coordinate data which is read as variable fields and is in single precision ). So I'm not sure what may have been happening to make this happen, but it's good to know you're off and running. Ansley Stephen Guimond wrote:I believe I found an answer to my own question. My input data totherect_to_curv function was in double precision (read in with typer8)and the output coordinates were in single precision therefore the output must have been confused with the type and returned inf,NAN and**** values. All I did was output the data to a file and thenread itback in with single precision and the call to rect_to_curv worked. ----- Original Message ----- From: Stephen Guimond <sguimond@xxxxxxx> Date: Monday, September 1, 2008 4:31 am Subject: [ferret_users] Inf, NAN and **** output fromrect_to_curvfunction To: oar.pmel.ferret_users@xxxxxxxxHello, I am trying to grid a rectilinear grid onto a curvilinear grid but just get a bunch of inf, NAN and *** for my output. The gridof myinput variable (called ntest): name axis # pts start end NX LONGITUDE 200mi 126.12W(233.89) 113.89W(246.11) NY LATITUDE 200 i 14.253N25.746N ZAX Z (KM) 71 i 0.035583 15.116 The grid of my destination curvilinear coordinates (same 2-D dimensions for lat and lon): name axis # pts start end X1 X 180 r 1 180 Y1 Y 200 r 1 200 The values of the 2-D lat and lon can be seen from the attached plot, which shows the general rectilinear grid and an overlay of the curvilinear grid. Here is my call to the function: let testing = rect_to_curv(ntest[d=1], clon, clat, 2) Again, this gives me inf, NAN and *** for output. Not sure if the destination coords need to be defined on a lat/lon axis or if they can be just a listing of lat/lon in degrees as I have it here. This wasn't clear from the documentation. Thanks, Steve ======================================================= Stephen R. Guimond Graduate Research Assistant Florida State University Center for Ocean-Atmospheric Prediction Studies (COAPS) ============================================================================================================== Stephen R. Guimond Graduate Research Assistant Florida State University Center for Ocean-Atmospheric Prediction Studies (COAPS) ============================================================================================================== Stephen R. Guimond Graduate Research Assistant Florida State University Center for Ocean-Atmospheric Prediction Studies (COAPS) ======================================================= |