GeoscienceAustralia / agdc

Repository for Australian Geoscience Data Cube (AGDC) code
BSD 3-Clause "New" or "Revised" License
29 stars 24 forks source link

Time series retrieval error #51

Closed llymburn closed 9 years ago

llymburn commented 9 years ago

This is the command I executed to produce the error

module load agdc-api/0.1.0-b20150512

$ retrieve_pixel_time_series.py --lon 150.2708 --lat -35.6355 --acq-min 1987-01 --acq-max 2014-12 --satellite LS7 LS5 LS8 --dataset-type ARG25 --mask-pqa-apply --mask-pqa-mask PQ_MASK_CLEAR --bands-all --hide-no-data --quiet --output-directory $PWD 2015-05-13 08:56:25,182 ERROR Caught exception invalid literal for int() with base 10: '2014-07-19T23-43-48.vrt' Traceback (most recent call last): File "/projects/el8/opt/modules/agdc-api/0.1.0-b20150512/bin/retrieve_pixel_time_series.py", line 5, in pkg_resources.run_script('agdc-api==0.1.0-b20150512', 'retrieve_pixel_time_series.py') File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 492, in run_script

File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 1350, in run_script

File "/projects/el8/opt/modules/agdc-api/0.1.0-b20150512/lib/python2.7/site-packages/agdc_api-0.1.0_b20150512-py2.7.egg/EGG-INFO/scripts/retrieve_pixel_time_series.py", line 422, in RetrievePixelTimeSeriesTool("Retrieve Pixel Time Series").run() File "/projects/el8/opt/modules/agdc-api/0.1.0-b20150512/lib/python2.7/site-packages/agdc_api-0.1.0_b20150512-py2.7.egg/datacube/api/tool/init.py", line 165, in run self.go() File "/projects/el8/opt/modules/agdc-api/0.1.0-b20150512/lib/python2.7/site-packages/agdc_api-0.1.0_b20150512-py2.7.egg/EGG-INFO/scripts/retrieve_pixel_time_series.py", line 217, in go for tile in self.get_tiles(x=cell_x, y=cell_y): File "/projects/el8/opt/modules/agdc-api/0.1.0-b20150512/lib/python2.7/site-packages/agdc_api-0.1.0_b20150512-py2.7.egg/EGG-INFO/scripts/retrieve_pixel_time_series.py", line 170, in get_tiles return list(self.get_tiles_from_db(x=x, y=y)) File "/projects/el8/opt/modules/agdc-api/0.1.0-b20150512/lib/python2.7/site-packages/agdc_api-0.1.0_b20150512-py2.7.egg/EGG-INFO/scripts/retrieve_pixel_time_series.py", line 190, in get_tiles_from_db dataset_types=dataset_types): File "/projects/el8/opt/modules/agdc-api/0.1.0-b20150512/lib/python2.7/site-packages/agdc_api-0.1.0_b20150512-py2.7.egg/datacube/api/query.py", line 985, in list_tiles_as_generator yield Tile.from_db_record(record) File "/projects/el8/opt/modules/agdc-api/0.1.0-b20150512/lib/python2.7/site-packages/agdc_api-0.1.0_b20150512-py2.7.egg/datacube/api/model.py", line 369, in from_db_record datasets=DatasetTile.from_db_array(record["satellite"], record["datasets"])) File "/projects/el8/opt/modules/agdc-api/0.1.0-b20150512/lib/python2.7/site-packages/agdc_api-0.1.0_b20150512-py2.7.egg/datacube/api/model.py", line 236, in from_db_array dst = make_wofs_dataset(satellite_id, out[DatasetType.ARG25]) File "/projects/el8/opt/modules/agdc-api/0.1.0-b20150512/lib/python2.7/site-packages/agdc_api-0.1.0_b20150512-py2.7.egg/datacube/api/model.py", line 450, in make_wofs_dataset y = int(fields[5]) ValueError: invalid literal for int() with base 10: '2014-07-19T23-43-48.vrt'

I can replicate the error by executing

f = 'LS8_OLI_TIRS_NBAR123-0252013-04-24T01-46-06.vrt' f.split('') ['LS8', 'OLI', 'TIRS', 'NBAR', '123', '-025', '2013-04-24T01-46-06.vrt'] int('2014-07-19T23-43-48.vrt') Traceback (most recent call last): File "", line 1, in ValueError: invalid literal for int() with base 10: '2014-07-19T23-43-48.vrt'

It would appear that the file being accessed didn't follow a standard naming convention??

simonoldfield commented 9 years ago

Fixed in 0.1.0-b20150513 (aka 0.1.0 2015-05-13 snapshot).

This is a side effect of the current situation where we are fudging the WOFS datsets as they haven't been ingested as yet. The code is doing some dodgy file name manipulation to map an NBAR filename to a WOFFLE filename and it wasn't dealing with the fact that LS8 datasets can be LS8_OLI_TIRS or LS8_OLI.

This code will disappear as soon as the WOFS datasets are actually ingested, but I've fixed it anyway.

I probably should mentioned that it is worth taking seriously the fact that the 0.1.0 releases are currently marked as SNAPSHOT releases! :smile: