-
Notifications
You must be signed in to change notification settings - Fork 66
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
Modem updates #136
base: develop
Are you sure you want to change the base?
Modem updates #136
Conversation
…odem file formats for testing
…of the max elevation
ModEM RMS maps seems to be broken on this branch now? I tried running the example /examples/scripts/ModEM_PlotRMS.py and it doesn't work on modem_updates but works on develop: Traceback (most recent call last): File "C:\mtpywin\mtpy\examples\scripts\ModEM_PlotRMS.py", line 54, in File "C:\mtpywin\mtpy\mtpy\modeling\modem\plot_rms_maps.py", line 240, in init File "C:\mtpywin\mtpy\mtpy\modeling\modem\plot_rms_maps.py", line 427, in plot File "C:\mtpywin\mtpy\mtpy\modeling\modem\plot_rms_maps.py", line 259, in _calculate_rms IndexError: only integers, slices ( |
I also get an error when trying to create a datafile: running example mtpy\examples\scripts\ModEM_build_inputfiles.py: ERROR:mtpy.modeling.modem.data.Data:'utf-32-le' codec can't decode bytes in position 0-3: code point not in range(0x110000) File "C:\mtpywin\mtpy\mtpy\modeling\modem\data.py", line 895, in fill_data_array File "C:\mtpywin\mtpy\mtpy\modeling\modem\data.py", line 490, in get_relative_station_locations File "C:\mtpywin\mtpy\mtpy\modeling\modem\station.py", line 267, in get_station_locations File "C:\mtpywin\mtpy\mtpy\modeling\modem\station.py", line 284, in calculate_rel_locations File "C:\mtpywin\mtpy\mtpy\modeling\modem\station.py", line 359, in center_point UnicodeDecodeError: 'utf-32-le' codec can't decode bytes in position 0-3: code point not in range(0x110000) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\mtpywin\mtpy\examples\scripts\ModEM_build_inputfiles.py", line 78, in File "C:\mtpywin\mtpy\mtpy\modeling\modem\data.py", line 1255, in write_data_file File "C:\mtpywin\mtpy\mtpy\modeling\modem\data.py", line 906, in fill_data_array ValueError: 'utf-32-le' codec can't decode bytes in position 0-3: code point not in range(0x110000) |
@alkirkby RMS Plots fails because there is an option to set the attribute period_index to "all". From the logic it looks _calculate_rms only wants an integer to return the rms array. So the question is what is meant by "all"? Is it to plot each period separately, or is it supposed to be a single plot where all periods are averaged or something else? If its plot a summarization of all periods in one plot, I added a fix using np.nanmean() and it works. |
…all periods into one plot
…all periods into one plot
|
And the error you are getting is: ValueError: 'utf-32-le' codec can't decode bytes in position 0-3: code point not in range(0x110000) That sounds like an encoding issue. What type of machine are you on? |
What do you get if you |
the do.station_locations object is None. Perhaps we should catch up on skype to try and sort this out? |
I've finished most of the updates to the ModEM module. Merged with the most recent version of develop. |
There was a merge conflict that I messed up in utils/calculator.py with rounding numbers. Updated to what is on the develop branch. |
examples/scripts/ModEM_PlotPTmap.py needed a small tweak (on this branch and develop) so that files save correctly. I have made the change on the develop branch. |
Everything else works fine for me so once basemap plot is resolved should be good to go. Sorry I introduced conflicts - I have updated occam2d to fix issue #135 so I think that just needs to be brought across but check you are happy with it. |
…ive paths, haven't found the issue yet with the plotting
Any resolution on this, I'm having issues installing mpl_toolkits.basemap and haven't been able to test it. |
Ah sorry no I haven't looked into it. You need to install basemap e.g. conda install basemap (I think) then you should be able to get the modules from mpl_toolkits. I will look at it now |
I found the bug but need to go now unfortunately so haven't managed to fix it. It's plotting in the wrong spot because the center point is projected from lat/long to east/north using the utm zone of that center point, not the model_epsg that is optionally passed into the data object. It should just be a minor tweak (hopefully) |
Update to functionality of Modem tools and updated documentation.
Description
ocean_bottom
argument in project_stations_on_topography to place stations at bottom of oceanStation.write_shp_file
to write a shapefile of station locationsMotivation and Context
Adding functionality
How Has This Been Tested?
Added test for Data.
Screenshots (if appropriate):
Types of changes
Checklist: