{"action":"created","issue":{"url":"https://api.github.com/repos/NOAA-PMEL/Ferret/issues/689","repository_url":"https://api.github.com/repos/NOAA-PMEL/Ferret","labels_url":"https://api.github.com/repos/NOAA-PMEL/Ferret/issues/689/labels{/name}","comments_url":"https://api.github.com/repos/NOAA-PMEL/Ferret/issues/689/comments","events_url":"https://api.github.com/repos/NOAA-PMEL/Ferret/issues/689/events","html_url":"https://github.com/NOAA-PMEL/Ferret/issues/689","id":276252989,"number":689,"title":"scat2grid functions and modulo longitude axes","user":{"login":"karlmsmith","id":16406727,"avatar_url":"https://avatars0.githubusercontent.com/u/16406727?v=4","gravatar_id":"","url":"https://api.github.com/users/karlmsmith","html_url":"https://github.com/karlmsmith","followers_url":"https://api.github.com/users/karlmsmith/followers","following_url":"https://api.github.com/users/karlmsmith/following{/other_user}","gists_url":"https://api.github.com/users/karlmsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/karlmsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlmsmith/subscriptions","organizations_url":"https://api.github.com/users/karlmsmith/orgs","repos_url":"https://api.github.com/users/karlmsmith/repos","events_url":"https://api.github.com/users/karlmsmith/events{/privacy}","received_events_url":"https://api.github.com/users/karlmsmith/received_events","type":"User","site_admin":false},"labels":[{"id":323826821,"url":"https://api.github.com/repos/NOAA-PMEL/Ferret/labels/bug","name":"bug","color":"fc2929","default":true},{"id":757390769,"url":"https://api.github.com/repos/NOAA-PMEL/Ferret/labels/P:%20high","name":"P: high","color":"f9d0c4","default":false},{"id":758304202,"url":"https://api.github.com/repos/NOAA-PMEL/Ferret/labels/S:%20normal","name":"S: normal","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-23T02:38:07Z","updated_at":"2017-11-23T02:38:07Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"**Reported by Ansley B Manke on 10 May 2006 21:52 UTC**\nReported by Lev Tarasoff 5/10/2006: scat2gridlaplace_xy where we have scattered\ndata that crosses the prime meridian, result longitude axis is modulo.  If the\nscattered X points do not lie within the actual coordinates on the longitude\naxis, then the results are shifted.\n\nExample:\nlet xlnb =\n{-4.06,-5.07,-3.77,-3.02,0.83,0.31,1.02,0.33,-1.35,-2.54,-3.75,-5.48,-5.25,2.98,3.50,36.15,29.40,19.45,19.00}\nlet ylt =\n{52.47,51.66,51.58,51.35,51.70,51.46,51.07,50.84,50.80,50.62,50.39,50.13,56.07,55.02,52.50,69.10,70.09,70.15,69.80}\nlet wgt =\n{0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.03,0.02,0.00,1.34,1.17,0.22,0.49}\n\n\ndef axis/x=12.5w:119.5e/npoints=133/units=deg/modulo xlonef \ndef axis/y=47.25N:83.25n/npoitns=73/units=deg ylatef\n\nlet xln = if xlnb lt 0. then xlnb+360. else xlnb\nLET wgtl = scat2gridlaplace_xy(xln,ylt, wgt, x[y[gy=ylatef](gx=xlonef],), 2., 1)\n\nshade wgtl  ! Result is shifted in X:\n            ! data shows up at 70e that should be at 35e\n\n! Compare the range of the x points and the x coordinates of the result\nyes? stat x[\n! ...\n!  Minimum value: 347.5\n!  Maximum value: 479.5\n! ...\n\nyes? stat xlnb\n! ...\n!  Minimum value: -5.48\n!  Maximum value: 36.15\n! ...\n\n\n! SO, if we redefine xln to lie within the coordinate range of the longitude\n! axis, then\n\nlet xln = xlnb+360.\nLET wgtl = scat2gridlaplace_xy(xln,ylt, wgt, x[gx=xlonef](gx=xlonef]), y[gy=ylatef], 2., 1)\n\nshade wgtl  ! This result is correct.\n\nThe function could check, and if the result axis is a modulo longitude axis, it\ncould replace the scattered X values it uses in the regridding with\nmodulo-shifted values that lie within the coordinate axis range.\n\nMigrated-From: http://dunkel.pmel.noaa.gov/trac/ferret/ticket/1412"},"comment":{"url":"https://api.github.com/repos/NOAA-PMEL/Ferret/issues/comments/346520815","html_url":"https://github.com/NOAA-PMEL/Ferret/issues/689#issuecomment-346520815","issue_url":"https://api.github.com/repos/NOAA-PMEL/Ferret/issues/689","id":346520815,"user":{"login":"karlmsmith","id":16406727,"avatar_url":"https://avatars0.githubusercontent.com/u/16406727?v=4","gravatar_id":"","url":"https://api.github.com/users/karlmsmith","html_url":"https://github.com/karlmsmith","followers_url":"https://api.github.com/users/karlmsmith/followers","following_url":"https://api.github.com/users/karlmsmith/following{/other_user}","gists_url":"https://api.github.com/users/karlmsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/karlmsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlmsmith/subscriptions","organizations_url":"https://api.github.com/users/karlmsmith/orgs","repos_url":"https://api.github.com/users/karlmsmith/repos","events_url":"https://api.github.com/users/karlmsmith/events{/privacy}","received_events_url":"https://api.github.com/users/karlmsmith/received_events","type":"User","site_admin":false},"created_at":"2017-11-23T02:38:07Z","updated_at":"2017-11-23T02:38:07Z","author_association":"CONTRIBUTOR","body":"**Comment by karl.smith on 27 Apr 2012 18:49 UTC**\nThis was due to incorrect calculation of the modulo for the X axis.  The versions of the scat2gridlaplace and scat2gridgauss functions in the ferret6d branch now uses the new function ef_get_axis_modulo_len to get the modulo length from Ferret's common blocks.\r\n\r\nUsing ferret from the 6D branch, the two graphs from the script are identical.  Added bn_scat2gridlaplace_tarasoff.jnl to bench and called it from bn_internal_external_functions.jnl to test for this error."}}
{"actor":{"display_login":"karlmsmith"}}