dankelley / oce

R package for oceanographic processing
http://dankelley.github.io/oce/
GNU General Public License v3.0
144 stars 42 forks source link

Problem obtaining data from Landsat thermal imaging code #639

Closed TamaraGessica closed 9 years ago

TamaraGessica commented 9 years ago

Hello, I'm trying to use the code to convert brightness temperature from Landsat 8 dataset LC82170622015108LGN00. The data was read with the function read.landsat but occurs an error when I try get the data to put in the formula (as shown bellow). I'm using R Studio to do so and I got the data from http://earthexplorer.usgs.gov/. I would appreciate your help with this. Thank you, Tamara.

library ("oce")
setwd("~/RStudio")
l <- read.landsat("LC82170622015108LGN00", band="tirs1")

yields

Warning messages:
1: In tiff::readTIFF(bandfilename) :
  TIFFReadDirectory: Unknown field with tag 33550 (0x830e) encountered
2: In tiff::readTIFF(bandfilename) :
  TIFFReadDirectory: Unknown field with tag 33922 (0x8482) encountered
3: In tiff::readTIFF(bandfilename) :
  TIFFReadDirectory: Unknown field with tag 34735 (0x87af) encountered
4: In tiff::readTIFF(bandfilename) :
  TIFFReadDirectory: Unknown field with tag 34737 (0x87b1) encountered

while

ML <- l@metadata$header$radiance_mult_band_10

yields

Error in l@metadata$header$radiance_mult_band_10 : 
  $ operator is invalid for atomic vectors

and

l@metadata$header

yields

[1] "LC82170622015108LGN00/LC82170622015108LGN00_MTL.txt"
dankelley commented 9 years ago

It would help a lot if you described the system you're using. You definitely want the latest Oce, since the one on CRAN is really quite old. Try doing

sessionInfo()

and pasting the results in a comment.

dankelley commented 9 years ago

Also, it would be helpful if you could give a full URL to the dataset, because (for some reason) I just can't seem to recall how to get an image by a name, as opposed to by a region/time.

TamaraGessica commented 9 years ago

Thank you for the fast answer. This is the link for download: http://edclpdsftp.cr.usgs.gov/LDCMdownload/sno18/ops/l1/2015/217/062/LC82170622015108LGN00.tar.gz?iid=LC82170622015108LGN00&did=117598307&ver=

And here's the results of the sessionInfo() :

 sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)

locale:
[1] LC_COLLATE=Portuguese_Brazil.1252  LC_CTYPE=Portuguese_Brazil.1252   
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C                      
[5] LC_TIME=Portuguese_Brazil.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] tiff_0.1-5     ocedata_0.1.2  oce_0.9-14     mapproj_1.2-2  maps_2.3-9    
[6] devtools_1.7.0

loaded via a namespace (and not attached):
[1] tools_3.2.0
dankelley commented 9 years ago

Hi. You're using an old version of oce. I suggest you update to the most recent version by doing as shown at http://dankelley.github.io/oce/installation.html and try again, posting your results here. Thanks.

dankelley commented 9 years ago

Thanks for the download link. I've put a test script (link here) and it makes a graph as shown below. I imagine the blue means cloud tops. I've no idea what I'm looking at though, so I'll leave it to you to judge whether the results are even partway sensible. Note: the algorithm does not use variable land emissivities, and that can yield several degC of error.

639a

TamaraGessica commented 9 years ago

Thank you very much for the help. I updated the version of oce and it worked.