Closed depion closed 1 month ago
Description
I did CoCiP trajectory calculations for a global fleet, running into the following exceptions: python_exception.txt
Basically, the error is caused in this line: https://github.com/contrailcirrus/pycontrails/blob/main/pycontrails/models/cocip/radiative_forcing.py#L1106C5-L1106C70
The reason seems to be that for specific settings (flights, meteorology), the spatial_bbox and subsequently the lon_coords https://github.com/contrailcirrus/pycontrails/blob/main/pycontrails/models/cocip/radiative_forcing.py#L1095 https://github.com/contrailcirrus/pycontrails/blob/main/pycontrails/models/cocip/radiative_forcing.py#L1104C5-L1104C16 are by chance such that the flag wrap_longitude is True https://github.com/contrailcirrus/pycontrails/blob/main/pycontrails/models/cocip/radiative_forcing.py#L1105
spatial_bbox
lon_coords
wrap_longitude
Details
Steps to Reproduce
Additional Notes
I guess the solution would be to set copy=True or copy=wrap_longitude when creating the MetDataArray.
copy=True
copy=wrap_longitude
This seems like a duplicate of #219--do you agree? If so I'll close this issue (though this is a good reminder to figure out how to squash this bug.)
Yes, this is is a duplicate, you are right. Can be closed.
Description
I did CoCiP trajectory calculations for a global fleet, running into the following exceptions: python_exception.txt
Basically, the error is caused in this line: https://github.com/contrailcirrus/pycontrails/blob/main/pycontrails/models/cocip/radiative_forcing.py#L1106C5-L1106C70
The reason seems to be that for specific settings (flights, meteorology), the
spatial_bbox
and subsequently thelon_coords
https://github.com/contrailcirrus/pycontrails/blob/main/pycontrails/models/cocip/radiative_forcing.py#L1095 https://github.com/contrailcirrus/pycontrails/blob/main/pycontrails/models/cocip/radiative_forcing.py#L1104C5-L1104C16 are by chance such that the flagwrap_longitude
is True https://github.com/contrailcirrus/pycontrails/blob/main/pycontrails/models/cocip/radiative_forcing.py#L1105Details
Steps to Reproduce
Additional Notes
I guess the solution would be to set
copy=True
orcopy=wrap_longitude
when creating the MetDataArray.