Conversation
pradal
left a comment
There was a problem hiding this comment.
Just two remarks. Very good idea to move from numpy array to pandas dataframe.
When we first write this code, pandas did not exist
src/alinea/pyratp/runratp.py
Outdated
| pyratp.dir_interception.scattering = False | ||
| ratp.out_time_spatial = np.zeros(pyratp.micrometeo.nbli*pyratp.grid3d.nveg*22*pyratp.grid3d.nent).reshape(pyratp.micrometeo.nbli*pyratp.grid3d.nveg*pyratp.grid3d.nent,22) | ||
| ratp.out_time_tree = np.zeros(pyratp.micrometeo.nbli*8*pyratp.grid3d.nent).reshape(pyratp.micrometeo.nbli*pyratp.grid3d.nent ,8) | ||
| ratp.out_time_spatial = np.zeros((pyratp.micrometeo.nbli * pyratp.grid3d.nveg * pyratp.grid3d.nent, 22)) |
There was a problem hiding this comment.
Replace 22 by len(columns).
And 8 by len(columns_tree).
Otherelse it is cryptic: Is 8 refers to 8 bytes... it takes me some seconds to figure out what 22 and 8 means.
src/alinea/pyratp/runratp.py
Outdated
| def DoIrradiation(*args): | ||
| ratp = pyratp.ratp | ||
| ratp.out_rayt = np.zeros(pyratp.micrometeo.nbli*pyratp.grid3d.nveg*9*pyratp.grid3d.nent).reshape(pyratp.micrometeo.nbli*pyratp.grid3d.nveg*pyratp.grid3d.nent ,9) | ||
| ratp.out_rayt = np.zeros((pyratp.micrometeo.nbli * pyratp.grid3d.nveg * pyratp.grid3d.nent, 9)) |
There was a problem hiding this comment.
no idea, I just took the opportunity of this branch to change a reshape by directly passing the shape to np.zeros :)
But I'll investigate
|
I also left the code that write an output file in a temporary directory. The same code has been commented in in DoIrradiance. Shall we comment it too? |
|
Used a DEBUG constant and moved the code in a separate function as a pis-aller |
pandas was already a dependency :)