Coverage for pyrdnap / v1grid / __init__.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.14.0, created at 2026-06-14 13:03 -0400

1 

2# -*- coding: utf-8 -*- 

3 

4u'''Extract from the compressed C{RDNAPTRANS(tm)2018_v229627} 

5variant 1 C{nlgeo2018.txt.zip} and C{rdcorr2018.txt.zip} grid 

6files B{only} the C{NAP_...}, C{lat_corr_} and C{lon_corr_} 

7columns and encode each in Python as a row-order matrix, a 

8481-tuple of 301-arrays of single- or double precision floats. 

9 

10Of the 144,781 floats (481 x 301) in the C{lat_corr_} and 

11C{lon_corr_} columns of the C{rdcorr2018.txt} grid file 

12only 55,139 respectively 55,348 are non-zero between indices 

13[8598:93827] respectively [8598:93830] (and 89,642 respectively 

1489,433 are zero). 

15 

16As a result, the first 28 and the last 169 matrix rows (in total 

17197 rows or 41% of 481) are representable by the same 301-array 

18of single-precision zeros. There are other stretches of zeros, 

19but none amount to 301 or more. 

20''' 

21from pyrdnap.v_grids import _d_array, _f_array, _RxC, _v_grid_txt 

22 

23__all__ = () 

24__version__ = '26.06.14' 

25 

26_NAP_h = _v_grid_txt(1, 'nlgeo', 2, _f_array) 

27_lat_corr = _v_grid_txt(1, 'rdcorr', 2, _d_array, _0s=89642) 

28_lon_corr = _v_grid_txt(1, 'rdcorr', 3, _d_array, _0s=89433) 

29 

30assert _NAP_h._RxC == _lat_corr._RxC == _lon_corr._RxC == _RxC