-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anim14 #5019
Anim14 #5019
Conversation
I share with you my idea for animation 14 to show the ability to make a movie with meca and coupe. There are many details that can be improve in the script but now I would like to know your general opinion about the figure before I go on improving the scripts and the animation. About the data: I used the Global CMT web page and I add a column with the time.
Really nice animation - this will be a great addition! Is the red NW-SE line related to the distance coordinates in the lower panel? I think that it could look smoother to iterate by the month number rather than month name in the upper right corner (i.e. 03-2013 rather than March-2013). What do you think? Did you add the time column using GMT? If so, I think it would be nice to include that step in the script. In the |
The red line in the location of the profile of the lower panel. so the distance would be the same. Maybe I could use the -Ab sintaxis (for coupe -Ablon1/lat1/strike/p_length/dip/p_width/dmin/dmax) so I could use p_length to set the axis label directly.
Yes, here I show one frame per month but in the final animation it would one per week or per day (so the movie would be around 1 minute).
No, I did it on excel. But it should be possible to do it with a unix tool. The date is in the name of the event (YYYYOODDHHMM) 200501061335A. And I only use data from 2005 onwards. For older events the names are different.
Yes, good idea. |
Nice job, @Esteban82! I also have a couple of suggestions beyond what @meghanrjones listed:
|
Thanks @PaulWessel. I will see it. |
I am sure @seisman can pull out a clever sed command for this... FYI, I have contacted the CMT people and they are willing to at least look into allowing their web tools to have an option to select time in ISO format as an extra column, but did not have time at the moment ... |
It's possible to use awk, but the command will be very long. Will see if there is a short command for this. |
Perhaps GMT can sniff around in the trailing text somehow and get this time. But not sure how to tell coupe/meca that. |
The ndk2meca script is miles long. Ekstrom may or may not find time to add the time-out feature to his website (code is pretty old I think). So, options: Time is not needed in meca or coupe; it is entirely something just needed by events in animating those features. Given that time is actually present by default in the CMT output, perhaps another solution than to have to insert a time column is to just read it from the trailing text as needed? If events cannot make sense of that time-stamp then we must expect a time column instead? I.e., if first record has timestamp in trailing test then use tralling text for all time records, else expect the extra time column? What do you think, @Esteban82 and @seisman ? I can then cancel the request with Ekstrom and all will work well, and we would not have to worry about introducing yet another "meca" file format just for the rare case of animation. |
Just looking at your data file, first record. Has time as 200501081845A. is it normal that there are no seconds on the time? Or is this variable and other records might have ss at the end? Does the nkd format preserve quake seconds? |
Right @PaulWessel. The names of the focal mechanism after 2005 have that format without seconds. The events from 1976-2005 have this format: 111304G, which correspond to MMDDYY. In the NDK file there is information of the seconds. |
Thanks @Esteban82. I imagine there will be times when seismologist really want/need to know the rupture time down to the second, hence we must preserve the ability to read a time-column. However, for lots of animations like yours, clearly nearest second is more than enough. So I think the ability to get the time from the current record would avoid the gymnastics you had to do in Excel to get time into that column. |
I found an old command to convert the ndk to gmt and I modified to include the date and time to the output:
The output now has the date and the time with SS.X. I plotted with coupe and it works. I will try with events. |
OK let me know. Coupe by itself does not use tiem so events is the test. I suspect you need to replace those slashes with hyphens, i.e., 1977-01-01T21:39:41.3 for a fully ISO format. But, we could possibly handle that internally in events if it comes to that. |
I had to add the exponent to the data so the command that works is (the field of Name could be remove). It would be good if you check that the format is ok.
So now I can plot all the events from 1976-2017 in all the world: |
I don't think events should do any special operations adding a time column. Please note that both meca and coupe can accept focal mechanisms in many different formats. Even for the CMT format, people may still get the focal mechanisms from other agencies. So there is no guarantee that the last column is a string like "YYMMDDhhmmA". |
I forgot to mention that I replaced the / for - in the date. |
OK, I listen to seismologists. No gymnastics, we expect users to add time column. The documentation can give some hints for how that could be done, and maybe Ekstrom will help us down the road to make it an optional format. |
I managed to get correct output format from all the ndk files with this:
The output look like this: However I noticed that if I joint the 2 commands like this:
I get an error in the last column. If this a bug in gmt convert? 91.01 38.15 27 322 37 127 98 61 65 25 1977-01-01T21:39:41.3 C200807270118A Also, when I use sort the output was ok |
I agree the coloring/gray-shade is a great way to convey what events are being shown in the cross-section. And by seismic events you mean the non-CMT small circles, right? Yes, maybe cleaner without them. |
I cannot test the gmtconvert issue above since the ndk files are not in this branch. Maybe add them for now - we can always remove and finalize before merging the official version. |
@hi @Esteban82, this single command works for me (I assume you were using gmtconvert to get tabs?): gawk '/^PDE/ {Date=$2; Time=$3; Lat=$4; Long=$5; Depth=$6; getline; Name=$1; getline; getline; Exp=$1; getline; strike1=$12; dip1=$13; rake1=$14; strike2=$15; dip2=$16; rake2=$17; print Long, Lat, Depth, strike1, dip1, rake1, strike2, dip2, rake2, Exp, Date "T" Time, Name}' jan76_dec17.ndk | sed -e 's///-/g' -e 's/ /\t/g' > meca.gmt |
Right, sorry @PaulWessel.The problem is that I downloaded all the ndk files available (the one I uploaded and then 35 more files, one per each month from 2018 to 2020). Here is the link with the 2018 year. So, when I use gawk with *.ndk (instead of jan76_dec17.ndk) the records in the output were mixed (due to name of the ndk file) and I have to order them by date. Maybe for the animation, i could use the jan76_dec17.ndk only. But it seems that there is an issue with gmt convert. |
Can you tell me what the gmt convert error you see is? It runs for me on that single file. I took a few records from that file and changed the order then ran gmt convert -N and it sorted them. |
Yes, I agree it looks good to only color ones shown in the profile and it would be better with only the beach balls shown. I would prefer a colormap like 'inferno', 'hot',' or 'magma' for the depth coloring. |
yes, those are true. Also, need to remove superfluous quotes around filenames with no variables or spaces, e.g. "meca.gmt", etc. |
Change to @meca.gmt, remove quotes and add -Fmp4
Done @meghanrjones. I am afraid I don't know how to change the permission to a+x. |
I just merged master into this branch so we are getting very close to merging this final branch back to master. |
Is this important? https://github.com/GenericMappingTools/gmt/actions/runs/797990491 |
Also fix some spellings and link in anim14 with other animations
I don't think so (yet). Note, I just added some updates (fix a few spellings etc) and added the anim14.rst file and where it is called in animations.rst. @Esteban82, could you please git pull and make any changes you would like to see in the anim14.rst file? @meghanrjones can run the animation and
THen I think we can remove the WIP from the title, run all tests etc, and be ready to merge, no? |
I just revised the rst file (fix a typo). Remember that the timing of the animation can be reduced after #5142. But It can be updated later. |
Thanks. Yep, I will look for an implementation of that, or at least explain a workaround, but this wont be done for 6.2.0. |
Took 1 hour 35 minutes on my Mac Pro... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, @Esteban82!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go. Thanks @Esteban82 for a very nice demonstration of new events capabilities!
You are welcome. Should I Squash and merge? |
yes, please have the honor since it is your branch. |
I share with you my idea for animation 14 to show the ability to make a movie with meca and coupe. There are many details that can be improve in the script but now I would like to know your general opinion before I go on improving the scripts and the animation.
About the data: I used the Global CMT web page and I add a column with the time.
Here I shared a link of the movie.