issue209:python
                Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| issue209:python [2024/09/28 22:52] – d52fr | issue209:python [2024/10/01 09:20] (Version actuelle) – andre_domenech | ||
|---|---|---|---|
| Ligne 4: | Ligne 4: | ||
| Here in Texas, we have a saying: “If you don’t like the weather, wait 10 minutes.” That’s because on any given day, the weather is so very volatile. Especially in the summertime. In order to make any plans for outside activities, things like walks, shopping, family trips, heck even walking the dog, can be impacted by the weather. Cold, hot, windy, rainy, foggy, muddy, clear… it all affects how we will spend our day or night.** | Here in Texas, we have a saying: “If you don’t like the weather, wait 10 minutes.” That’s because on any given day, the weather is so very volatile. Especially in the summertime. In order to make any plans for outside activities, things like walks, shopping, family trips, heck even walking the dog, can be impacted by the weather. Cold, hot, windy, rainy, foggy, muddy, clear… it all affects how we will spend our day or night.** | ||
| + | |||
| + | Python et la météo spatiale | ||
| + | |||
| + | Salutations encore une fois, camarades des formes de vie sensibles. Ici, sur la plateforme d' | ||
| + | |||
| + | Ici, au Texas, nous avons un dicton : « Si vous n' | ||
| + | |||
| **So, yes, weather here on Terra is an important thing that we need to take into consideration before we make any decisions about what we will do today, tomorrow or even next week. There is another event that is very weather sensitive. That’s the launching of spacecraft to explore areas not on Terra, and even the return of said spacecraft. Yes, I’m talking about space, the great unknown, the ‘final frontier’. | **So, yes, weather here on Terra is an important thing that we need to take into consideration before we make any decisions about what we will do today, tomorrow or even next week. There is another event that is very weather sensitive. That’s the launching of spacecraft to explore areas not on Terra, and even the return of said spacecraft. Yes, I’m talking about space, the great unknown, the ‘final frontier’. | ||
| Ligne 10: | Ligne 17: | ||
| Many countries have created space programs that only monitor the space weather. NASA is one of them and that’s where we will concentrate our attention for this article.** | Many countries have created space programs that only monitor the space weather. NASA is one of them and that’s where we will concentrate our attention for this article.** | ||
| + | |||
| + | Donc, oui, la météo sur Terra est un élément important que nous devons prendre en considération avant de prendre des décisions sur ce que nous ferons aujourd' | ||
| + | |||
| + | L' | ||
| + | |||
| + | De nombreux pays ont créé des programmes spatiaux qui surveillent uniquement la météo spatiale. La NASA est l'un d' | ||
| + | |||
| **To get started, take a look at https:// | **To get started, take a look at https:// | ||
| Ligne 16: | Ligne 30: | ||
| Let’s look at some of the things that DONKI can provide.** | Let’s look at some of the things that DONKI can provide.** | ||
| + | |||
| + | Pour commencer, consultez le site https:// | ||
| + | |||
| + | Si vous souhaitez approfondir la question, vous devez vous inscrire pour obtenir une clé API à l' | ||
| + | |||
| + | Voyons un peu ce que DONKI peut vous apporter. | ||
| + | |||
| **In your favorite IDE, start a quick python project. Of course, we’ll need to import requests and json. Due to the amount of data that will come down, you’ll want to include pprint in your project as well. Set a variable named mykey to “DEMO_KEY”, | **In your favorite IDE, start a quick python project. Of course, we’ll need to import requests and json. Due to the amount of data that will come down, you’ll want to include pprint in your project as well. Set a variable named mykey to “DEMO_KEY”, | ||
| Ligne 23: | Ligne 44: | ||
| Here’s (top right) what the api call would look like, including the startDate and endDate parameters… | Here’s (top right) what the api call would look like, including the startDate and endDate parameters… | ||
| https:// | https:// | ||
| + | |||
| + | Dans votre IDE favori, démarrez un projet python rapide. Bien sûr, nous aurons besoin d' | ||
| + | |||
| + | Vous pouvez réduire la quantité de données obtenues en incluant une date de début et une date de fin au format AAAA-MM-JJ, mais si vous souhaitez obtenir une vue d' | ||
| + | |||
| + | Voici (en haut à droite) à quoi ressemblerait l' | ||
| + | https:// | ||
| + | |||
| **Please note, by leaving out the startDate and/or endDate could lead to way more data items than you might want to start with. So use that type of call for when you really need it. | **Please note, by leaving out the startDate and/or endDate could lead to way more data items than you might want to start with. So use that type of call for when you really need it. | ||
| Ligne 33: | Ligne 62: | ||
| dict_keys([' | dict_keys([' | ||
| + | |||
| + | Veuillez noter qu'en omettant la date de début et/ou la date de fin, vous risquez d' | ||
| + | |||
| + | À partir de là, vous pouvez interroger la variable info pour obtenir les champs que vous souhaitez. | ||
| + | |||
| + | J'ai fait cela très tôt le matin du samedi 7 septembre, et j'ai obtenu 129 enregistrements de données, chaque enregistrement contenant 12 éléments et certains de ces éléments étant eux-mêmes des dictionnaires. | ||
| + | |||
| + | Quoi qu'il en soit, afin d' | ||
| + | |||
| + | dict_keys([' | ||
| + | |||
| **I then wanted to see what just one record would look like. So I had it dump to the terminal via pprint. I broke the data dump into smaller pieces to make it easier to understand. Some of the data items don’t mean anything to me yet. | **I then wanted to see what just one record would look like. So I had it dump to the terminal via pprint. I broke the data dump into smaller pieces to make it easier to understand. Some of the data items don’t mean anything to me yet. | ||
| Ligne 46: | Ligne 86: | ||
| Now for the second dictionary item in our json data. The cmeAnalyses field (below): | Now for the second dictionary item in our json data. The cmeAnalyses field (below): | ||
| You can see that there are many items that don’t quite compute to me, but there are two items that stand out pretty well right at first glance. Mainly the note field and the link field. If I was really interested in this event, I’d pull that link up. Remember, this is the analysis of the event, so it will be fairly specific.** | You can see that there are many items that don’t quite compute to me, but there are two items that stand out pretty well right at first glance. Mainly the note field and the link field. If I was really interested in this event, I’d pull that link up. Remember, this is the analysis of the event, so it will be fairly specific.** | ||
| + | |||
| + | J'ai ensuite voulu voir à quoi ressemblait un seul enregistrement. J'ai donc envoyé les données au terminal par l' | ||
| + | |||
| + | {' | ||
| + | |||
| + | ' | ||
| + | |||
| + | ' | ||
| + | |||
| + | Pour moi, l' | ||
| + | |||
| + | Passons maintenant au deuxième élément du dictionnaire dans nos données json. Le champ cmeAnalyses (en bas à droite). | ||
| + | |||
| + | Vous pouvez voir qu'il y a beaucoup d' | ||
| + | |||
| **Now we are back at the “general” data, and here we see that there were two devices that were used to look at this event as well as another link, this time a more general web page that will show any related (top right). | **Now we are back at the “general” data, and here we see that there were two devices that were used to look at this event as well as another link, this time a more general web page that will show any related (top right). | ||
| Ligne 60: | Ligne 115: | ||
| ' | ' | ||
| + |  | ||
| + | Nous revenons maintenant aux données « générales », et nous voyons ici que deux appareils ont été utilisés pour examiner cet événement, | ||
| - | **Finally the last batch of data fields. Here, the startTime and submissionTime fields are something I would normally look at. | + | Le champ « note » est généralement l'un des plus importants pour moi, car il me permet de décider d' | 
| + | ' | ||
| + | |||
| + | ' | ||
| + | |||
| + | 'event is not clearly visible in SOHO LASCO C3 as it may be too faint ' | ||
| + | |||
| + | ' | ||
| + | |||
| + | ' | ||
| + |  | ||
| + | (Note : CME faible vu en premier dans le NW par SOHO LASCO C2 commençant à 2024-08-08T04: | ||
| + |  | ||
| + | |||
| + | **Finally the last batch of data fields. Here, the startTime and submissionTime fields are something I would normally look at. | ||
| ' | ' | ||
| Ligne 72: | Ligne 143: | ||
| url1 = f" | url1 = f" | ||
| + | |||
| + | Enfin, le dernier lot de champs de données. Ici, les champs startTime et submissionTime sont des choses que je regarderais en temps normal. | ||
| + | |||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | |||
| + | Tout cela étant dit, le dictionnaire cmeAnalyses peut contenir plusieurs entrées. Un très bon exemnple de cela s'est produit le 11 mai de cette année (2024, au cas où vous liriez ceci dans le futur). J'ai utilisé la même méthodologie pour obtenir un dumping de données pour ce jour à nouveau en utilisant DONKI. | ||
| + | |||
| + | url1 = f « https:// | ||
| + | |||
| **Then, once I got the data, I saved the data to a local pickle file, so I didn’t have to keep making the call. There were 5 events reported that day. I dug into the json data and near the end of the first report was a link to https:// | **Then, once I got the data, I saved the data to a local pickle file, so I didn’t have to keep making the call. There were 5 events reported that day. I dug into the json data and near the end of the first report was a link to https:// | ||
| Ligne 78: | Ligne 161: | ||
| That big dark purple (to my eyes) is the CME headed for that tiny yellow dot which represents Earth. Since the image is a GIF, I didn’t try to capture it just as it hits, but you can visit the above link to watch it yourself.** | That big dark purple (to my eyes) is the CME headed for that tiny yellow dot which represents Earth. Since the image is a GIF, I didn’t try to capture it just as it hits, but you can visit the above link to watch it yourself.** | ||
| + | |||
| + | Ensuite, une fois les données obtenues, je les ai sauvegardées dans un fichier local quelconque, ce qui m'a évité d' | ||
| + | |||
| + | Plus haut dans les données json du premier rapport, j'ai trouvé un autre lien qui m'a conduit vers https:// | ||
| + | |||
| + | Ce gros violet foncé (à mes yeux) est la CME qui se dirige vers le petit point jaune qui représente la Terre. Comme l' | ||
issue209/python.1727556722.txt.gz · Dernière modification : 2024/09/28 22:52 de d52fr
                
                