Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

new phenology code issue - index out of bounds #56

Closed
valpasq opened this issue Nov 3, 2015 · 2 comments
Closed

new phenology code issue - index out of bounds #56

valpasq opened this issue Nov 3, 2015 · 2 comments
Labels
Milestone

Comments

@valpasq
Copy link
Collaborator

valpasq commented Nov 3, 2015

Got the following error message running YATSM on p013r031:

  File "/usr3/graduate/valpasq/Documents/yatsm/yatsm/cli/line.py", line 190, in line
    yatsm.record = ltm.fit(yatsm, **pcfg.get('fit', {}))
  File "/usr3/graduate/valpasq/Documents/yatsm/yatsm/phenology.py", line 315, in fit
    self.q_min, self.q_max)
  File "/usr3/graduate/valpasq/Documents/yatsm/yatsm/phenology.py", line 262, in _fit_record
    pheno_cor = np.corrcoef(evi_smooth[yeardoy[:, 1] - 1], evi_norm)[0, 1]
IndexError: index 365 is out of bounds for axis 0 with size 365

Logfiles located in /projectnb/landsat/projects/Massachusetts/p013r031/

@ceholden ceholden added the bug label Nov 3, 2015
@ceholden
Copy link
Owner

ceholden commented Nov 3, 2015

I'm pretty sure this one slipped through because most datasets do not include observations taken on the last day in a leap year. That dataset includes this observation:

2000366,LT5,/projectnb/landsat/projects/Massachusetts/p013r031/images/LT50130312000366XXX02/LT50130312000366XXX02_all

What's worse is that these observations are usually masked out. I've made a change to use 366 values to account for the leap year so there won't be an indexing problem.

Could you give it a test before I pull the change into master? The branch is issue56.

@valpasq
Copy link
Collaborator Author

valpasq commented Nov 3, 2015

Wow! A leap year bug!

Seems like everything is running fine now...

16:32:48:DEBUG:130:line.line:Running line 801
16:32:49:DEBUG:158:reader.read_line:Read in Y from cache file
16:50:37:DEBUG:194:line.line:    Saving YATSM output to /projectnb/landsat/projects/Massachusetts/p013r031/images/YATSM/yatsm_r801.npz
16:50:37:DEBUG:201:line.line:Line 801 took 1069.03075409s to run
16:50:37:DEBUG:130:line.line:Running line 851
16:50:37:DEBUG:173:reader.read_line:Reading in data from disk using GDAL
16:51:35:DEBUG:177:reader.read_line:Took 58.19s to read in the data
16:51:35:DEBUG:181:reader.read_line:Writing Y data to cache file /projectnb/landsat/projects/Massachusetts/p013r031/images/cache/yatsm_r851_n630_b11.npy.npz
17:10:42:DEBUG:194:line.line:    Saving YATSM output to /projectnb/landsat/projects/Massachusetts/p013r031/images/YATSM/yatsm_r851.npz
17:10:43:DEBUG:201:line.line:Line 851 took 1205.63389206s to run

Thanks for the fix!

@ceholden ceholden closed this as completed Nov 5, 2015
@ceholden ceholden modified the milestone: v0.5.5 Nov 25, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants