{"action":"created","issue":{"url":"https://api.github.com/repos/NOAA-PMEL/Ferret/issues/1868","repository_url":"https://api.github.com/repos/NOAA-PMEL/Ferret","labels_url":"https://api.github.com/repos/NOAA-PMEL/Ferret/issues/1868/labels{/name}","comments_url":"https://api.github.com/repos/NOAA-PMEL/Ferret/issues/1868/comments","events_url":"https://api.github.com/repos/NOAA-PMEL/Ferret/issues/1868/events","html_url":"https://github.com/NOAA-PMEL/Ferret/issues/1868","id":313126753,"number":1868,"title":"regridding transformation to an identical axis, and transforming scalars and \"normal\" axes","user":{"login":"AndrewWittenberg","id":34082818,"avatar_url":"https://avatars0.githubusercontent.com/u/34082818?v=4","gravatar_id":"","url":"https://api.github.com/users/AndrewWittenberg","html_url":"https://github.com/AndrewWittenberg","followers_url":"https://api.github.com/users/AndrewWittenberg/followers","following_url":"https://api.github.com/users/AndrewWittenberg/following{/other_user}","gists_url":"https://api.github.com/users/AndrewWittenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewWittenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewWittenberg/subscriptions","organizations_url":"https://api.github.com/users/AndrewWittenberg/orgs","repos_url":"https://api.github.com/users/AndrewWittenberg/repos","events_url":"https://api.github.com/users/AndrewWittenberg/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewWittenberg/received_events","type":"User","site_admin":false},"labels":[{"id":758373836,"url":"https://api.github.com/repos/NOAA-PMEL/Ferret/labels/GFDL:%20high","name":"GFDL: high","color":"d93f0b","default":false},{"id":757390769,"url":"https://api.github.com/repos/NOAA-PMEL/Ferret/labels/P:%20high","name":"P: high","color":"f9d0c4","default":false},{"id":323826823,"url":"https://api.github.com/repos/NOAA-PMEL/Ferret/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-10T23:47:17Z","updated_at":"2018-05-15T17:42:48Z","closed_at":null,"author_association":"COLLABORATOR","body":"As described at the end of in #1618, currently a regridding transformation to an identical axis is a no-op.  This is appropriate for many of the regridding transformations, but not all of them.  For example:\r\n\r\n```\r\n \tNOAA/PMEL TMAP\r\n \tFERRET v7.4 (optimized)\r\n \tLinux 2.6.32-696.23.1.el6.x86_64 64-bit - 04/10/18\r\n \t10-Apr-18 19:02     \r\n\r\nyes? def ax/x=1:4:1 xax\r\nyes? let two = 2 + 0*x[gx=xax]\r\nyes? list two[gx=xax@ngd]\r\n             VARIABLE : 2 + 0*X[GX=XAX]\r\n             SUBSET   : 4 points (X)\r\n 1   / 1:  2.000\r\n 2   / 2:  2.000\r\n 3   / 3:  2.000\r\n 4   / 4:  2.000\r\n```\r\n\r\nHere we've asked Ferret how many \"good\" points sit within each cell: the answer should be all 1's, not 2's.  Other examples of regridding transformations where Ferret actually needs to do something nontrivial, if the target axis matches the source axis:\r\n\r\n`@ngd`, `@modngd`: Result should be 1 where valid, 0 elsewhere.\r\n`@modnbd`: Result should be 0 where valid, 1 elsewhere.\r\n`@var`, `@modvar`: Result should be 0 where valid, missing elsewhere.\r\n`@nbin`: Result should be 1 where valid, missing elsewhere.\r\n`@iin`: Result should be the weighted integral from the start of the target axis to each cell coordinate, just as if we were regridding to a non-identical axis.\r\n\r\n(This desired behavior for `@iin` regridding is the main reason I'm submitting this ticket.)\r\n\r\nA related issue is regular (non-regridding) transforms that are \"normal\" (orthogonal) to the axis of the source variable.  A trivial case is scalars, which are normal to _every_ axis:\r\n\r\n```\r\nyes? let a = 2\r\nyes? list a[x=@ngd]\r\n             VARIABLE : 2\r\n          2.000\r\n```\r\n\r\nHere the answer should be 1.\r\n\r\nSuch transformations to consider: `@var`, `@shf`, `@ddc`, `@ddf`, `@ddb`, `@din`, `@iin`, `@ngd`, `@nbd`, `@loc`, `@weq`, `@cda`, `@cdb`, `@cia`, `@cib`, `@evn`, `@std`, `@wgt`.\r\n\r\nFor scalars, the results of many of these could simply be 1, 0, or the missing value.  Alternatively, Ferret could just give an error and say that transformations are disallowed for scalars.\r\n\r\nFor transformations normal to an existing axis:\r\n\r\n```\r\nyes? let a = {1,2,3,4}\r\nyes? list a[x=@ngd, y=@ngd]\r\n **ERROR: illegal use of transformation:  not all dimensions present on grid\r\n```\r\n\r\nThis seems acceptable -- Ferret just cops out.  (An alternative might be to simply ignore the y-oriented component of the multi-axis transformation.)  But then\r\n\r\n```\r\nyes? list a[y=@ngd]\r\n             VARIABLE : {1,2,3,4}\r\n             SUBSET   : 4 points (X)\r\n 1   / 1:  1.000\r\n 2   / 2:  2.000\r\n 3   / 3:  3.000\r\n 4   / 4:  4.000\r\n```\r\n\r\nThis ought to either return all 1's, or give an error saying that such \"normal\" transformations are disallowed.\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/NOAA-PMEL/Ferret/issues/comments/389252892","html_url":"https://github.com/NOAA-PMEL/Ferret/issues/1868#issuecomment-389252892","issue_url":"https://api.github.com/repos/NOAA-PMEL/Ferret/issues/1868","id":389252892,"user":{"login":"AnsleyManke","id":5122690,"avatar_url":"https://avatars2.githubusercontent.com/u/5122690?v=4","gravatar_id":"","url":"https://api.github.com/users/AnsleyManke","html_url":"https://github.com/AnsleyManke","followers_url":"https://api.github.com/users/AnsleyManke/followers","following_url":"https://api.github.com/users/AnsleyManke/following{/other_user}","gists_url":"https://api.github.com/users/AnsleyManke/gists{/gist_id}","starred_url":"https://api.github.com/users/AnsleyManke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnsleyManke/subscriptions","organizations_url":"https://api.github.com/users/AnsleyManke/orgs","repos_url":"https://api.github.com/users/AnsleyManke/repos","events_url":"https://api.github.com/users/AnsleyManke/events{/privacy}","received_events_url":"https://api.github.com/users/AnsleyManke/received_events","type":"User","site_admin":false},"created_at":"2018-05-15T17:42:48Z","updated_at":"2018-05-15T17:42:48Z","author_association":"CONTRIBUTOR","body":"I've implemented all of the regridding to the same axis operations listed above. \r\n\r\nLeaving this open, as the rest of the comment about regular regridding operations isn't yet addressed."}}
{"actor":{"display_login":"AnsleyManke"}}