Couple of features
Re: Couple of features
Hi Sir,
I will send you the files tomorrow.
Ghansham
I will send you the files tomorrow.
Ghansham
Re: Couple of features
Hi All
Some more additions. I have added some more options to control the fonts of Axis Labels.
And another one is that xaxis options of lat/lon/dist also work for DataTransect. I have disabled
yaxis options as it cant be pressure/altitude.
Another interesting bug that I encountered was that when we try to change vertical range in
cross-section views and click "From All Data" in Predefined it actually picks the range of the parameter
and not of the vertical axis. Anyways I have posted that query on IDV forum.
Meanwhile I also tried to fix it for time being;-)...
Another major change I have done in change Vertical Range is that when Auto-Scale is checked,
the "Change" Vertical Range Button remains disabled. The user can change range only when
Auto-Scale is unchecked. This is the way I am thinking.
If anybody thinks this is not correct. Just let me know.
Attached herewith a snapshots showing transect as well font control.
The yaxis scale font color is different from xaxis font color. That is another issue.
regards
Ghansham
Some more additions. I have added some more options to control the fonts of Axis Labels.
And another one is that xaxis options of lat/lon/dist also work for DataTransect. I have disabled
yaxis options as it cant be pressure/altitude.
Another interesting bug that I encountered was that when we try to change vertical range in
cross-section views and click "From All Data" in Predefined it actually picks the range of the parameter
and not of the vertical axis. Anyways I have posted that query on IDV forum.
Meanwhile I also tried to fix it for time being;-)...
Another major change I have done in change Vertical Range is that when Auto-Scale is checked,
the "Change" Vertical Range Button remains disabled. The user can change range only when
Auto-Scale is unchecked. This is the way I am thinking.
If anybody thinks this is not correct. Just let me know.
Attached herewith a snapshots showing transect as well font control.
The yaxis scale font color is different from xaxis font color. That is another issue.
regards
Ghansham
Re: Couple of features
Hi Ghansham,
I am often creating individual images of cross sections to combine into a movie. For those, I often have to type in the lat/lon endpoints manually in the layer controls. If I make a mistake, this can be a time consuming process. After working with this so closely, do you know the methods which change the lat/lon endpoints for the cross section layer? It would be much more efficient to set up a series of points, I could loop through, change the location, capture an image in a script.
Thanks,
Joleen
I am often creating individual images of cross sections to combine into a movie. For those, I often have to type in the lat/lon endpoints manually in the layer controls. If I make a mistake, this can be a time consuming process. After working with this so closely, do you know the methods which change the lat/lon endpoints for the cross section layer? It would be much more efficient to set up a series of points, I could loop through, change the location, capture an image in a script.
Thanks,
Joleen
Re: Couple of features
hi Joleen...
You can try something like this in jython script (assuming dc is the crossectioncontrol)
cs_selector =dc.getCrossSectionSelector();
#here start and end are the realtuples defining your start and end points
cs_selector.setPosition(start, end)
I hope it gives you some hint.
It should work. I have not tried though.
regards
Ghansham
You can try something like this in jython script (assuming dc is the crossectioncontrol)
cs_selector =dc.getCrossSectionSelector();
#here start and end are the realtuples defining your start and end points
cs_selector.setPosition(start, end)
I hope it gives you some hint.
It should work. I have not tried though.
regards
Ghansham
Re: Couple of features
Hi Ghansham,
I have a feeling there is a step that I miss when I do this. I think I have tried this in the past with the same results as today. For a test, I added a "Display ID" to the cross section layer called "myLayer."
In the jython shell, I used findDisplayControl to get the layer control...
I get the following error:
I know this slice is in the data, it is a replication of a push I used interactively. Am I reading this error correctly, does it seem that retrieving the data failed?
Joleen
I have a feeling there is a step that I miss when I do this. I think I have tried this in the past with the same results as today. For a test, I added a "Display ID" to the cross section layer called "myLayer."
In the jython shell, I used findDisplayControl to get the layer control...
Code: Select all
layerControl = findDisplayControl("myLayer")
# now create earth location objects with the desired lat/lon endpoints
startLoc = Util.makeEarthLocation(38.1,-99.4)
endLoc = Util.makeEarthLocation(28.2,-99.1)
#try using setPosition
layerControl.setPosition(startLoc,endLoc)
I get the following error:
I know this slice is in the data, it is a replication of a push I used interactively. Am I reading this error correctly, does it seem that retrieving the data failed?
Joleen
Re: Couple of features
Hi joleen,
Give me a day, caught up with some high priority stuff.
Will get back to you with a sample script.
But I will tell you name of two persons who are jython experts. One is hydra codefather.
They both are Tom. Any guess?
TomW and TomR sir.
I am a big fan of both of them.
I will get back to you.
Regards
Ghansham
Give me a day, caught up with some high priority stuff.
Will get back to you with a sample script.
But I will tell you name of two persons who are jython experts. One is hydra codefather.
They both are Tom. Any guess?
TomW and TomR sir.
I am a big fan of both of them.
I will get back to you.
Regards
Ghansham
Re: Couple of features
Hi Ghansham,
No worries. I will check with Tom and Jonathan. I believe this is close to the right path.
Joleen
No worries. I will check with Tom and Jonathan. I believe this is close to the right path.
Joleen
Re: Couple of features
hi..
This script should be able to solve your problem
def makeEarthLocation2(lat, lon):
from visad import Real
from visad import RealType
from visad import RealTuple
from visad import RealTupleType
reals = []
reals.append(lon)
reals.append(lat)
reals.append(0)
return RealTuple(RealTupleType.SpatialEarth3DTuple, reals);
def cstest(filename, choice_name, lon0, lat0, lon1, lat1):
ds=makeDataSource(filename, "FILE.NETCDF")
field=getData(ds.getName(), choice_name)
print field.getType()
control=createDisplay("colorxs", field);
control.applyPreferences()
pause()
cs_selector = control.getCrossSectionSelector();
point_type = cs_selector.getStartPoint().getType()
import ucar.visad.Util as ut
from visad import RealTupleType
if point_type == RealTupleType.SpatialEarth3DTuple:
start = makeEarthLocation2(lat0, lon0)
end = makeEarthLocation2(lat1, lon1)
elif point_type == RealTupleType.LatitudeLongitudeAltitude:
start= ut.makeEarthLocation(lat0, lon0)
end=ut.makeEarthLocation(lat1, lon1)
cs_selector.setPosition(start, end)
pause()
This script should be able to solve your problem
def makeEarthLocation2(lat, lon):
from visad import Real
from visad import RealType
from visad import RealTuple
from visad import RealTupleType
reals = []
reals.append(lon)
reals.append(lat)
reals.append(0)
return RealTuple(RealTupleType.SpatialEarth3DTuple, reals);
def cstest(filename, choice_name, lon0, lat0, lon1, lat1):
ds=makeDataSource(filename, "FILE.NETCDF")
field=getData(ds.getName(), choice_name)
print field.getType()
control=createDisplay("colorxs", field);
control.applyPreferences()
pause()
cs_selector = control.getCrossSectionSelector();
point_type = cs_selector.getStartPoint().getType()
import ucar.visad.Util as ut
from visad import RealTupleType
if point_type == RealTupleType.SpatialEarth3DTuple:
start = makeEarthLocation2(lat0, lon0)
end = makeEarthLocation2(lat1, lon1)
elif point_type == RealTupleType.LatitudeLongitudeAltitude:
start= ut.makeEarthLocation(lat0, lon0)
end=ut.makeEarthLocation(lat1, lon1)
cs_selector.setPosition(start, end)
pause()
Re: Couple of features
Hi Joleen...
use this file.
Ghansham
use this file.
Ghansham
- Attachments
-
- cstest.py
- (1.03 KiB) Downloaded 473 times
Re: Couple of features
Thank-you!!!!! This is going to save me so much time. Ghansham, your code works well as written, I have also tested blending the interactive display with scripting. In this case, I have already displayed a cross section via the Field Selector[ If I set the layer id and grab the display control as outlined in this post:
viewtopic.php?f=26&t=1019&hilit=layer+id ,
I can get the ColorCrossSectionControl as well. So instead of loading the file via a script:
I also have the option of
1.) loading via the interactive browser, removing the lines above which retrieve the data (makeDataSource, getData)
2.) setting the layer ID to a known string (eg. "CrIS_RTV") and replacing the createDisplay line with
This is going to be a big help for me! Thanks so much!
Joleen
viewtopic.php?f=26&t=1019&hilit=layer+id ,
I can get the ColorCrossSectionControl as well. So instead of loading the file via a script:
Code: Select all
ds=makeDataSource(filename, "FILE.NETCDF")
field=getData(ds.getName(), choice_name)
print field.getType()
control=createDisplay("colorxs", field);
control.applyPreferences()
I also have the option of
1.) loading via the interactive browser, removing the lines above which retrieve the data (makeDataSource, getData)
2.) setting the layer ID to a known string (eg. "CrIS_RTV") and replacing the createDisplay line with
Code: Select all
control = findDisplayControl("CrIS_RTV")
This is going to be a big help for me! Thanks so much!
Joleen