Re: Another cartesian to spherical question [message #64390] |
Mon, 22 December 2008 08:31 |
workmanj1
Messages: 5 Registered: December 2008
|
Junior Member |
|
|
On Dec 22, 9:23 am, "ben.bighair" <ben.bigh...@gmail.com> wrote:
> On Dec 22, 10:55 am, workma...@gmail.com wrote:
>
>> On Dec 22, 8:29 am, workma...@gmail.com wrote:
>
>>> OK, maybe simpler. If I have 3 arrays, one of lat coordinates, one of
>>> lon coordinates, and one with the corresponding value at that point.
>>> I want to pick some dlat,dlon and bin all the values in that region.
>
>>> Next I want to project it onto a 2-d spherical grid for use with map
>>> projections.
>
>>> Any ideas?
>
>> EDIT- the built in hist_2d will bin by lon,lat but won't take the f
>> (lon,lat) and bin that by lon,lat. Are there routines where you can
>> bin the value at a point by it's 2-d coordinates?
>
> Hi,
>
> I think you want to use JD Smith's HIST_ND (seehttp://www.dfanning.com/programs/hist_nd.pro)
> which will provide you with all you could ever need to perform slick
> binning tricks.
>
> I am not sure how you would convert that 3D binned array to an image
> to project onto 2d map. Do you want the sum or mean of the f(lon,lat)
> values in each bin? In that case you could bin the lon-lat pairs and
> then use REVERSE_INDICES to collect all of the f(lon,lat) values in
> each bin.
>
> CHeers,
> Ben
Thanks,
I think I figured out how to do a 2d histogram weighted by f
(lon,lat). What I'm trying to do is bin the sum, not mean. So if I
have a lon lat cell from [[-45.5,-44.5],[-.5,.5]] with 5 elements each
equaling 1 then I'd want the value in that bin to be 5. If you want
the specifics of what I need to do it is one page back under cartesian
to spherical coordinates. This is the last data analysis routine I
need to get straight before I start simply submitting my final project
to ques and finishing my doctorate.
Thanks,
Jared
|
|
|
Re: Another cartesian to spherical question [message #64391 is a reply to message #64390] |
Mon, 22 December 2008 08:28  |
workmanj1
Messages: 5 Registered: December 2008
|
Junior Member |
|
|
On Dec 22, 9:18 am, Maarten <maarten.sn...@knmi.nl> wrote:
> On Dec 22, 8:29 am, workma...@gmail.com wrote:
>
>
>
>> OK, maybe simpler. If I have 3 arrays, one of lat coordinates, one of
>> lon coordinates, and one with the corresponding value at that point.
>> I want to pick some dlat,dlon and bin all the values in that region.
>
>> Next I want to project it onto a 2-d spherical grid for use with map
>> projections.
>
> The drizzle, decimate etc. discussion [1] at David's site has details
> about this problem. I've used code from that discussion in CAMA to
> solve the problem you describe, see the file
> regrid_swaths_to_lat_lon.pro in [2]
>
> [1]http://www.dfanning.com/code_tips/drizzling.html
> [2]http://www.knmi.nl/omi/research/validation/cama/
>
> Best,
>
> Maarten
Thanks, I'm taking a look now.
|
|
|
Re: Another cartesian to spherical question [message #64392 is a reply to message #64391] |
Mon, 22 December 2008 08:23  |
ben.bighair
Messages: 221 Registered: April 2007
|
Senior Member |
|
|
On Dec 22, 10:55 am, workma...@gmail.com wrote:
> On Dec 22, 8:29 am, workma...@gmail.com wrote:
>
>> OK, maybe simpler. If I have 3 arrays, one of lat coordinates, one of
>> lon coordinates, and one with the corresponding value at that point.
>> I want to pick some dlat,dlon and bin all the values in that region.
>
>> Next I want to project it onto a 2-d spherical grid for use with map
>> projections.
>
>> Any ideas?
>
> EDIT- the built in hist_2d will bin by lon,lat but won't take the f
> (lon,lat) and bin that by lon,lat. Are there routines where you can
> bin the value at a point by it's 2-d coordinates?
Hi,
I think you want to use JD Smith's HIST_ND (see http://www.dfanning.com/programs/hist_nd.pro)
which will provide you with all you could ever need to perform slick
binning tricks.
I am not sure how you would convert that 3D binned array to an image
to project onto 2d map. Do you want the sum or mean of the f(lon,lat)
values in each bin? In that case you could bin the lon-lat pairs and
then use REVERSE_INDICES to collect all of the f(lon,lat) values in
each bin.
CHeers,
Ben
|
|
|
Re: Another cartesian to spherical question [message #64393 is a reply to message #64392] |
Mon, 22 December 2008 08:18  |
Maarten[1]
Messages: 176 Registered: November 2005
|
Senior Member |
|
|
On Dec 22, 8:29 am, workma...@gmail.com wrote:
>
> OK, maybe simpler. If I have 3 arrays, one of lat coordinates, one of
> lon coordinates, and one with the corresponding value at that point.
> I want to pick some dlat,dlon and bin all the values in that region.
>
> Next I want to project it onto a 2-d spherical grid for use with map
> projections.
The drizzle, decimate etc. discussion [1] at David's site has details
about this problem. I've used code from that discussion in CAMA to
solve the problem you describe, see the file
regrid_swaths_to_lat_lon.pro in [2]
[1] http://www.dfanning.com/code_tips/drizzling.html
[2] http://www.knmi.nl/omi/research/validation/cama/
Best,
Maarten
|
|
|
Re: Another cartesian to spherical question [message #64394 is a reply to message #64393] |
Mon, 22 December 2008 07:55  |
workmanj1
Messages: 5 Registered: December 2008
|
Junior Member |
|
|
On Dec 22, 8:29 am, workma...@gmail.com wrote:
> OK, maybe simpler. If I have 3 arrays, one of lat coordinates, one of
> lon coordinates, and one with the corresponding value at that point.
> I want to pick some dlat,dlon and bin all the values in that region.
>
> Next I want to project it onto a 2-d spherical grid for use with map
> projections.
>
> Any ideas?
EDIT- the built in hist_2d will bin by lon,lat but won't take the f
(lon,lat) and bin that by lon,lat. Are there routines where you can
bin the value at a point by it's 2-d coordinates?
|
|
|