Customize color in Text Point and Trajectory Data Files

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
francoisborel
Posts: 75
Joined: Sat Oct 22, 2016 6:21 pm

Customize color in Text Point and Trajectory Data Files

Post by francoisborel »

Good morning everyone,

I make a track map by the option "Text Point and Trajectory Data Files".
See topic : viewtopic.php?f=14&t=1825

My text file is like this :
198909150000,13.8,-50.5,70
198909150600,14.0,-51.9,70
198909151200,14.2,-53.3,80
198909151800,14.6,-54.6,90
198909160000,14.8,-56.1,90
198909160600,15.1,-57.3,90
198909161200,15.4,-58.4,80

When i choose for the last column the "mi/hr" option in the point data parameter window, everything is okay. I have the map, the track, and the color scale.

But i need to do a different. I want to have a color by intensity level.
For example :
10= Tropical Depression
20= Tropical Storm
30= Hurricane 1
40= Hurricane 2
etc ....

And i want, on my map, to fixe one color for each level (10,20,30......). So like this, on all my track map pictures, i will have the same color for the same intensity, for all of the cyclones that i illustrate.

I see in the documentation the "Color From Parameter" but i'm not able to applicate this in my track layer.

I thank you for all for your help.

Have a nice week.

Best Regards
françois
User avatar
bobc
Posts: 939
Joined: Mon Nov 15, 2010 5:57 pm

Re: Customize color in Text Point and Trajectory Data Files

Post by bobc »

Hello -

It sounds like you are interested in using the "Trajectory/Track Colored By Parameter" display type to draw a line over the trajectory/path of the hurricane, and you want this line colored by intensity. Assuming this is correct, you will have to create your own color table and partition out segments of the color table to be different colors based on intensity.

You can find useful documentation for this on the Color Table Editor page of the User's Guide. You can also look at the Satellite Imagery tutorial on the Documentation page, where Problem Set 1 does some work with the Color Table Editor.

Here's a sample color table I made that contains 7 segments:
  • 0 - 10
  • 10 - 20
  • 20 - 30
  • 30 - 40
  • 40 - 50
  • 50 - 60
  • 60 - 70
Example enhancement
Example enhancement

Note that these segments/bins do not represent the actual threshold wind speed values for tropical storms/hurricanes, this is purely for an example. Here's a rough description of how I created the enhancement (note the numbers 1-5 in the image, they'll be referenced below):

  1. Open the Color Table Editor by Tools> Color Tables in the Main Display window
  2. From the Color Table Editor, select File>New and enter the name of the enhancement. I named mine 'Francois', which corresponds to #1 in the image.
  3. For organizational purposes, you can select the category for your enhancement to be saved to. I chose 'Basic', which corresponds to #2 in the image. You'll see where this comes into use later.
  4. Enter your desired range. For this example, I'm simply using 0 - 70, which is what I have in the text boxes in #3 in the image (press Enter after entering each value).
  5. Since I'm only interested in working with 7 different bins of colors, I set the enhancement to have 7 colors as shown by #4 in the image. You can adjust the number of boxes in the enhancement by using the +/- buttons on either side of the enhancement, which is shown by #5 in the image.
  6. To make sure that the bins start/end where I want them to, I added a variety of breakpoints to the enhancement at intervals of 10. Breakpoints are denoted by upside-down triangles above the enhancement (like the one I circled in the image above 0). To add breakpoints, right-click above the enhancement and choose Add Breakpoint > At Data Point and enter in where you want the breakpoint (for example, 0, 10, 20...).
  7. Use the HSV tab at the bottom to select your color and then click in each of the bins in the enhancement.
  8. When you are done, choose File > Save in the Color Table Editor.

Now that your enhancement has been created, you can create your Trajectory Colored By Parameter display. To apply the enhancement, right-click on the enhancement in the Legend of the Main Display, and navigate to Basic>Francois ('Basic' was set in step 3 above as the Category, and 'Francois' was set as the name in step 2 above).

Please let me know if you have any questions.

Thanks -
Bob Carp
User avatar
francoisborel
Posts: 75
Joined: Sat Oct 22, 2016 6:21 pm

Re: Customize color in Text Point and Trajectory Data Files

Post by francoisborel »

Hello Bob

I'm very thankful to see the time you spent to answer and the quality of your answers generaly !

I thank you a lot. I was able, in one step, to do all you explain (with my dramatic english) and i have my map.

Thank you Bob...

Sincerely
françois
User avatar
francoisborel
Posts: 75
Joined: Sat Oct 22, 2016 6:21 pm

Re: Customize color in Text Point and Trajectory Data Files

Post by francoisborel »

Good morning Bob, good morning everyone ...

I have just a question about trajectory and txt files.
Does McIdas takes two decimal or one decimal number for latitude / longitude.

Here is what i talk about : I need to make a line with theses coordonates :

16.35N 51.85W
17.55N 54.25W

Sorry sorry for my bad english. Tell me if i'm not clear in my question.

Thank you a lot. Have a nice end week.

Cheers
françois
User avatar
bobc
Posts: 939
Joined: Mon Nov 15, 2010 5:57 pm

Re: Customize color in Text Point and Trajectory Data Files

Post by bobc »

Hello -

I set up a text file like:

Code: Select all

20171103010000 35.00 35.00 0
20171103020000 35.25 35.25 5
20171103030000 35.50 35.50 10
20171103040000 35.75 35.75 15
20171103050000 36.00 36.00 20
20171103060000 36.25 36.25 25
20171103070000 36.50 35.50 30
20171103080000 36.75 35.75 35
20171103090000 37.00 37.00 40
20171103100000 37.25 37.25 45

Where the columns are date/time, lat, lon, temperature.

Plotting this as a Point Data Plot does take into account the two decimal places in lat/lon. I proved this by modifying my User Preferences to show 5 decimal places for lat/lon for the data probe and mousing over the display. This was done through the "Formats & Data" tab of the User Preferences window, where I modified "Lat/Lon Format" to "##0.00000". I created a Point Data Plot display of my data, and mousing over the points shows that the two decimal places for lat/lon are used (my 2nd point was at 35.25/35.25 lat/lon).

Is this not working for you?

Thanks -
Bob
User avatar
francoisborel
Posts: 75
Joined: Sat Oct 22, 2016 6:21 pm

Re: Customize color in Text Point and Trajectory Data Files

Post by francoisborel »

Good morning Bob,

I'm very sorry for this late answer.

Yes it's works after changing the parameter.

Thank you very much !

Cheers
françois
Post Reply