SWOT-JPL/swotsimulator

Saving Random_coeff.nc

Closed this issue · 1 comments

When the file_coeff parameter is not specified to None in the params.py file, the following error appears: (in the previous version of the simulator it worked fine and this error did not appear)

Force creation of SWOT grid
Load data from orbit file
Compute nadir coordinate in the new domain
Percent: [##############################] 100.00%,
Compute SWOT grid

[####################] 14:19:07|> pass: 387 ....... DONE
[####################] 14:19:07|> pass: 385 ....... DONE
[####################] 14:19:07|> pass: 386 ....... DONE
SWOT Grids and nadir tracks have been written in /Users/laura/src/git/swotsimulator_040418/swotsimulator/example/swot_output

Traceback (most recent call last):
File "/Users/laura/anaconda2/envs/venv_swot_3/bin/swotsimulator", line 11, in
load_entry_point('swotsimulator==3.0', 'console_scripts', 'swotsimulator')()
File "/Users/laura/src/git/swotsimulator_040418/swotsimulator/swotsimulator/cli.py", line 30, in run_swot_script
run_simulator.run_simulator(p)
File "/Users/laura/src/git/swotsimulator_040418/swotsimulator/swotsimulator/run_simulator.py", line 152, in run_simulator
err, errnad = load_error(p)
File "/Users/laura/src/git/swotsimulator_040418/swotsimulator/swotsimulator/run_simulator.py", line 495, in load_error
err.save_coeff(p, 2*nhalfswath)
File "/Users/laura/src/git/swotsimulator_040418/swotsimulator/swotsimulator/build_error.py", line 673, in save_coeff
var[:] = self.A_roll
File "netCDF4/_netCDF4.pyx", line 4430, in netCDF4._netCDF4.Variable.setitem
File "netCDF4/_netCDF4.pyx", line 4657, in netCDF4._netCDF4.Variable._put
IndexError: size of data array does not conform to slice

Thanks!

Hi Laura,
Actually it is not a bug but an issue in your parameter file.
To keep track of your Random Coefficient, you need to set savesignal to False. Indeed, when you save signal, this variable is used to generate the noise and not random coefficient. There is no point in saving coefficient as well. I have not implemented yet a possibility to savesignal and make run reproducible but if you are not working on very large signals (few thousand kilometers), there is no added value to savesignal to True.
I will proof the simulator and improve the documentation to prevent users for having the same issue. Adding more and more options to the simulator makes the parameter file a bit difficult to understand.