meireles / spectrolab

Dealing with spectral data in R
16 stars 11 forks source link

read_spectra(): raw DN or radiance from .sig #3

Closed elaliberte closed 3 years ago

elaliberte commented 6 years ago

My understanding is that it's not currently possible to extract the raw DN or radiance data (instead of reflectance) from SVC's .sig files using your package. Is this correct? If so, will you implement this? Thanks.

meireles commented 6 years ago

@elaliberte That's correct. There are a quite a few changes coming along, including a new and more flexible parser. You'd be able to read the radiance data and all of the other metadata (coords, date, sensor temps, etc.). The implementation is straightforward. The tricky part is ensuring that our API stays sensible and general enough to deal with other instruments too.

meireles commented 6 years ago

@elaliberte Just wondering if you'd need the radiance for both the target and white reference.

elaliberte commented 6 years ago

@meireles for our application, just the target would work because we save the WR as a target itself in a separate file, but I imagine many users (including us at some point) would require both.

meireles commented 6 years ago

@elaliberte, I still have to talk to other folks about dealing with radiance in spectrolab. Doing it right will probably require us to make a few changes to the spectra class and to our API. I'm excited to improve the package, but the new changes may break current code. I'd advise you to proceed with caution and to avoid building a huge infrastructure based on spectrolab before the API is finalized.

With that said, I have created a temporary branch of the current repository that reads radiance data. You can install that version as show below.

library("devtools")
install_github("meireles/spectrolab", ref = "etienne_temp")

You should be able to pick between reading the target reflectance, target radiance or white reference radiance data by passing the appropriate type argument. Options are "target_refl", "target_rad", and "reference_rad" and they are matched excactly.

s = read_spectra("PATH_TO_SVC_FILES_HERE", format = "sig", type = "target_rad")

Let me know if this works for you guys.