can you please tell me which part of those code helps on reading CRF and other files? #16
-
hello gedaskir, nice to know you. do you think your code 'ResultDataExtract.py' can read CRF, PRF, TRF, XRF files? i would be so appreciate, if you cound enlight me how to make it happened. Please help, you can email me for detailed discussions. cheers |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments
-
Hello johnhhu That should work out of the box, by just replacing the res1d input filename with the crf/prf filename when executing the script (unless you have a very old crf/prf file, which is not supported by MIKE 1D). |
Beta Was this translation helpful? Give feedback.
-
Hello JesperGr, thanks for your quick reply, whereas I still need your help on the using of this script. Say I want to query every information from a PRF file, what should be my sample code? Or if I want to save the FloodRate info into a output csv file. many thanks |
Beta Was this translation helpful? Give feedback.
-
I have tried What can I do to extract data from a PRF file properly? |
Beta Was this translation helpful? Give feedback.
-
Hello johnhhu, As Jesper mentioned the script ResultDataExtract.py should work for CRF/PRF files out of the box. I just tested it with IronPython 3.4.0-alpha1 and installation of Mike Zero 2020 Update 1 and it does export from CRF to CSV file. As far as I can see you also can retrieve the available quantities, so it shows that Mike libraries are loaded on your machine. You mention that the export of water level does not work. What kind of errors do you get? Additionally, improvements need to be made for the example script to be able to export all of the information from PRF file easily. |
Beta Was this translation helpful? Give feedback.
-
OK, I got the company computer. Here is the error code: ''' I got the MIKE Zero 2021 installed, and opened WIndows Command Prompt and cd to IronPython environment, put PRF file and XRF files inside, and ran this code The wield stuff have happened manytimes on my company computer. |
Beta Was this translation helpful? Give feedback.
-
The problem here is clear. You do not have sufficient permissions to write the CSV file in C:\Program Files\IronPython 3.4. Try to move the files (ResultDataExtract.py, 10mmBase.PRF, output.csv) to some folder where you have write access and execute the wanted command C:\Program Files\IronPython 3.4\ipy.exe ResultDataExtract.py 10mmBase.PRF output.csv reach:WaterLevel:Link_99 from within that folder. |
Beta Was this translation helpful? Give feedback.
-
Thank you Gedaskir, It seems my company account does not support files writting under C disk, I ran the Command as Administrator and it works on PRF file, whereas when I was trying to extract data in another file - a TRF or XRF, here is what I got (below commands should show me what available quantities are available in those files): C:\Program Files\IronPython 3.4>ipy.exe ResultDataExtract.py 10mmBase.TRF Reach_TRF_Link_999_FlowVelocity_Output.csv reach: C:\Program Files\IronPython 3.4>ipy.exe ResultDataExtract.py result-1A.XRF Reach_XRF_Link_999_FlowVelocity_Output.csv reach C:\Program Files\IronPython 3.4>ipy.exe ResultDataExtract.py 10mm_BuildingBase.CRF Reach_XRF_Link_999_FlowVelocity_Output.csv reach |
Beta Was this translation helpful? Give feedback.
-
The first two errors point to some kind of Mike1D bug. Also the TRF/XRF may be of older format not supported by Mike1D or the files have no data. It is possible to say what is really happening only by investigating the files. It makes sense that there is no reach information for CRF file, because it is a Catchment Result File (CRF). |
Beta Was this translation helpful? Give feedback.
-
Thank you Gedaskir and JesperGr, your comments helped me a lot. I'll check those files and understand Mike product better. |
Beta Was this translation helpful? Give feedback.
-
And again, thanks for your time, patient and kindness. Sincerely |
Beta Was this translation helpful? Give feedback.
-
Nice to see that the script is used. Though some improvements are needed. Also glad to help :-) |
Beta Was this translation helpful? Give feedback.
-
problem solved |
Beta Was this translation helpful? Give feedback.
The problem here is clear. You do not have sufficient permissions to write the CSV file in C:\Program Files\IronPython 3.4. Try to move the files (ResultDataExtract.py, 10mmBase.PRF, output.csv) to some folder where you have write access and execute the wanted command
C:\Program Files\IronPython 3.4\ipy.exe ResultDataExtract.py 10mmBase.PRF output.csv reach:WaterLevel:Link_99
from within that folder.