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

sorted by timestamp in directory lookup can cause faulty ranges #114

Closed stephanbracke closed 2 years ago

stephanbracke commented 2 years ago

Opening data in an intermagnet format of a certain observatory by choosing a directory proposed in our cleaned dataset results almost always in an incorrect timeframe. The reason for this is that in the directory the cleaned files didn't have timstamps that followed the order of the data that they contained. Looking into the code

https://github.com/geomagpy/magpy/blob/ae91462f1644ebf89fbe570ce1cf67d1d89eb926/magpy/gui/magpy_gui.py#L2234

The key is the timestamp of the file which is not ok for us. If we eliminate the key the order will be alphabetic order of the filenames. Because most ( all ?) of the intermagnet/iaga standard naming of files will be ok with the alphabetic order it seems to be more appropriate to do so.

leonro commented 2 years ago

Done in 9d719f8b75f1b868898398c04e315058213c0823