geomagpy / magpy

MagPy (or GeomagPy) is a Python package for analysing and displaying geomagnetic data.
BSD 3-Clause "New" or "Revised" License
45 stars 27 forks source link

Export to IAF #125

Closed mlnorthernswe closed 1 year ago

mlnorthernswe commented 1 year ago

Followed the wiki about creating a baseline with gui: https://github.com/geomagpy/magpy/wiki/GUI:-Producing-a-baseline I tried to export the month to IAF format but nothing happens. Export to other formats seems to work.

leonro commented 1 year ago

Sorry for not replying earlier. Will check your issue later this week and come back to you. I had the same problem recently and already added a quick fix, which is commited so far only to the development branch. Will need to check and test it.

leonro commented 1 year ago

The following changes will be contained in version 1.1.2 to correct and simplify the construction of IAF files in comparison to previous versions of MagPy:

The main changes can be found here: 20dda573a713d838668f89f5172415552b0ceac6 9a260237b3eec666474418a84b64773a8047adc9 2cf65c8573e6840cd1587aeffdc7526ba458962a

leonro commented 1 year ago

Version 1.1.2 will go online soon, most likely later today. Provided I don't get any additional requests I will close this issue 4 weeks after publication of 1.1.2.

mlnorthernswe commented 1 year ago

Hello again, thanks for your effort.

I tested with the example data and it works of course.

However with our data I couldn't get it to work. No IAF-file is produced. Export to pycdf seems to work.

If it can be of any help our DI-data and variometer-data comes below in the links: https://www2.irf.se/maggraphs/absolute_measurements/ https://www2.irf.se/maggraphs/vario_scalar/ When I tested I did the following: Loaded DI-data-files (from https://www2.irf.se/maggraphs/absolute_measurements/): 2023-02-24_08-41-23_MIR2_KIR.txt 2023-03-08_09-42-05_MIR2_KIR.txt 2023-03-10_10-42-05_MIR2_KIR.txt
2023-03-17_10-02-10_MIR2_KIR.txt 2023-03-20_06-42-09_MIR2_KIR.txt 2023-03-23_08-59-09_MIR2_KIR.txt 2023-03-27_08-28-55_MIR2_KIR.txt 2023-04-06_11-30-05_MIR2_KIR.txt The variometerdata (and scalar data) used is from https://www2.irf.se/maggraphs/vario_scalar/ Did the step 1 och 2 in https://github.com/geomagpy/magpy/wiki/GUI:-Producing-a-baseline Did the step 3 and loaded variometer files from kir20230228vsec.sec to kir20230401vsec.sec. Did step 4.

Did step 6 and tested to export to IAF but it didn't succeeed. Export to pycdf as mentioned seems to succeed.

I would appreciate if you have time to do the tests on our data.

/Regards Mats

leonro commented 1 year ago

Hi Mats, I am currently downloading your data, will test it later today and come back to you. Just a quick question: The IAF format is a one-minute data product. Have you filtered your one-second source to a one-minute resolution before step 6? Best wishes, Roman

mlnorthernswe commented 1 year ago

Ok, I thought that was done in the export. There we have the problem then probably. I will test again with filtered one-minute data.

leonro commented 1 year ago

Just tested with your data. After filtering (panel "Analysis" -> "Filter", using IAGA default) export to IAF seems to work. As K values are determined when exporting, you might want to modify the K9 limit on panel "Meta" -> "Station related" before exporting. I will include a notification for failing exports into the next version. Please check whether it is working for you.

mlnorthernswe commented 1 year ago

Yes, it works now! Made a note about that data possibly must be filtered before export in the wiki. Good that you mentioned the Meta-panel. Thank you for your time!

leonro commented 1 year ago

Added a notification to the report panel of xmagpy in case of failing exports. see d46de58e316751986e3450bfd8e6b72fb84a3b85

Will close this issue now.