-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert hyperspectral exposure image to reflectance #88
Comments
@ashiklom added some comments to the documentation https://terraref.gitbooks.io/terraref-documentation/content/hyperspectral_data.html but the commenting system doesn't work well so I am pasting them here:
indeed, this appears to be the case here. Not to be confused with the fact that we are using an x,y coordinate system with units of meters east and north of the SW corner of the gantry (see terraref/documentation#7 and terraref/documentation#9).
|
Good questions. x and y are currently pixels. when the transformation is available from pixel to geographic horizontal dimension we may change from x,y to lat,lon or some other system like the gantry x,y. White reference in theory only has a wavelength dimension but in practice the one snapshot (called whiteReference) I know of is dimensioned wavelength by x. it's as if the camera scanned only one line. Currently "wavelength" is the wavelength associated with each channel in the .bil image file. Would welcome higher resolution SRFs and/or bandpasses. |
Who of you is expert in hyperspectral analysis? My current idea is to do the dark reference measurement before each scan and have the white target mounted on the gantry, such that one part (~10%) of the image is always "white". |
Glad to know there is a dark reference available too. I can modify the calibration algorithm to account for that. |
My understanding of the headwall VNIR sensor is that the sensor has a grid This slit is rotated in order for the hyperspectral camera to see a whole The meta-data for one of the VNIR data captures on 4/7 has fields:
(although it also says "use rotating mirror": 0). However this particular bit of data was captured, the reason that there is the "y" coordinate relates to either how far the sensor has rotated and On Thu, Apr 28, 2016 at 10:04 AM, Charlie Zender notifications@github.com
|
In Scanning mode the mirror is always at position 0 and does not move. Therefore you have the entry "use rotating mirror":0. |
Danke für die Klarstellung, du hast genau recht, die Start/Stop Einstellungen sind irrrelevant, wenn der Spiegel nicht benutzt wird. |
I think that last comment was meant to be a private email, but I'll translate: Thank you for the clarification. You're exactly right. The start/stop settings are irrelevant if the mirror is not being used. |
@TinoDornbusch or @rjstrand have you been doing hyperspectral calibration / images of the white / dark references? If so, where are these? |
I have not had time to work on the data. I am bringing "home" data and we want to look at them next week. |
Is it in the gantry data stream?
|
Tino on 4/28 you mentioned the need for a Darkreference. My understanding is that this is the exposure (in "counts") measured when the whitereference is covered by a black surface of known (factory-calibrated) reflectance. What about the exposure (in "counts") measured from the whitereflector with no incident light? In other words, is there dark current/noise in the hyperspectral camera similar to the environmental logger? |
Charlie, Dark current are photoelectric events (counts) triggered randomly on the sensor chip without incident radiation. Typically this is sensor-specific and temperature dependent. I see your point trying to estimate dark counts without actual measurements from other sensors. Worth comparing dark refs between sensors. Lets first see a time-course of dark counts during the day. If in regular dark measurements are required, we need to implement a solution in the winter upgrade session. Tino Dr. agr. Tino Dornbusch |
@czender visiting MAC last week, I learned the following:
@TinoDornbusch could you please point to some of the white reflectance measurements that you have taken? And can you clarify the extent to which these sensors will be imaging both sunlit and shaded leaves? |
@dlebauer please look for the MetadataKey in user_given_metadata: "mission or scan": "3d_scan_4m" between 15-30.5.2016 you should find the white target there. |
@czender There has been a cap on the fibreoptics for measurement of dark reference between 6.6.2016 4PM and 7.6.2016 9AM. Please let me know whether you wish more dark measurements during off scan times. Please note that this requires climbing on top of the gantry. |
Latest logger data on Roger is 6/3. I assume the dark logger runs will show-up in 3-4 days, and we will look then... |
|
@czender -where are we with this? Are you waiting for feedback from someone? |
Yes, with regards to (1) I would like to know when/whether we have images of the spectralon for both imagers. |
@smarshall-bmr is running the scans, he might know if all the "3d_scan_4m" scan/missions have spectralon in the image. |
Here is the raw files from white spectralon reference. Measurement has been done for the following exposure times 20, 25, 30, 25, 40, 25, 50, 55 ms. https://drive.google.com/file/d/0ByXIACImwxA7akhfLTdTS01vTTA/view?usp=sharing Exposure time is included in the folder name. Also, in the file named "settings.txt" you can check the exposure time as well. In the following file, I stored an extra file named "CorrectedWhite_raw". This file includes only a single white pixel( one line, one sample) in 955 bands for each exposure time. Data is stored in the similar format but it doesnot include any extra files like frameIndex, image, header ,.. https://drive.google.com/file/d/0ByXIACImwxA7dVNHa3pTYkFjdWc/view?usp=sharing Let me know if you have issue with opening the files. |
@czender could you work with @solmazhajmohammadi and @craig-willis to make sure that these files are moved to an appropriate place (Roger / Clowder ) where they are available to the hyperspectral workflow and documented? |
@czender White reference data doesn’t have JSON file. |
@craig-willis @solmazhajmohammadi Here is the script I used to process the HS white and dark reference values
|
The above script reduces the ~10 GB raw image files to a series of area-averaged white and dark reference data that we actually use in the HS workflow. xps_tm is the exposure time in ms. The minimal files to retain are these 17 kb files: vnir_wht_avg_${xps_tm}.nc the img files are essentially the same ~10 GB as the raw files. the cut files are each ~50 MB and contain only the portion of the image that contains the target. These files are averaged to produce the avg values used in the calibration. Keep as much of this as @dlebauer and @solmazhajmohammadi would like for provenance reasons. |
Thanks for the script details. I'm just now reading through this full thread and have a few questions/clarifications.
|
@craig-willis yes sure it makes sense to collect them separately for now. |
I'm planning to store the area-averaged files in the hyperspectral workflow script directory, i.e., the same directory as hyperspectral_workflow.sh, so they can easily be found and modified until they are stable. It would be good to have a location not in the scripts directory for the other files. |
@yanliu-chn please update the NCO build/module on roger to 4.6.2-beta03 which contains some new features helpful to the hyperspectral calibration. Thank you. |
Done. set default to 4.6.2-beta03. To use: $ module purge
$ module load gdal-stack-2.7.10 nco
$ echo $NCO_HOME
/sw/nco-4.6.2-beta03 |
@max-zilla or @yanliu-chn @craig-willis |
Please find the white spectralon measurement using SWIR camera here: https://drive.google.com/drive/folders/0B9h5V5JdLLXmRHZJN0d1VXJLNVE?usp=sharing Each folder contains one line of dark reference measurement. The raw file is the scan of spectralon target and 8 calibrated color targets on the top of the spectralon target, please choose your region of interest only from white target. |
I'll defer this until the camera is repaired and someone affirms that the SWIR spectralon measurements apply to the repaired camera. - terraref/reference-data#50 |
Just updated the extractor for NCO 4.6.2-beta03 FYI. |
Saw the issue. Thanks! This is consistent with the ROGER nco deployment. Charlie has now pushed a few new releases, let’s update when the next official version comes out. Thanks! -Yan
|
This is a draft algorithm to retrieve spectral reflectance based on my understanding of the (possibly soon-to-be) available inputs. Suggestions and correction welcome (the more specific, the better). For simplicity, the algorithm description currently omits the time dimension. It is implicit in all quantities below except rfl_wht.
NOTE: proposal below has been migrated to documentation which supports Latex for ease of reading.
https://terraref.gitbooks.io/terraref-documentation/content/hyperspectral_data.html But the commenting isn't that great,
So please comment below on this issue, or propose changes to the algorithm text as a pull request: https://github.com/terraref/documentation/blob/master/hyperspectral_data.md
Inputs and Outputs
syntax:
Variable(dimensions) [units]
$$$
% Someone please make LaTeX typeset this...
I_p(\lambda,y,x) = F_{\lambda}(\lambda) R_p(\lambda) C(\lambda)
$$$
Inputs: Required known or measured inputs:**
uint16 xps_img(wavelength,y,x) [xps] =
Exposure from experiment image (i.e., plants) (known, VNIR, SWIR sensors)uint16 xps_wht(wavelength,x) [xps] =
Exposure from white reference sheet/panel (measured by VNIR, SWIR sampling period? location?)float32 rfl_wht(wavelength) [fraction] =
Reflectance of white reference (factory calibration) (assume time-constant?)float32 flx_dwn(wavelength) [W m-2 um-1] =
Downwelling spectral irradiance (measured by environmental sensor. units?)Intermediate derived quantities:
float32 cst_cnv(wavelength) [xps/(W m-2 um-1)] =
Proportionality constant between reflected spectral flux and Exposure (derived)float32 flx_upw(wavelength) [W m-2 um-1] =
Upwelling spectral flux (derived. and possibly measured for closure?)Outputs
float32 rfl_img(wavelength,y,x) [fraction] =
Reflectance of image (i.e., plants)Proposed Algorithm to retrieve reflectance from measurements:
xps_wht=flx_dwn*rfl_wht*cst_cnv
cst_cnv=xps_wht/(flx_dwn*rfl_wht)
xps_img=flx_dwn*rfl_img*cst_cnv
rfl_img=xps_img/(flx_dwn*cst_cnv)
flx_upw=flx_dwn*rfl_img
Before implementing this, I would like feedback and/or sign-off by @dlebauer @nfahlgren @max-zilla @pless @solmazhajmohammadi and @LTBen.
Next steps
More assumptions, input measurements, and/or more sophisticated algorithms would incorporate these additional sources of information:
Notes
The text was updated successfully, but these errors were encountered: