Skip to content
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

[ENHANCEMENT] #15

Open
AnkithThodupunoori opened this issue Sep 13, 2022 · 33 comments
Open

[ENHANCEMENT] #15

AnkithThodupunoori opened this issue Sep 13, 2022 · 33 comments
Assignees
Labels
bug Something isn't working

Comments

@AnkithThodupunoori
Copy link

Instructions

Read the instructions and fill out your responses at the bottom.

Relation

Is your feature request related to a problem? Please describe. Please provide a clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Description

A clear and concise description of what you want to happen.

Alternatives

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

FILL ME OUT

Relation

.hdr files which are located in DEM_GLOBE folder are unable to be read by code. when ever i execute RUN_Airspace_1, it throws an error saying "e10g" file format unable to read. i have tried to with automatic generated file format by running setup script and with manual downloaded file. both doesnt work.

Description

the error thrown by matlab looks like shown bellow. can i know how to get rid of this issue and execute the code further.

Error using georasterinfo (line 70)
Unable to read 'e10g'. Format may not be supported, file may be corrupt, or a supporting file may have been
specified.

Error in msl2agl (line 189)
info = georasterinfo(inFile);

Error in readAirspace (line 108)
parfor i=1:1:numel(LAT_deg)

Error in RUN_Airspace_1 (line 30)
airspaceUS = readAirspace('inFile',inFile,...

Alternatives

Additional

@AnkithThodupunoori AnkithThodupunoori added the enhancement New feature or request label Sep 13, 2022
@aweinert-MIT aweinert-MIT self-assigned this Sep 13, 2022
@aweinert-MIT
Copy link
Member

What version of MATLAB are you using? Can you please confirm you successfully ran the startup scripts?

@aweinert-MIT aweinert-MIT added bug Something isn't working and removed enhancement New feature or request labels Sep 13, 2022
@AnkithThodupunoori
Copy link
Author

my matlab version is R2021b, i executed the setup file, but i am not sure it executed completely, i attached a picture what it is showing at the end when i run setup file.

Em_Core issues

@aweinert-MIT
Copy link
Member

Unable to establish SSL connection, so it looks like the files were not downloaded. You can confirm this by inspecting if the files are in the `em-core/data/DEM-GLOBE directory.

A common culprit is not setting a web proxy if you're working on a managed network.

@AnkithThodupunoori
Copy link
Author

files are already in dem_gobe folder
dem_globe files

@aweinert-MIT
Copy link
Member

That's good. The files are there, so we can assume the system environment variable was set correctly. Is em-core added to your MATLAB path?

@AnkithThodupunoori
Copy link
Author

yes it is added to the path

@aweinert-MIT
Copy link
Member

georasterinfo is part of the MATLAB mapping toolbox. Can you please confirm you have access to the mapping toolbox?

@AnkithThodupunoori
Copy link
Author

yes, mapping tool box is installed in my matlab.
image

@AnkithThodupunoori
Copy link
Author

in gerasterinfo , at line 37, the command is not able to execute, thats the one throwing error
image

@AnkithThodupunoori
Copy link
Author

AnkithThodupunoori commented Sep 14, 2022

is it a file format issue or the matlab file "georasterinfo" ?

@aweinert-MIT
Copy link
Member

On Line 108, replace parfor with for, so it reads fori=1:1:numel(LAT_deg)

@aweinert-MIT
Copy link
Member

On Line 108, replace parfor with for, so it reads fori=1:1:numel(LAT_deg)

@AnkithThodupunoori Where you able to test this proposed change? Do you have access to the parallel toolbox. If no, replace 'parfor' may address the bug. Also replacing it should produce a different error message, which hopefully should be more insightful.

@AnkithThodupunoori
Copy link
Author

i have the parfor tool box. anyway i made the changes as you asked to replace the parfor to for loop, this is the error i am getting after executing the code.
image

@aweinert-MIT
Copy link
Member

what is inFile on line 189? That error reads like it can find the e10g file, but you're previously shown it is downloaded:

files are already in dem_gobe folder dem_globe files

@AnkithThodupunoori
Copy link
Author

infile represents the "e10" file, matlab is able to find the file but it just cant read the file.
image

@aweinert-MIT
Copy link
Member

If you change directory to DEM-GLOBE, can you load the file via command line?

@AnkithThodupunoori
Copy link
Author

it gives the same error, saying unable to read the file format or file may be corrupted, as shown below.
image

@AnkithThodupunoori
Copy link
Author

if i use the fileread function, it reads the data in characters but cannot be displayed as the legth of the character is too large.
image

but when i use the same function which is used in georasterinfo, it throws the error as usual.
image

@aweinert-MIT
Copy link
Member

Have you tried redownloading e10g manually and confirm it isn't corrupted?

@AnkithThodupunoori
Copy link
Author

Yes, Just now downloaded manually and tried to execute the code, it shows same error.

@aweinert-MIT
Copy link
Member

The output should look something like this (I slightly censored the Filename property):

>> inFile = [getenv('AEM_DIR_CORE') filesep 'data' filesep 'DEM-GLOBE' filesep 'e10g'];
>> info = georasterinfo(inFile)
Warning: Projection information missing from 'e10g'. Assuming the RasterReference property is a map raster reference object. 
> In georasterinfo>constructRasterReference (line 163)
In georasterinfo (line 52) 
info = 
  RasterInfo with properties:

                     Filename: ["\em-core\data\DEM-GLOBE\e10g"    "\em-core\data\DEM-GLOBE\e10g.hdr"]
             FileModifiedDate: [2004-05-07 13:31:30    2004-05-07 13:48:38]
                     FileSize: [129600000 340]
                   FileFormat: "Esri GridFloat"
                   RasterSize: [6000 10800]
                     NumBands: 1
                 NativeFormat: "int16"
         MissingDataIndicator: -500
                   Categories: []
                    ColorType: "unknown"
                     Colormap: []
              RasterReference: [1×1 map.rasterref.MapCellsReference]
    CoordinateReferenceSystem: []
                     Metadata: []
>> 

@aweinert-MIT
Copy link
Member

Is both e10g and e10g.hdr in your directory?

@AnkithThodupunoori
Copy link
Author

NO, I have only one file "e10g" in my directory.

@AnkithThodupunoori
Copy link
Author

i tried to generate the output of the file using the code you posted above, this is how it showing.
image

@aweinert-MIT
Copy link
Member

The bug looks to be with using georasterinfo and not the MATLAB code in em-core. Only the e10g file is required and extracted from the zip downloaded using the setup.sh script. The file size of e10g is the same as what you reported and what I redownloaded this afternoon. I successfully tested georasterinfo using MATLAB R2020b and R2022a.

Brainstorming here, can you confirm exist() returns 2 and which returns something the mapping toolbox directory?

>>  inFile = [getenv('AEM_DIR_CORE') filesep 'data' filesep 'DEM-GLOBE' filesep 'e10g'];
>> exist(inFile)
ans =
     2
>> which inFile

@AnkithThodupunoori
Copy link
Author

This is what it return when used the suggested commands
image

@aweinert-MIT
Copy link
Member

What about which georasterinfo?

@AnkithThodupunoori
Copy link
Author

image

@aweinert-MIT
Copy link
Member

All those returns are what is expected

@AnkithThodupunoori
Copy link
Author

So do you what exactly the problem here? is it the matlab version i am using?

@aweinert-MIT
Copy link
Member

I don't think it is the MATLAB version because I tested a version older and newer than what you're using. MATLAB recognizes the file exists and which indicates the correct georasterinfo is on the path.

I'm a bit stumped on the bug. For sanity, can you try loading the file using readgeoraster? It should fail like when using georasterinfo

@AnkithThodupunoori
Copy link
Author

yes, looks like it failed same like before
image

@aweinert-MIT
Copy link
Member

I'm still musing about what the bug could be here because its with a built-in MATLAB function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants