How to display MTSAT HRIT data source using Jython Shell
- rosmadinor
- Posts: 13
- Joined: Tue Jun 12, 2012 2:36 am
How to display MTSAT HRIT data source using Jython Shell
Hi,
I'm a new user of McIDAS-V. Sorry if this question already have answered in this forum.
Right now i'a try to writing a script about MTSAT HRIT data format using the jython shell. The data format is look like this IMG_DK01VIS_201208010432_001 etc. The data have 50 files include all channel.
I've try to write the script like this :
desc=getDescriptor('MTSAT','MTSAT HRIT')
myMetaData,myData=getADDEImage(server='localhost:8112',dataset='MTSAT',descriptor=desc,unit='BRIT')
when i want to display the image, i write:
dataLayer=panel[0].createLayer('Image Display',myData)
BUT, error comes out:
Error: Traceback (most recent call last): File "", line 1, in File"", line 622, in createLayer TypeError: ucar.unidata.data.DataDataChoice(): 2nd arg can't be coerced to visad.Data
For your info, when i tried to read this kind of data by not using the jython shell, i CAN display the IMAGE.
Hope you all can help me solve this problem.
THANKS
REGARDS
alongading
I'm a new user of McIDAS-V. Sorry if this question already have answered in this forum.
Right now i'a try to writing a script about MTSAT HRIT data format using the jython shell. The data format is look like this IMG_DK01VIS_201208010432_001 etc. The data have 50 files include all channel.
I've try to write the script like this :
desc=getDescriptor('MTSAT','MTSAT HRIT')
myMetaData,myData=getADDEImage(server='localhost:8112',dataset='MTSAT',descriptor=desc,unit='BRIT')
when i want to display the image, i write:
dataLayer=panel[0].createLayer('Image Display',myData)
BUT, error comes out:
Error: Traceback (most recent call last): File "", line 1, in File"", line 622, in createLayer TypeError: ucar.unidata.data.DataDataChoice(): 2nd arg can't be coerced to visad.Data
For your info, when i tried to read this kind of data by not using the jython shell, i CAN display the IMAGE.
Hope you all can help me solve this problem.
THANKS
REGARDS
alongading
Re: How to display MTSAT HRIT data source using Jython Shell
Has the dataset been added to the local data manager? The easiest way to set up the script to access this data, is to use the information from the ADDE data manager.
1.) Select Tools>Manage ADDE Datassets on Main Display Toolbar.
2.) Click Local Data tab
Has the MTSAT data been added? If it has, please check that it can be displayed in an interactive session. A tutorial is here:
http://www.ssec.wisc.edu/mcidas/softwar ... ery1.2.pdf
If you data has already been added to the ADDE local data manager, use the information in the server manager to access the data in your script:
As an example, I will use the dataset highlighted in blue (see picture for step 2 above).
At that point, I can get the descriptor needed for the script
If the dataset has been added to the server manager and the information supplied to the script is correct (i.e. dataSet and imageType), desc will be a mix of numbers an letters (e.g. 'D2725499'), otherwise, it will still be 'None.'
Joleen
1.) Select Tools>Manage ADDE Datassets on Main Display Toolbar.
2.) Click Local Data tab
Has the MTSAT data been added? If it has, please check that it can be displayed in an interactive session. A tutorial is here:
http://www.ssec.wisc.edu/mcidas/softwar ... ery1.2.pdf
If you data has already been added to the ADDE local data manager, use the information in the server manager to access the data in your script:
As an example, I will use the dataset highlighted in blue (see picture for step 2 above).
Code: Select all
dataSet = 'AVIATION'
imageType = 'turbulence'
desc = None # add this assignment to assist in checking code
At that point, I can get the descriptor needed for the script
Code: Select all
localEntries = _mcv.getServerManager().getLocalEntries().toArray() # get all entries of local servers
for entry in localEntries:
if entry.getName() == imageType and entry.getGroup() == dataSet: # check for match of dataSet and imageType
desc = str(entry.getDescriptor()).upper() # if a match is found, get current desc
break # exit loop if match is found
# loops blocks defined by indentation
print desc # dedent means code is outside for/if block
If the dataset has been added to the server manager and the information supplied to the script is correct (i.e. dataSet and imageType), desc will be a mix of numbers an letters (e.g. 'D2725499'), otherwise, it will still be 'None.'
Joleen
- rosmadinor
- Posts: 13
- Joined: Tue Jun 12, 2012 2:36 am
Re: How to display MTSAT HRIT data source using Jython Shell
tq joleenf for your reply.
actually i've try the second step but the error still comes out.
Here it my step...
step 1 (make sure the data added to local dataset)
step 2 (valid descriptor)
step3 (try to read the data)
step 4 (error comes out)
For your info, i'm using MTSAT HRIT data type not the MCIDAS AREA FORMAT.
HOPEFULLY you can help me to solve this problem. I also can read this MTSAT HRIT data using the MCIDAS interactive software.
This is my final product.
I really need this script to run it automatically. Hope to hear from you soon.
Thanks for helping me sir.
actually i've try the second step but the error still comes out.
Here it my step...
step 1 (make sure the data added to local dataset)
step 2 (valid descriptor)
step3 (try to read the data)
step 4 (error comes out)
For your info, i'm using MTSAT HRIT data type not the MCIDAS AREA FORMAT.
HOPEFULLY you can help me to solve this problem. I also can read this MTSAT HRIT data using the MCIDAS interactive software.
This is my final product.
I really need this script to run it automatically. Hope to hear from you soon.
Thanks for helping me sir.
Re: How to display MTSAT HRIT data source using Jython Shell
After getDescriptor is run in the jython shell, could you print it? Is -1 being returned or the descriptor?
If "desc" is valid, then it might mean that more information needs to be added to the getADDEImage image request.
Also, some error information may already be in your mcidasv.log, located in the McIDAS-V directory. It may help to diagnose the problem if you attach the mcidasv.log information to your next post.
Joleen
Code: Select all
desc = getDescriptor('MTSAT','SECFILE')
print desc
If "desc" is valid, then it might mean that more information needs to be added to the getADDEImage image request.
Also, some error information may already be in your mcidasv.log, located in the McIDAS-V directory. It may help to diagnose the problem if you attach the mcidasv.log information to your next post.
Joleen
- rosmadinor
- Posts: 13
- Joined: Tue Jun 12, 2012 2:36 am
Re: How to display MTSAT HRIT data source using Jython Shell
thanks jooleenf.
this is the data format MTSAT section file that i've used.
and this is the mcidasv.log that you requested.
thanks for your help.
this is the data format MTSAT section file that i've used.
and this is the mcidasv.log that you requested.
thanks for your help.
Re: How to display MTSAT HRIT data source using Jython Shell
Hi rosmadinor,
After you do getADDEImage, can you please type this into the Jython Shell:
and post the result here?
Thanks,
Mike
After you do getADDEImage, can you please type this into the Jython Shell:
Code: Select all
print type(myData)
Thanks,
Mike
- rosmadinor
- Posts: 13
- Joined: Tue Jun 12, 2012 2:36 am
Re: How to display MTSAT HRIT data source using Jython Shell
Hi Mike,
Here is the result after run the script 'print type(myData)'
Thanks for your help MIKE.
Hope you can assist me.
Regards
Here is the result after run the script 'print type(myData)'
Thanks for your help MIKE.
Hope you can assist me.
Regards
Re: How to display MTSAT HRIT data source using Jython Shell
Thanks - that confirms that the failure is happening in getADDEImage and not createLayer.
We need one more piece of information - can you also post the result of this:
We need one more piece of information - can you also post the result of this:
Code: Select all
print desc
- rosmadinor
- Posts: 13
- Joined: Tue Jun 12, 2012 2:36 am
Re: How to display MTSAT HRIT data source using Jython Shell
Hi Mike,
Sorry for my late reply.
This is the result...
Regards.
Rosmadinor
Sorry for my late reply.
This is the result...
Regards.
Rosmadinor
Re: How to display MTSAT HRIT data source using Jython Shell
Thanks and I'm also sorry for my late reply. It looks like you are getting a valid descriptor so the problem is most likely that you are not including enough information in the getADDEImage request.
I'm not sure exactly which keyword you need to include. You can look at the scripting documentation for examples of valid combinations of keywords:
http://www.ssec.wisc.edu/mcidas/softwar ... ing1.2.pdf
Alternatively, you could upload your file to our FTP server and I'll try tinkering with it myself. You can follow Bob's instructions in this thread:
viewtopic.php?f=24&t=1116&hilit=ftp
I'm not sure exactly which keyword you need to include. You can look at the scripting documentation for examples of valid combinations of keywords:
http://www.ssec.wisc.edu/mcidas/softwar ... ing1.2.pdf
Alternatively, you could upload your file to our FTP server and I'll try tinkering with it myself. You can follow Bob's instructions in this thread:
viewtopic.php?f=24&t=1116&hilit=ftp