nasa / RHEAS

Regional Hydrologic Extremes Assessment System
MIT License
73 stars 54 forks source link

writeForcings - CHIRPS - Maximum area? #34

Closed AdamJDuncan closed 8 years ago

AdamJDuncan commented 8 years ago

Did you ever come across this when doing Africa? Smaller BBoxes work (for both land and ocean... not an issue that CHIRPS gives ocean 'nodata' as opposed to GPM/TRMM/CMORPH). But for the full LMR BBox I get:

  File "/media/adam/UbuData/RHEAS/RHEAS/src/vic/vic.py", line 397, in writeForcings
    prec[i][2], tmax[i][2], tmin[i][2], wind[i][2]))
ValueError: Unknown format code 'f' for object of type 'str'

Last section of the log... error occurs at the 4419th pixel.

writing data_27.875_98.375
writing data_27.875_98.625
writing data_27.875_98.875
writing data_27.875_99.125
writing data_27.875_99.375
writing data_8.125_93.125

It's not that pixel (which is on an island, btw), which passes smoothly in a smaller area. There's nothing out of the ordinary for the precip.chirps rasters in that area. It also runs fine when replacing CHIRPS/NCEP with CMORPH/NCEP.

Since CHIRPS has the highest spatial resolution and this 5-country LMR BBox has the largest extent that I've worked with, I'm tempted to believe there's a limit to writing forcings. Did you ever run into this?

kandread commented 8 years ago

there shouldn't be a limit in writing the forcings, it just loops through the grid cells. Your error suggests there is a null value (it's trying to convert None to a float) for a particular pixel, i.e. a data problem. I would overlay your grid on the CHIRPS data, or the CMORPH and CHIRPS maps and see how their extents differ. Also try querying the database directly to see what it returns.

AdamJDuncan commented 8 years ago

OK I just tried to replicate this in Africa with similar dimensions, moved westward (minlat: 5.5 / maxlat: 28.75 / minlon: -8.0 / maxlon: 9.75) and there were no issues...

Aaand yes you're right, there are pixels included in the soil file that aren't in CHIRPS... I was tripped up by smaller bounding boxes clearing the pixel. No idea why that happened. Deleting the offending pixel(s) from the soil file now.

Issue solved, thank you.