convert.jr6_jr6 writes the sample azimuth and dip into bed_dip_direction and bed_dip
I maintainer di solito rispondono entro 1 giorno
@Caoimhinmg ci sta già lavorando.
Dal 21/9/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
What command was run:
from pmagpy import convert_2_magic as convert
convert.jr6_jr6("AP12.jr6", dir_path="out", input_dir_path="data_files/convert_2_magic/jr6_magic", location="test")
What happened:
In the samples.txt that is written, bed_dip_direction and bed_dip are copies of the sample azimuth and dip rather than the bedding orientation in the file:
| sample | azimuth | dip | bed_dip_direction | bed_dip |
|---|---|---|---|---|
| AP12-01 | 19 | -7 | 19 | -7 |
| AP12-02 | 202 | -13 | 202 | -13 |
| AP12-03 | 117 | -13 | 117 | -13 |
| AP12-04 | 110 | -7 | 110 | -7 |
This is the case for all six samples in the file. The bedding fields in AP12.jr6 (the pair that follows the specimen azimuth and dip, which AGICO's format calls the "foliation") are 0 0 for every specimen, e.g. the first line is:
AP12-01A NRM 5.23 -1.52 -1.43 -2 19 7 0 0 0 0 12 0 12 90 1
Because the values written are the converted sample orientation, bed_dip comes out negative. Anything downstream that applies a tilt correction from these columns will rotate each sample about its own core orientation.
What I expected to happen:
bed_dip_direction and bed_dip taken from the bedding fields of the JR6 file (0 and 0 for this file), as they were before the refactor.
Where it comes from:
This looks like it came in with d1b0f73f (2026-07-20, the jr6_jr6 I/O refactor), which is in v4.5.0 and v4.5.2. That commit renamed the file's two bedding columns from bed_dip_direction/bed_dip to foliation_azimuth_of_dip/foliation_dip, and in the same change the two lines that write the sample record went from
SampRec['bed_dip_direction'] = row['bed_dip_direction']
SampRec['bed_dip'] = row['bed_dip']
to
SampRec['bed_dip_direction'] = row['azimuth']
SampRec['bed_dip'] = row['dip']
(now pmagpy/convert_2_magic.py lines 6179-6180). The renamed foliation_azimuth_of_dip and foliation_dip columns are read but never written out.
Possible fix:
If the change was not intended, pointing those two lines at the renamed columns would restore the previous behavior:
SampRec['bed_dip_direction'] = row['foliation_azimuth_of_dip']
SampRec['bed_dip'] = row['foliation_dip']
I have not tested this. Two things I am not sure of and that @Caoimhinmg is better placed to answer, having worked from the AGICO manual for the refactor:
- Was writing
azimuth/dipinto the bedding columns deliberate for some reason I am missing? - How should the two bedding fields be read for different values of orientation parameter P4? The JR-6A User Manual (Appendix 6.1, Figure 24) gives P4 = 0 as dip direction/dip notation and P4 = 90 as strike/dip notation (right hand rule), so a raw copy is only right for P4 = 0.
AP12.jr6has P4 = 90. That is the subject of #684, andparam4is still read but not used, so it makes sense to settle both at once.
A test that converts AP12.jr6 and checks the bedding columns against the file would guard against this going forward. There is currently no test of jr6_jr6 in pmagpy/test/; the two in the legacy pmagpy_tests/test_imports3.py are not run by CI and do not check the bedding columns.
PmagPy version:
4.5.2 (master at 40848f49)
- Lingua principale
- Jupyter Notebook
- Stelle
- 81
- Fork
- 45
- Merge medio
- 1g 16h
- PR unite (30g)
- 29
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PmagPy/PmagPy
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
PmagPy/PmagPy#950 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
PmagPy/PmagPy#945 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Update - Documentation
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
PmagPy/PmagPy#925 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno