Re: avhrr data extraction [message #80408] |
Mon, 04 June 2012 16:31 |
anil
Messages: 34 Registered: August 2009
|
Member |
|
|
On Jun 5, 1:50 am, Matt <sav...@nsidc.org> wrote:
> On Monday, June 4, 2012 2:02:56 PM UTC-6, anil wrote:
>> On Jun 4, 5:33 pm, Matt <sav...@nsidc.org> wrote:
>>> Hi Anil,
>
>>> I think what you want is to just grab the SST data
>>> bsloni=loni[4715:5057]
>>> bslati=lati[1006:1142]
>>> bsst = sst[4715:5057, 1006:1142]
>
>>> That looks like Australia to me. That what you were expecting?
>
> Well, I didn't look hard, and I wasn't sure the projection, and I apparently don't know Black Sea from Australia.
>
> In any event, this is how you access the data you are interested in. If you want to output to a text file, you'll have to loop over the data
>
> for lon_idx = 0, n_elements( bsloni ) - 1 do begin
> for lat_idx = 0, n_elements( bslati ) - 1 do begin
>
> print, bsloni[ lon_idx ], bslati[ lat_idx ], bsst[ lon_idx, lat_idx ]
>
> endfor
> endfor
>
> I think that should be what you're looking for. (check the documentation for formatting and writing to files.)
>
>
>
>
>
>
>
>> write this to another file. lets say 'abc.txt' . For which I want to
>> end up with:
>> lon1 lat1 sst1
>> lon2 lat2 sst2 and so on...
Exactly the answer I was looking for. Thanks a lot.
|
|
|
Re: avhrr data extraction [message #80409 is a reply to message #80408] |
Mon, 04 June 2012 15:50  |
Matt[2]
Messages: 69 Registered: March 2007
|
Member |
|
|
On Monday, June 4, 2012 2:02:56 PM UTC-6, anil wrote:
> On Jun 4, 5:33 pm, Matt <sav...@nsidc.org> wrote:
>> Hi Anil,
>>
>> I think what you want is to just grab the SST data
>> bsloni=loni[4715:5057]
>> bslati=lati[1006:1142]
>> bsst = sst[4715:5057, 1006:1142]
>>
>> That looks like Australia to me. That what you were expecting?
Well, I didn't look hard, and I wasn't sure the projection, and I apparently don't know Black Sea from Australia.
In any event, this is how you access the data you are interested in. If you want to output to a text file, you'll have to loop over the data
for lon_idx = 0, n_elements( bsloni ) - 1 do begin
for lat_idx = 0, n_elements( bslati ) - 1 do begin
print, bsloni[ lon_idx ], bslati[ lat_idx ], bsst[ lon_idx, lat_idx ]
endfor
endfor
I think that should be what you're looking for. (check the documentation for formatting and writing to files.)
> write this to another file. lets say 'abc.txt' . For which I want to
> end up with:
> lon1 lat1 sst1
> lon2 lat2 sst2 and so on...
|
|
|
Re: avhrr data extraction [message #80412 is a reply to message #80409] |
Mon, 04 June 2012 13:02  |
anil
Messages: 34 Registered: August 2009
|
Member |
|
|
On Jun 4, 5:33 pm, Matt <sav...@nsidc.org> wrote:
> Hi Anil,
>
> I think what you want is to just grab the SST data
> bsloni=loni[4715:5057]
> bslati=lati[1006:1142]
> bsst = sst[4715:5057, 1006:1142]
>
> That looks like Australia to me. That what you were expecting?
>
> Hope that helps.
>
> Matt
>
> On Jun 4, 6:46 am, anil <akpinar.a...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
>> Hi,
>> I have downloaded some daily ,04km, night time sea surface temperature
>> data from avhrr. an example:ftp://podaac-ftp.jpl.nasa.gov/allData/avhrr/L3/pathf inder_v5/daily/ni...
>
>> I want to read these data and extract the values for a region (defined
>> latitudes and longitudes). To read the data , I use:
>
>> file=hdf_sd_start('2002252.s04d1pfv50-sst.hdf')
>> indexa=hdf_sd_nametoindex(file,'lon')
>> indexb=hdf_sd_nametoindex(file,'lat')
>> indexc=hdf_sd_nametoindex(file,'sst')
>> varida=hdf_sd_select(file,indexa)
>> varidb=hdf_sd_select(file,indexb)
>> varidc=hdf_sd_select(file,indexc)
>> hdf_sd_getdata,varida,loni
>> hdf_sd_getdata,varidb,lati
>> hdf_sd_getdata,varidc,ssti
>> hdf_sd_endaccess,varida
>> hdf_sd_endaccess,varidb
>> hdf_sd_endaccess,varidc
>> hdf_sd_end,file
>
>> ;bsloni=loni(4715:5057)
>> ;bslati=lati(1006:1142)
>> end
>> I want to extract the latitudes (1006 to 1142) and longitudes (4715 to
>> 5057) and the corresponding sea surface temperatures (sst's) .At the
>> end I need to end up with something like:
>> 40.75 36.74 sst1
>> 40.75 36.88 sst2
>> 40.82 37.12 sst3
>> ............................... and so on. How can i do this? Defining
>> a bsloni and bslati gives me the latitudes and longitudes but how do i
>> get the corresponding sst's? With some kind of a where function? or a
>> few for loops?or some other way?
>
> --
> Matthew Savoie - Senior Software Developer
> National Snow and Ice Data Center
> (303) 735-0785 http://nsidc.org
Hi Matt,
Yes, I want to grab the coordinates I want and the corresponding
sst's. Maybe I wrote something wrong. But it is the Black Sea region
actually, Eastern Europe. when I print the longitudes 4715:5057, I
get the coordinates between , 27.22*** up to 42.25*** and for the
latitudes 1006:1142 , I get, 45.77***** to 39.79*****. Which is the
region I want. I just could not get the corresponding sst and actually
write this to another file. lets say 'abc.txt' . For which I want to
end up with:
lon1 lat1 sst1
lon2 lat2 sst2 and so on...
|
|
|
Re: avhrr data extraction [message #80418 is a reply to message #80412] |
Mon, 04 June 2012 07:33  |
Matt[2]
Messages: 69 Registered: March 2007
|
Member |
|
|
Hi Anil,
I think what you want is to just grab the SST data
bsloni=loni[4715:5057]
bslati=lati[1006:1142]
bsst = sst[4715:5057, 1006:1142]
That looks like Australia to me. That what you were expecting?
Hope that helps.
Matt
On Jun 4, 6:46 am, anil <akpinar.a...@gmail.com> wrote:
> Hi,
> I have downloaded some daily ,04km, night time sea surface temperature
> data from avhrr. an example:ftp://podaac-ftp.jpl.nasa.gov/allData/avhrr/L3/pathf inder_v5/daily/ni...
>
> I want to read these data and extract the values for a region (defined
> latitudes and longitudes). To read the data , I use:
>
> file=hdf_sd_start('2002252.s04d1pfv50-sst.hdf')
> indexa=hdf_sd_nametoindex(file,'lon')
> indexb=hdf_sd_nametoindex(file,'lat')
> indexc=hdf_sd_nametoindex(file,'sst')
> varida=hdf_sd_select(file,indexa)
> varidb=hdf_sd_select(file,indexb)
> varidc=hdf_sd_select(file,indexc)
> hdf_sd_getdata,varida,loni
> hdf_sd_getdata,varidb,lati
> hdf_sd_getdata,varidc,ssti
> hdf_sd_endaccess,varida
> hdf_sd_endaccess,varidb
> hdf_sd_endaccess,varidc
> hdf_sd_end,file
>
> ;bsloni=loni(4715:5057)
> ;bslati=lati(1006:1142)
> end
> I want to extract the latitudes (1006 to 1142) and longitudes (4715 to
> 5057) and the corresponding sea surface temperatures (sst's) .At the
> end I need to end up with something like:
> 40.75 36.74 sst1
> 40.75 36.88 sst2
> 40.82 37.12 sst3
> ............................... and so on. How can i do this? Defining
> a bsloni and bslati gives me the latitudes and longitudes but how do i
> get the corresponding sst's? With some kind of a where function? or a
> few for loops?or some other way?
--
Matthew Savoie - Senior Software Developer
National Snow and Ice Data Center
(303) 735-0785 http://nsidc.org
|
|
|