Skip to content
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

New data reduction procedure for Spectralon calibration imagery #289

Open
2 of 8 tasks
czender opened this issue Mar 9, 2017 · 15 comments
Open
2 of 8 tasks

New data reduction procedure for Spectralon calibration imagery #289

czender opened this issue Mar 9, 2017 · 15 comments
Assignees
Labels
sensor/hyperspectral issues relating to VNIR and SWIR scanners

Comments

@czender
Copy link
Contributor

czender commented Mar 9, 2017

Description

The new hyperspectral imagery calibration procedure (#281) uses dedicated calibration imagery of Spectralon reflectors taken at multiple zenith angles (and possibly one day under both clear and overcast skies). This necessitates changes to the current reduction procedure, and subsequent use of, the Spectralon reflectance imagery.

Completion Criteria

  • Hyperspectral Calibration #208 Take Spectralon calibration imagery on clear sky day
  • Hyperspectral Calibration #208 Take Spectralon calibration imagery on cloudy sky day
  • Convert new spectralon calibration images to netCDF
  • Visually inspect then hyperslab images to contain only spectralon panels
  • Detect any systematic spatial, spectral, or angular biases in spectralon images
  • Reduce (i.e., average) imagery to minimal rank/size that preserves systematic features
  • Compute zenith angle for each image time (necessary for xps_wht not xps_drk)
  • Annotate reduced images with zenith angles, store in HS extractor directory
@smarshall-bmr
Copy link
Collaborator

The VNIR is currently completely out of service. A recent software update to implement x-axis scanning broke the data writing, LemnaTec is working on it now. I have the script ready for the calibration run so I'm hoping it can happen soon.

@max-zilla
Copy link
Contributor

@smarshall-bmr is VNIR back up and running?

@ghost
Copy link

ghost commented Mar 30, 2017

Now up and running in predawn mode for calibration

@smarshall-bmr
Copy link
Collaborator

VNIR is writing data again. We are working on fixing this 10,000 line scan limit right now, calibration is up next on my priority list.

@czender
Copy link
Contributor Author

czender commented Apr 20, 2017

@solmazhajmohammadi @dlebauer The recent calibration images brought to my attention that the SWIR naming convention has diverged from the VNIR. SWIR files now have an extra date string (right after the UUID) in their names, and also are missing an underscore before the english suffix. Was there a good reason for changing the naming convention? It would be helpful if SWIR used the same convention as VNIR. Otherwise we need to re-write the extractors to handle both conventions and be backwards compatible, etc.

zender@cg-gpu01:~/nco$ ls -l /projects/arpae/terraref/sites/ua-mac/raw_data/SWIR/2017-04-15/2017-04-15__11-59-12-426
total 481696
-rw-r--r-- 1 dlebauer grp_202     55123 Apr 15 12:03 f130c910-7887-49b0-97bb-db49e8c85e63_2017_04_15_12_05_11frameIndex.txt
-rw-r--r-- 1 dlebauer grp_202     27533 Apr 15 12:03 f130c910-7887-49b0-97bb-db49e8c85e63_2017_04_15_12_05_11image.jpg
-rw-r--r-- 1 dlebauer grp_202 493129728 Apr 15 12:03 f130c910-7887-49b0-97bb-db49e8c85e63_2017_04_15_12_05_11raw
-rw-r--r-- 1 dlebauer grp_202      3503 Apr 15 12:03 f130c910-7887-49b0-97bb-db49e8c85e63_2017_04_15_12_05_11raw.hdr
-rw-r--r-- 1 dlebauer grp_202       869 Apr 15 12:03 f130c910-7887-49b0-97bb-db49e8c85e63_2017_04_15_12_05_11settings.txt
-rw-r--r-- 1 dlebauer grp_202      3561 Apr 15 12:03 f130c910-7887-49b0-97bb-db49e8c85e63_metadata.json

~6 minute discrepancy between SWIR directory and filename stub:
zender@cg-gpu01:~/nco$ ls -l /projects/arpae/terraref/sites/ua-mac/raw_data/VNIR/2017-04-15/2017-04-15__11-56-59-902/
total 5204960
-rw-r--r-- 1 dlebauer grp_202      40591 Apr 15 12:00 ca045a19-7b12-4627-b700-9f51f5829b64_frameIndex.txt
-rw-r--r-- 1 dlebauer grp_202      69299 Apr 15 12:00 ca045a19-7b12-4627-b700-9f51f5829b64_image.jpg
-rw-r--r-- 1 dlebauer grp_202       3605 Apr 15 12:00 ca045a19-7b12-4627-b700-9f51f5829b64_metadata.json
-rw-r--r-- 1 dlebauer grp_202 5329664000 Apr 15 12:02 ca045a19-7b12-4627-b700-9f51f5829b64_raw
-rw-r--r-- 1 dlebauer grp_202      10257 Apr 15 12:01 ca045a19-7b12-4627-b700-9f51f5829b64_raw.hdr
-rw-r--r-- 1 dlebauer grp_202        872 Apr 15 12:02 ca045a19-7b12-4627-b700-9f51f5829b64_settings.txt

@czender
Copy link
Contributor Author

czender commented Apr 24, 2017

IMHO the best way to proceed here is to remove the extra date string recently introduced into (some of) the SWIR filenames, i.e., "2017_04_15_12_05_11" in the above example, in all but the metadata.json file. That way the VNIR and SWIR will have the same naming convention. Otherwise we need to re-write the filename handling in the SWIR workflow to handle both conventions. @dlebauer should we wait for a sysadmin to change the names or start to re-write the SWIR filename handling and accept both old and new conventions?

@dlebauer
Copy link
Member

dlebauer commented Apr 24, 2017 via email

@czender
Copy link
Contributor Author

czender commented Apr 26, 2017

This should work for a sufficiently priveleged user:

yyyymmdd='2017-04-15'
drc_top="/projects/arpae/terraref/sites/ua-mac/raw_data/SWIR/${yyyymmdd}"
cd ${drc_top}
for drc_sub in `ls -d ${yyyymmdd}*` ; do
   echo "Renaming in directory ${drc_sub}..."
   cd ${drc_top}/${drc_sub}
   for fl in `ls *raw` ; do
       dt_sng=`expr match "${fl}" '.*\([0-9][0-9][0-9][0-9]_[0-9][0-9]_[0-9][0-9]_[0-9][0-9]_[0-9][0-9]_[0-9][0-9]\)\.*'`
       uuid_sng=${fl:0:36}
   done # !fl
   echo "uuid=${uuid_sng}, dt=${dt_sng}"
   for sfx in frameIndex.txt image.jpg raw raw.hdr settings.txt ; do
      mv_cmd="/bin/mv ${uuid_sng}_${dt_sng}${sfx} ${uuid_sng}_${sfx}"
      echo "/bin/mv ${uuid_sng}_${dt_sng}${sfx} ${uuid_sng}_${sfx}"
      eval ${mv_cmd}
   done # !sfx
done # !drc_sub

As shown it just does the calibration day. However, all SWIR data since 2016-11-08 appear to use this new convention. @solmazhajmohammadi @LTBen is there a reason for the new convention? If not will Lemnatec please revert to the original (and current VNIR) convention? I do not understand how the hyperspectral extractor ever worked on SWIR files since 2016-11-08. AFAICT it should have reported an error. @max-zilla, I gather that the SWIR extractor was not run this whole time? I hope if it was run that it failed and gave a reasonable error message...

Running the above will suffice to unblock progress on calibration. To rename every SWIR file since 2016-11-08, auto-generate the dates with ls -d 2016-11-0[89] 2016-11-[123]? 2016-12-?? 2017-??-?? from /projects/arpae/terraref/sites/ua-mac/raw_data/SWIR and run the above script on each date...

@dlebauer
Copy link
Member

dlebauer commented Apr 27, 2017

@czender I think everything worked. I added looping over dates (/bin/ls to override alias)

#!/bin/bash

cd /projects/arpae/terraref/sites/ua-mac/raw_data/SWIR/
for d in `/bin/ls -d 2016-11-0[89] 2016-11-[123]? 2016-12-?? 2017-??-??`; do 
    yyyymmdd=$d
    drc_top="/projects/arpae/terraref/sites/ua-mac/raw_data/SWIR/${yyyymmdd}"
    cd ${drc_top}
    for drc_sub in `/bin/ls -d ${yyyymmdd}*` ; do
	echo "Renaming in directory ${drc_sub}..."
	cd ${drc_top}/${drc_sub}
	for fl in `/bin/ls *raw` ; do
	    dt_sng=`expr match "${fl}" '.*\([0-9][0-9][0-9][0-9]_[0-9][0-9]_[0-9][0-9]_[0-9][0-9]_[0-9][0-9]_[0-9][0-9]\)\.*'`
	    uuid_sng=${fl:0:36}
	done # !fl
	echo "uuid=${uuid_sng}, dt=${dt_sng}"
	for sfx in frameIndex.txt image.jpg raw raw.hdr settings.txt ; do
	    mv_cmd="/bin/mv ${uuid_sng}_${dt_sng}${sfx} ${uuid_sng}_${sfx}"
	    echo "/bin/mv ${uuid_sng}_${dt_sng}${sfx} ${uuid_sng}_${sfx}"
	    eval ${mv_cmd}
	done # !sfx
    done # !drc_sub
done # !d

Let me know if it looks okay.

@dlebauer
Copy link
Member

@LTBen and @markus-radermacher-lemnatec can you please confirm that this will be fixed?

@SolmazHajmohammadi-LemnaTec

The reason for different naming lays in different headwall software. LemnaTec software is only adding prefix to the file name.
I am in touch with headwall costumer support to see if it is an easy fix in the software.

@ghost ghost removed the help wanted label Apr 27, 2017
@ghost
Copy link

ghost commented Apr 27, 2017

Next step: @max-zilla will run SWIR extractor this week. April 15 is the priority date. @czender will modify the workflow after that.

@ghost ghost added the sensor/hyperspectral issues relating to VNIR and SWIR scanners label Apr 27, 2017
@solmazhajmohammadi
Copy link

@czender @dlebauer it is fixed now

@max-zilla
Copy link
Contributor

@czender I just pulled the latest hyperspectral code and queued 4/15 for VNIR (first) then SWIR. we'll see how things go over the weekend.

@ghost
Copy link

ghost commented Jul 26, 2017

@max-zilla - please update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sensor/hyperspectral issues relating to VNIR and SWIR scanners
Projects
None yet
Development

No branches or pull requests

9 participants