[Thread Prev][Thread Next][Index]

RE: [ferret_users] Regridding transformation



Hi Ansley,

 

Thank-you for the really thorough response, it’s helped me to solve this!

 

So part of the issue was where in the code I was using the @asn transformation.

 

... It didn’t like me using it nested within the data selection brackets:

 

**ERROR: command syntax: invalid nested brackets: GT=OCN_TEMP[D=2@ASN]

 

This was the code I used to successfully regrid the data:

 

Yes? Use “./200517obs_temp.nc”

Yes? Use “./ocn_tempyearmean.nc”

Yes? Let regridxyz = T_AN[d=1,gxyz=GOY1]

Yes? Let regrid = regridxyz[gt=ocn_temp[d=2]@asn]

 

This also works fine using the gxyz=ocn_temp[d=2] line.

 

The main issue that I was having, as silly as it now seems, is the spacing between the different sections of code... It only worked when I did not include a space between gt=     ocn_temp

 

I assume that ferret was trying to read the space as part of the grid name as this issue also occurred if I had a space before GOY1.

 

Thank-you again,

 

Josh

 

Sent from Mail for Windows 10

 


From: owner-ferret_users@xxxxxxxx <owner-ferret_users@xxxxxxxx> on behalf of Ansley C. Manke <ansley.b.manke@xxxxxxxx>
Sent: Monday, April 15, 2019 6:30:41 PM
To: ferret_users@xxxxxxxx
Subject: Re: [ferret_users] Regridding transformation
 

Hi Josh,

The commands you use in your examples here look ok as far as I can see without knowing what's in the datasets. My guess is that you're using a grid-name.  The commands are most commonly given using variable names, not grid names. Or, if you are using a grid name in specifying the regridding operation, leave off the [d=2].  There's a demo script

yes? show go regridding_demo

Which uses both styles; it starts out defining grids and using them in regridding commands and also shows regridding operations set up using variable names.  I'd suggest the latter style; it just makes the scripts easier to read.

It sounds like you're on the right track using the variable name at the end of your question; what error message did you see there?

In general if the grids have "world-coordinate" units, you'll want to let Ferret do the work of translating units of location and time and do a regridding operation with a regridding transform like linear interpolation or averaging. @ASN is most useful when one of the grids doesn't have units, but you know that they should just take on the coordinates of the grid you're regridding to.  You can regrid in different directions with different gridding operations - something like this, for instance if the XYZ are defined in world coordinates but the T axis of  the T_AN grid are just index values:

yes? use "./200517obs_temp.nc" !observation data
yes? use "./ocn_tempyearmean.nc" !model output data
yes? let regridxyz = T_AN[d=1,gxyz = ocn_temp[d=2]]
yes? let regrid=regridxyz[gt=ocn_temp[d=2@asn]]

And finally don't forget to set units and title for the final variable  with LET/units="units_string"/TITLE="title_string", or have a look at "define variable/LIKE="  in the documentation for setting the attributes of a variable using the attributes of an existing one.

Ansley

On 4/15/2019 2:23 AM, JoshAB1995@xxxxxxxxxxx wrote:

Hi guys,

 

I’m currently trying to regrid my observational data onto my more coarse resolution model output data. However, I’m running into a few issues after entering the following code...

 

yes? use "./200517obs_temp.nc" !observation data

yes? use "./ocn_tempyearmean.nc" !model output data

yes? let regrid = T_AN[d=1,gxyzt = GOY1[d=2]@ASN] !I added @ASN as I was directed by Ferret to this transformation, T_AN is the observ variable, GOY1 is the grid from my model output.

yes? shade regrid[k=1]

**ERROR: unknown defining grid: GXYZT = GOY1[D=2]@ASN

 

This was after trying to do it all in Ferret.

 

I then tried to remap partially in cdo and carry out the remaining transformations in ferret via:

 

cdo remapbil,ocn_tempyearmean.nc 200517obs_temp.nc horizontalregrid.nc

 

The function for vertical regridding in cdo wasn’t working so I then moved back onto ferret:

 

yes? use “./horizontalregrid.nc” !horizontally regridded observations

yes? use “./ocn_tempyearmean.nc” !model output data

yes? let 3dregrid = T_AN[d=1, gzt = GOY1[d=2]] ! regrids the vertical axis with no issues but struggles with the taxis, so then added the @ASN and it still ran into issues with the t transformation.

 

Just to make sure it’s not the ‘grid’ that’s messing it up I also reran the code but instead of GOY1 entered the name of the model output data variable “ocn_temp” – to no avail...

 

This is the first time I’ve tried to interpolate two grids and so I’m sure there are simple errors I’m making but I’m struggling to figure out where... Any help would be greatly appreciated.

 

Many thanks,

 

Josh

 

Sent from Mail for Windows 10

 


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement