Closed bclyons12 closed 1 year ago
@jmcclena This is the issue we discussed earlier.
I have confirmed that either putting an explicit int()
in the call to the omas routine, or calling int()
inside the omas routine both solve this. Just need to know what's most appropriate.
@bclyons12 let's put an int()
at the lowest possible level, which I think should as soon as one enters these functions:
https://github.com/gafusion/omas/blob/5aced3524848d6a79d613f8b03f31f85d17f3649/omas/omas_machine.py#L66
https://github.com/gafusion/omas/blob/5aced3524848d6a79d613f8b03f31f85d17f3649/omas/omas_machine.py#L689
https://github.com/gafusion/omas/blob/5aced3524848d6a79d613f8b03f31f85d17f3649/omas/omas_machine.py#L711
https://github.com/gafusion/omas/blob/5aced3524848d6a79d613f8b03f31f85d17f3649/omas/omas_machine.py#L873
Stale issue message
@bclyons12 I think this got resolved, right?
@orso82 I don't think so. @avdeevag recently saw this using EFITtime where we avoided the error with https://github.com/gafusion/OMFIT-source/commit/45e3e7c9b8dad747c90395641a9bf9decaa7611e
@bclyons12 fixed the issue relating to the pulse, but perhaps something similar should be done for times? https://github.com/gafusion/omas/commit/4e70f2b3d0c527aa4b8a2cf76cc83ae5b30a13bf
Yes, the issue with pulse
/shot
being an OMFITexpression was resolved. I have not encountered a problem with time
, but could absolutely see it causing a similar problem.
@jmcclena in the example you showed https://github.com/gafusion/OMFIT-source/commit/45e3e7c9b8dad747c90395641a9bf9decaa7611e the issue is that we are calling directly the OMAS machine mapping function thomson_scattering_data(ods, shot)
.
Instead of doing:
from omas.machine_mappings.nstx import thomson_scattering_data
thomson_scattering_data(ods, shot)
thomson_constraint(
ods,
array(times),
pressure_factor=root['SETTINGS']['PHYSICS']['Pthomson_pressure_factor'],
error_factor=root['SETTINGS']['PHYSICS']['Pthomson_error_factor'],
edge_r=root['SETTINGS']['PHYSICS']['Pthomson_edge_r'],
edge_sig=root['SETTINGS']['PHYSICS']['Pthomson_edge_sig'],
)
I would suggest doing:
with ods.open("nxtx", shot):
thomson_constraint(
ods,
array(times),
pressure_factor=root['SETTINGS']['PHYSICS']['Pthomson_pressure_factor'],
error_factor=root['SETTINGS']['PHYSICS']['Pthomson_error_factor'],
edge_r=root['SETTINGS']['PHYSICS']['Pthomson_edge_r'],
edge_sig=root['SETTINGS']['PHYSICS']['Pthomson_edge_sig'],
)
which would handle the pulse/shot being an OMFITexpression (among other things).
Stale issue message
If you call some of the machine mapping routines in OMFIT, but you set pulse to an OMFITexpression, then the mapping will fail. I don't know if this is the intended behavior and the omas routines should always be called with an explicit
int
in OMFIT or if it should be handled by omas.An example in OMFIT:
where
root['SETTINGS']['EXPERIMENT']['shot']
is an OMFIT expression to get the shot number from a parent module. This gives an error: